/* =========================================================
   PRODUCT OVERLAY
========================================================= */

.product-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(55, 35, 22, 0.55);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.product-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* =========================================================
   PRODUCT MODAL
========================================================= */

.product-modal {
    position: relative;

    width: min(850px, 92vw);
    max-height: 90vh;

    overflow-y: auto;

    padding: 35px;

    border: 2px solid #D8C4AA;
    border-radius: 24px;

    background: #FFFDF5;
    color: var(--brown-dark);

    box-shadow:
        0 20px 60px rgba(93, 53, 22, 0.25);

    transform:
        translateY(15px)
        scale(0.98);

    transition:
        transform 0.2s ease;
}

.product-overlay.active .product-modal {
    transform:
        translateY(0)
        scale(1);
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.product-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: #F0E2D0;
    color: var(--brown-dark);

    font-size: 1.4rem;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.product-modal-close:hover {
    background: #E8C49D;

    transform:
        rotate(5deg)
        scale(1.05);
}


/* =========================================================
   MODAL CONTENT
========================================================= */

.product-modal-content {
    display: grid;

    grid-template-columns:
        320px
        1fr;

    gap: 35px;

    align-items: start;
}


/* =========================================================
   PRODUCT IMAGE
========================================================= */

.product-modal-image {
    width: 100%;
    max-width: 320px;

    aspect-ratio: 1 / 1;

    object-fit: contain;

    margin: 0 auto;

    border-radius: 18px;

    background: #F6EDE0;
}


/* =========================================================
   PRODUCT INFORMATION
========================================================= */

.product-modal-info {
    display: flex;
    flex-direction: column;
}

.product-modal-info h2 {
    margin: 0;

    color: var(--brown-dark);

    font-family: var(--heading-font);
    font-size: 1.6rem;
    font-weight: 600;

    line-height: 1.25;
}

.product-modal-description {
    margin: 12px 0 0;

    color: var(--brown);

    font-family: var(--body-font);
    font-size: 0.9rem;

    line-height: 1.7;
}


/* =========================================================
   VARIANTS
========================================================= */

.variant-options {
    display: grid;

    grid-template-columns: repeat(3, max-content);

    justify-content: start;

    gap: 8px 10px;

    width: 100%;

    margin-top: 22px;
}

.variant-label {
    grid-column: 1 / -1;

    margin: 0 0 2px;

    color: var(--brown-dark);

    font-family: var(--heading-font);
    font-size: 0.85rem;
    font-weight: 600;
}

.variant-option {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    width: max-content;
    min-width: 90px;

    padding: 8px 12px;

    border: 2px solid #D8C4AA;
    border-radius: 10px;

    background: rgba(255, 248, 230, 0.7);
    color: var(--brown-dark);

    font-family: var(--body-font);
    font-size: 0.78rem;

    cursor: pointer;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.variant-option:hover {
    background: #FFDFBA;
    border-color: #C98B55;

    transform: translateY(-1px);
}

.variant-option input {
    appearance: none;

    width: 14px;
    height: 14px;

    flex-shrink: 0;

    margin: 0;

    border: 2px solid #A05A32;
    border-radius: 50%;

    background: #FFF8E6;

    cursor: pointer;
}

.variant-option input:checked {
    background: #A05A32;

    box-shadow:
        inset 0 0 0 3px #FFF8E6;
}

.variant-option input[type="checkbox"] {
    border-radius: 4px;
}

.variant-option input[type="checkbox"]:checked {
    box-shadow:
        inset 0 0 0 2px #FFF8E6;
}

.variant-option:has(input:checked) {
    background: #FFDFBA;
    border-color: #A05A32;
}


/* =========================================================
   PRICE
========================================================= */

.product-modal-price {
    margin: 22px 0 0;

    color: var(--brown);

    font-family: var(--heading-font);
    font-size: 1.25rem;
    font-weight: 600;
}


/* =========================================================
   QUANTITY
========================================================= */

.product-quantity {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 20px;
}

.product-quantity-label {
    color: var(--brown-dark);

    font-family: var(--heading-font);
    font-size: 0.85rem;
    font-weight: 600;
}

.product-quantity-control {
    display: flex;
    align-items: center;

    border: 2px solid #D8C4AA;
    border-radius: 10px;

    overflow: hidden;

    background: #FFF8E6;
}

.quantity-button {
    width: 35px;
    height: 35px;

    border: none;

    background: transparent;
    color: var(--brown-dark);

    font-size: 1rem;

    cursor: pointer;
}

.quantity-button:hover {
    background: #FFDFBA;
}

.quantity-value {
    min-width: 35px;

    text-align: center;

    color: var(--brown-dark);

    font-family: var(--body-font);
    font-size: 0.9rem;
}


/* =========================================================
   ADD TO CART
========================================================= */

.add-to-cart {
    width: 100%;

    margin-top: 25px;
    padding: 13px 20px;

    border: none;
    border-radius: 10px;

    background: #A05A32;
    color: var(--cream);

    font-family: var(--body-font);
    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 4px 0 #5D3516,
        0 6px 10px rgba(93, 53, 22, 0.18);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.add-to-cart:hover {
    background: #EC9336;

    transform: translateY(-2px);
}

.add-to-cart:active {
    transform: translateY(2px);

    box-shadow:
        0 2px 0 #5D3516;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .product-overlay {
        padding: 15px;
    }

    .product-modal {
        width: 100%;
        max-height: 92vh;

        padding: 25px 20px;
    }

    .product-modal-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-modal-image {
        max-width: 240px;
    }
}