/* ============================================================
   Bole Product Modal — Dark Luxury Overlay
   Click product card → fullscreen modal with AJAX-loaded detail
   ============================================================ */

/* ── Overlay / Backdrop ── */
.bw-product-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.bw-product-modal-overlay.active {
    display: flex;
    opacity: 1;
}
.bw-product-modal-overlay.closing {
    opacity: 0;
}

/* ── Modal Container ── */
.bw-product-modal {
    position: relative;
    width: 100%;
    max-width: 1100px;
    max-height: calc(100vh - 40px);
    background: #0d0d1a;
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 169, 110, 0.15);
    animation: bwModalFadeIn 0.35s ease;
}
@keyframes bwModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Close Button ── */
.bw-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(201, 169, 110, 0.4);
    background: rgba(13, 13, 26, 0.9);
    color: #c9a96e;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    padding: 0;
}
.bw-modal-close:hover {
    background: #c9a96e;
    color: #0d0d1a;
    transform: rotate(90deg);
}

/* ── Scrollable Content Area ── */
.bw-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 36px;
    color: #e0e0e0;
    scroll-behavior: smooth;
}
.bw-modal-body::-webkit-scrollbar {
    width: 6px;
}
.bw-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}
.bw-modal-body::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 110, 0.35);
    border-radius: 3px;
}

/* ── Loading Spinner ── */
.bw-modal-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}
.bw-modal-spinner .bw-spinner-ring {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(201, 169, 110, 0.2);
    border-top-color: #c9a96e;
    border-radius: 50%;
    animation: bwSpin 0.7s linear infinite;
}
@keyframes bwSpin {
    to { transform: rotate(360deg); }
}

/* ── Two-column product layout inside modal ── */
.bw-modal-product-layout {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

/* ── Gallery Column ── */
.bw-modal-gallery {
    flex: 1 1 440px;
    min-width: 0;
    max-width: 50%;
}
.bw-modal-main-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 169, 110, 0.15);
    margin-bottom: 12px;
}
.bw-modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.bw-modal-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.bw-modal-thumbnails::-webkit-scrollbar {
    height: 4px;
}
.bw-modal-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 110, 0.3);
    border-radius: 2px;
}
.bw-modal-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s;
    background: rgba(255, 255, 255, 0.03);
}
.bw-modal-thumb:hover,
.bw-modal-thumb.active {
    border-color: #c9a96e;
}
.bw-modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Summary Column ── */
.bw-modal-summary {
    flex: 1 1 340px;
    min-width: 0;
}

/* Brand badge */
.bw-modal-brand {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #c9a96e;
    border: 1px solid rgba(201, 169, 110, 0.4);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

/* Title */
.bw-modal-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin: 0 0 10px 0;
}

/* Price */
.bw-modal-price {
    font-size: 24px;
    font-weight: 700;
    color: #c9a96e;
    margin-bottom: 16px;
}
.bw-modal-price del {
    font-size: 16px;
    color: #777;
    margin-right: 8px;
}
.bw-modal-price ins {
    text-decoration: none;
}

/* SKU / Meta */
.bw-modal-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    line-height: 1.6;
}
.bw-modal-meta strong {
    color: #aaa;
    font-weight: 600;
}

/* Description */
.bw-modal-description {
    font-size: 15px;
    color: #bbb;
    line-height: 1.7;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
}
.bw-modal-description p {
    margin: 0 0 8px;
}
.bw-modal-description p:last-child {
    margin-bottom: 0;
}

/* Add to Cart Button */
.bw-modal-add-cart {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #c9a96e;
    color: #0d0d1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    text-decoration: none;
}
.bw-modal-add-cart:hover {
    background: #d4b87a;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.3);
}
.bw-modal-add-cart:active {
    transform: translateY(0);
}
.bw-modal-add-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Quantity Input */
.bw-modal-qty-group {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 16px;
}
.bw-modal-qty-group label {
    font-size: 13px;
    color: #aaa;
    margin-right: 10px;
    display: none;
}
.bw-modal-qty-group input.qty {
    width: 64px;
    height: 44px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 6px;
    outline: none;
    -moz-appearance: textfield;
}
.bw-modal-qty-group input.qty::-webkit-inner-spin-button,
.bw-modal-qty-group input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Out of stock */
.bw-modal-out-of-stock {
    display: inline-block;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 6px;
    background: rgba(255, 107, 107, 0.05);
}

/* ── Mobile / Responsive ── */
@media (max-width: 768px) {
    .bw-product-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .bw-product-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        animation: bwModalSlideUp 0.35s ease;
    }
    @keyframes bwModalSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .bw-modal-body {
        padding: 24px 20px;
    }
    .bw-modal-product-layout {
        flex-direction: column;
        gap: 20px;
    }
    .bw-modal-gallery {
        max-width: 100%;
        flex: auto;
    }
    .bw-modal-summary {
        flex: auto;
    }
    .bw-modal-title {
        font-size: 22px;
    }
    .bw-modal-price {
        font-size: 20px;
    }
    .bw-modal-thumb {
        width: 56px;
        height: 56px;
    }
}
