/**
 * FoodFinder Widget v2.0 - Styles
 */

/* === DOMYŚLNY STYL (w miejscu wklejenia) === */
.ff-order-widget {
    max-width: 600px;
    margin: 20px auto;
    display: none;
    animation: ffOrderFadeIn 0.5s ease;
}

.ff-order-widget.active {
    display: block;
}

@keyframes ffOrderFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === ANCHOR - punkt odniesienia dla pozycji widgetu === */
.ff-order-anchor {
    height: 1px;
    max-width: 600px;
    margin: 0 auto;
    pointer-events: none;
}

/* === PLACEHOLDER - utrzymuje miejsce gdy widget jest fixed === */
.ff-order-placeholder {
    display: none;
    max-width: 600px;
    margin: 0 auto;
}

.ff-order-placeholder.active {
    display: block;
}

/* === DESKTOP - STICKY MODE (gdy <20% widoczne) === */
@media (min-width: 960px) {
    .ff-order-widget.sticky-mode {
        position: fixed;
        top: 25px;
        /* Pozycja: prawy brzeg przepisu (600px centered) + 30px odstępu */
        left: calc(50% + 330px);
        right: auto;
        max-width: 450px;
        margin: 0;
        z-index: 1000;
        animation: ffOrderSlideIn 0.4s ease;
    }

    @keyframes ffOrderSlideIn {
        from { opacity: 0; transform: translateX(30px); }
        to { opacity: 1; transform: translateX(0); }
    }

    .ff-order-widget.sticky-mode .ff-order-card {
        padding: 20px;
    }

    .ff-order-widget.sticky-mode .ff-order-title {
        font-size: 18px;
    }

    .ff-order-widget.sticky-mode .ff-order-subtitle {
        font-size: 13px;
        margin-bottom: 15px;
    }

    .ff-order-widget.sticky-mode .ff-order-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .ff-order-widget.sticky-mode .ff-order-icon {
        font-size: 14px;
        min-width: 80px;
    }

    .ff-order-widget.sticky-mode .ff-order-platform-desc {
        font-size: 11px;
    }
}

/* Dla mniejszych ekranów desktop (960-1100px) - widget przy prawej krawędzi */
@media (min-width: 960px) and (max-width: 1100px) {
    .ff-order-widget.sticky-mode {
        left: auto;
        right: 15px;
    }
}

.ff-order-card {
    background: #EDE9E0;
    border: 2px solid #F85326;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(248, 83, 38, 0.3);
    text-align: center;
}

.ff-order-title {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #108091;
}

.ff-order-subtitle {
    font-size: 14px;
    margin-bottom: 20px;
    color: #108091;
}

.ff-order-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ff-order-btn {
    background: white;
    color: #F85326;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.ff-order-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #fff5f5;
}

/* Pyszne.pl - pomarańczowy */
#ffPyszneBtn:hover {
    background: #ff8000;
    color: white;
    box-shadow: 0 6px 25px rgba(255, 128, 0, 0.5);
}

/* Wolt - niebieski */
#ffWoltBtn:hover {
    background: #00c1e9;
    color: white;
    box-shadow: 0 6px 25px rgba(0, 193, 233, 0.5);
}

/* Uber Eats - zielony */
#ffUberBtn:hover {
    background: #06c167;
    color: black;
    box-shadow: 0 6px 25px rgba(6, 193, 103, 0.5);
}

/* Glovo - żółty */
#ffGlovoBtn:hover {
    background: #ffcd1b;
    color: #00a182;
    box-shadow: 0 6px 25px rgba(255, 205, 27, 0.5);
}

.ff-order-btn:active {
    transform: translateY(-1px);
}

/* Reset stylu po kliknięciu (focus) - wraca do domyślnego koloru */
.ff-order-btn:focus {
    outline: none;
    background: white;
    color: #F85326;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: none;
}

.ff-order-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.ff-order-icon {
    font-size: 20px;
    text-align: center;
}

.ff-order-status {
    margin-top: 15px;
    font-size: 13px;
    min-height: 20px;
    padding: 0 10px;
    color: #333;
}

.ff-order-footer {
    margin-top: 15px;
    font-size: 12px;
    color: #333;
}

.ff-city-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ff-city-info span {
    opacity: 0.9;
}

.ff-city-info strong {
    opacity: 1;
}

.ff-change-city-btn {
    background: rgba(248, 83, 38, 0.1);
    border: 1px solid #F85326;
    color: #F85326;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ff-change-city-btn:hover {
    background: rgba(248, 83, 38, 0.2);
}

.ff-city-loading {
    opacity: 0.7;
    font-style: italic;
}

@media (max-width: 600px) {
    .ff-order-card {
        padding: 20px;
    }

    .ff-order-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .ff-order-icon {
        font-size: 16px;
        min-width: 80px;
    }

    .ff-order-platform-desc {
        font-size: 11px;
    }
}

/* Modal wyboru miasta */
.ff-city-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ff-city-modal.active {
    display: flex;
}

.ff-city-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 350px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ffModalSlideIn 0.3s ease;
}

@keyframes ffModalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ff-city-modal-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.ff-city-modal-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.ff-city-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: #fafafa;
    color: #333;
    cursor: pointer;
    margin-bottom: 15px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.ff-city-select:focus {
    outline: none;
    border-color: #F85326;
    background-color: white;
}

.ff-city-confirm {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #F85326 0%, #FF7A50 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(248, 83, 38, 0.3);
}

.ff-city-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248, 83, 38, 0.4);
}

.ff-city-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* =====================================================
   MOBILE FAB - Kółeczko "Zamów" na mobile
   ===================================================== */

.ff-mobile-fab {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #f0ede6;
    color: #157E8F;
    border: 3px solid #f85326;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ff-mobile-fab:hover,
.ff-mobile-fab:active,
.ff-mobile-fab:focus {
    background: #f0ede6;
    color: #157E8F;
    border-color: #f85326;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    outline: none;
}

.ff-mobile-fab-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ff-mobile-fab-text {
    font-size: 12px;
    font-weight: bold;
}

/* Pokaż FAB tylko na mobile gdy widget jest aktywny */
@media (max-width: 959px) {
    .ff-mobile-fab.active {
        display: flex;
        align-items: center;
        justify-content: center;
        animation: ffFabFadeIn 0.4s ease;
    }
}

@keyframes ffFabFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
