﻿:root {
    --color-primary: #3f1c46;
    --color-lightYellow: #f1f1e5;
    --color-grey: #e9e9e9;
    --font-outfit: 'Outfit', sans-serif;
    --font-calisto: 'Calisto MT';
}

/* =========================================================
   ADD TO CART MODAL - COMPACT LAYOUT
   ========================================================= */

.add-to-cart-modal-body {
    padding: 14px 16px;
}

/* Product Image */
.cart-modal-image {
    position: relative;
    width: auto;
    /*background: var(--color-lightYellow);*/
    border-radius: 8px;
    overflow: hidden;
}

    .cart-modal-image .carousel {
        width: 100%;
    }

.cart-modal-product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
}

.cart-modal-image .carousel-control-prev,
.cart-modal-image .carousel-control-next {
    width: 36px;
    opacity: 1;
}

/* Product Information */
.cart-modal-product-name {
    margin-bottom: 6px;
    color: var(--color-primary);
    font-family: var(--font-calisto);
    font-size: 18px;
    line-height: 1.25;
}

.cart-modal-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.cart-modal-sku {
    color: #777;
    font-family: var(--font-calisto);
    font-size: 12px;
}

    .cart-modal-sku span {
        margin-right: 4px;
    }

    .cart-modal-sku strong {
        color: #333;
        font-weight: 500;
    }

.cart-modal-stock {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

    .cart-modal-stock.in-stock {
        color: #198754;
        background: #e8f5ec;
    }

    .cart-modal-stock.out-of-stock {
        color: #dc3545;
        background: #fbe9eb;
    }

.cart-modal-price {
    display: flex;
    align-items: center;
    gap: 6px;
    /*border-bottom: 1px solid #eee;*/
}

    .cart-modal-price span {
        color: #777;
        font-size: 12px;
    }

    .cart-modal-price strong {
        color: #222;
        font-size: 18px;
    }

.cart-modal-price-note {
    display: block;
    margin: 6px 0 10px;
    color: #999;
    font-size: 10.5px;
    line-height: 1.3;
}

/* Quantity + stock row (compact, side-by-side) */
.cart-modal-qty-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0 4px;
}

.quantity-section .detail-tag {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.modal-count-div {
    display: inline-flex;
    align-items: center;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

    .modal-count-div button {
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        background: #f7f7f7;
        font-size: 16px;
        cursor: pointer;
    }

        .modal-count-div button:hover {
            background: #eee;
        }

    .modal-count-div input {
        width: 38px;
        height: 32px;
        padding: 0;
        border: 0;
        border-left: 1px solid #ddd;
        border-right: 1px solid #ddd;
        text-align: center;
        font-size: 13px;
        font-weight: 600;
        outline: none;
    }

.available-stock {
    color: #777;
    font-size: 11px;
    white-space: nowrap;
}

.cart-modal-details {
    display: inline-block;
    margin-top: 8px;
    color: #222;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

    .cart-modal-details:hover {
        text-decoration: underline;
    }

/* Order note */
.modal-order-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

#modalOrderNoteToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid #d9c9dd;
    border-radius: 18px;
    background: var(--sand-light, #f7f2f8);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    #modalOrderNoteToggle .toggle-icon {
        font-size: 15px;
        font-weight: 500;
    }

#modalOrderNoteBody {
    margin-top: 8px;
}

#cartModalOrderRemarks {
    resize: vertical;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
}

    #cartModalOrderRemarks:focus {
        border-color: #ced4da;
        box-shadow: none;
        outline: none;
    }

#cartModalImageCarousel .carousel-control-prev-icon,
#cartModalImageCarousel .carousel-control-next-icon {
    width: 15px;
    height: 15px;
    background-color: transparent !important;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

#cartModalImageCarousel .carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11 1L3 8l8 7' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

#cartModalImageCarousel .carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 1l8 7-8 7' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}

/* =========================================================
   PRODUCT VARIANTS (STYLE)
   ========================================================= */

.product-variants {
    width: 100%;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e6e6e6;
}

    .product-variants + .product-variants {
        margin-top: 10px;
        padding-top: 10px;
        border-top: none; /* avoid double divider between stacked style + size sections */
    }

.variant-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 16px;
}

.variant-label {
    font-weight: 600;
    color: #222;
}

.selected-variant {
    color: var(--color-primary);
    font-weight: 500;
}

.variant-list {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c8c8c8 transparent;
}

    .variant-list::-webkit-scrollbar {
        height: 5px;
    }

    .variant-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .variant-list::-webkit-scrollbar-thumb {
        background: #c8c8c8;
        border-radius: 10px;
    }

        .variant-list::-webkit-scrollbar-thumb:hover {
            background: #999;
        }

.variant-card {
    position: relative;
    flex: 0 0 92px;
    width: 92px;
    min-width: 92px;
    height: 104px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 3px;
    margin: 0;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 5px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    white-space: normal;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .variant-card:hover {
        border-color: var(--color-primary);
    }

    .variant-card:focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }

    .variant-card.active {
        border: 2px solid var(--color-primary);
        padding: 2px;
        box-shadow: 0 1px 5px rgba(63, 28, 70, 0.12);
    }

.variant-image {
    position: relative;
    width: 100%;
    height: 62px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f7f7f7;
    border-radius: 3px;
}

    .variant-image img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.variant-info {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 2px 1px 0;
}

.variant-name {
    display: block;
    width: 100%;
    margin: 0;
    color: #333;
    font-size: 11px !important;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.variant-price {
    display: block;
    width: 100%;
    margin: 2px 0 0 !important;
    color: var(--color-primary);
    font-size: 10px !important;
    font-weight: 500;
    line-height: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.variant-card.out-of-stock,
.size-chip.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

    .variant-card.out-of-stock:hover {
        border-color: #d4d4d4;
        box-shadow: none;
    }

/* =========================================================
   SIZE SELECTOR
   ========================================================= */

.size-list {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c8c8c8 transparent;
}

    .size-list::-webkit-scrollbar {
        height: 5px;
    }

    .size-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .size-list::-webkit-scrollbar-thumb {
        background: #c8c8c8;
        border-radius: 10px;
    }

.size-chip {
    position: relative;
    flex: 0 0 auto;
    min-width: 56px;
    height: 32px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    color: #333;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    scroll-snap-align: start;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

    .size-chip:hover {
        border-color: var(--color-primary);
    }

    .size-chip:focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }

    .size-chip.active {
        border: 2px solid var(--color-primary);
        color: var(--color-primary);
        font-weight: 600;
        padding: 0 13px; /* compensate for extra 1px border so size doesn't jump */
    }

    .size-chip.out-of-stock {
        color: #999;
    }

        .size-chip.out-of-stock:hover {
            border-color: #d4d4d4;
        }

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {
    .add-to-cart-modal-body {
        padding: 12px;
    }

    .cart-modal-product-image {
        height: 170px;
    }

    .cart-modal-product-name {
        font-size: 16px;
    }

    .cart-modal-price strong {
        font-size: 17px;
    }

    .cart-modal-qty-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .product-variants {
        margin-top: 10px;
        padding-top: 10px;
    }

    .variant-header {
        margin-bottom: 7px;
        font-size: 12px;
    }

    .variant-card {
        flex: 0 0 82px;
        width: 82px;
        min-width: 82px;
        height: 94px;
    }

    .variant-image {
        height: 54px;
    }

    .variant-name {
        font-size: 10px;
        line-height: 12px;
    }

    .variant-price {
        font-size: 9px;
        line-height: 9px;
    }

    .size-chip {
        min-width: 48px;
        height: 30px;
        padding: 0 11px;
        font-size: 11px;
    }

        .size-chip.active {
            padding: 0 10px;
        }
}

@media (hover: none) and (pointer: coarse) {
    .variant-list,
    .size-list {
        scrollbar-width: none;
    }

        .variant-list::-webkit-scrollbar,
        .size-list::-webkit-scrollbar {
            display: none;
        }
}
