/* ===================================
   EXTRAS FORM STYLES
   =================================== */

/* Extras Section */
.extras-section {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.extras-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 24px;
    text-align: center;
}

/* Extra Checkbox Item */
.extra-checkbox {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.extra-checkbox:hover {
    background: #ffe8e0;
}

.extra-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-left: 8px;
    cursor: pointer;
    accent-color: #c2410c;
}

.extra-name {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.extra-price {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Quantity Buttons */
.qty-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #c2410c;
    background: white;
    color: #c2410c;
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 8px rgba(230, 126, 34, 0.3));
}

/* Samo uz miš: na mobitelu :hover ostane "zalijepljen" nakon dodira, pa je
   "+" ostajao narančast i uvećan, a "Dodaj" tamniji. */
@media (hover: hover) {
    .qty-btn:not(:disabled):hover {
        background: #c2410c;
        color: white;
        transform: scale(1.1);
        filter: drop-shadow(0 6px 12px rgba(230, 126, 34, 0.5));
    }

    .add-to-cart-btn:hover {
        background: #d35400;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
    }
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quantity Input */
.qty-input {
    width: 100px;
    height: 60px;
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    border: 3px solid #e8e8e8;
    border-radius: 12px;
    background: #f5f5f5;
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 100%;
    padding: 20px;
    background: #c2410c;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(230, 126, 34, 0.3);
}

/* Dok zahtjev traje (hx-disabled-elt u extras_form_partial.html) gumb je
   zaključan, a ikona košarice postane kotačić koji se vrti — gost vidi da je
   dodir primljen i ne stisne ponovno. */
.add-to-cart-btn:disabled {
    opacity: 0.75;
    cursor: progress;
    transform: none;
}

.add-to-cart-btn.htmx-request i::before {
    content: "\f110";           /* fa-spinner */
}

.add-to-cart-btn.htmx-request i {
    animation: fa-spin 1s linear infinite;
}

/* Obavijesti (partials/messages.html) stilizira samo components/messages.css.
   Ovdje je bila stara kopija s !important koja je pregazila desni razmak
   rezerviran za ✕, pa je ✕ prekrivao tekst "Molimo odaberite: …". */

/* Extras Section */
.extras-section {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.extras-section .extras-title i {
    color: #c2410c;
    margin-right: 8px;
}

.extras-section .required-star {
    color: #c0392b;
}

/* Zelena kvačica umjesto zvjezdice čim je u grupi nešto odabrano. */
.extras-section .extras-title .group-done {
    display: none;
    color: #27ae60;
    margin: 0 0 0 6px;
}

.extras-section:has(input:checked) .extras-title .group-done {
    display: inline-block;
}

.extras-section:has(input:checked) .extras-title .required-star {
    display: none;
}

/* Variant Options Grid */
.variant-options {
    display: grid;
    gap: 8px;
}

/* Variant Radio Label */
.variant-radio {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-radio:has(input:checked) {
    border-color: #c2410c !important;
    background: #fff5f0 !important;
}

.variant-radio.disabled {
    opacity: 0.5;
    background: #f5f5f5;
    cursor: not-allowed;
}

.variant-radio input[type="radio"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #c2410c;
    flex-shrink: 0;
}

.variant-radio.disabled input[type="radio"] {
    cursor: not-allowed;
}

.variant-radio .variant-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.variant-radio .variant-price {
    font-weight: 700;
    color: #2c3e50;
    font-size: 18px;
}

.variant-radio .unavailable-label {
    color: #c0392b;
    font-size: 12px;
    font-weight: 600;
}

/* Extras Grid */
.extras-grid {
    display: grid;
    gap: 16px;
}

/* Extra Checkbox Item */
.extra-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
}

.extra-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #c2410c;
    flex-shrink: 0;
}

.extra-checkbox .extra-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.extra-checkbox .extra-image-placeholder {
    width: 40px;
    height: 40px;
    background: #fff4ec;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.extra-checkbox .extra-name {
    flex: 1;
}

/* Add to Cart Button Icon */
.add-to-cart-btn i {
    margin-right: 12px;
}

/* Donja traka: količina lijevo, "Dodaj u košaricu" desno. Na punoj stranici
   je to kartica; u sheetu puna ploča zalijepljena za dno (item-sheet.css).
   flex-wrap: na uskom ekranu gumb prelazi u novi red umjesto da se zgnječi. */
.extras-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.extras-footer .quantity-controls {
    flex-shrink: 0;
}

.extras-footer .add-to-cart-btn {
    flex: 1 1 200px;
    width: auto;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    .extras-section {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: 14px;
    }

    .extras-title {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .variant-radio {
        padding: 11px 12px;
        gap: 10px;
    }

    .variant-radio input[type="radio"] {
        width: 20px;
        height: 20px;
    }

    /* 16px: naziv opcije je ono što gost najviše čita, a bio je najsitniji
       tekst u sheetu (14px, manji od naslova grupe i cijene). */
    .variant-radio .variant-name {
        font-size: 16px;
    }

    .variant-radio .variant-price {
        font-size: 15px;
    }

    .extra-checkbox {
        padding: 10px;
    }

    .extra-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-left: 6px;
    }

    .extra-name {
        font-size: 14px;
    }

    .extra-price {
        font-size: 14px;
    }

    .extras-footer {
        padding: 16px;
        border-radius: 14px;
    }

    .qty-btn {
        width: 44px;
        height: 44px;
        font-size: 22px;
        border-width: 2px;
    }

    .qty-input {
        width: 64px;
        height: 44px;
        font-size: 22px;
        border-width: 2px;
    }

    .quantity-controls {
        gap: 14px;
    }

    .add-to-cart-btn {
        padding: 14px;
        font-size: 17px;
        border-radius: 12px;
    }

    .add-to-cart-btn i {
        margin-right: 8px;
    }
}
