/* ==========================================================================
   BSEC Compact Product Preview & Variant Modal
   Sikkim Supreme Luxury Theme Integration
   ========================================================================== */

/* --- Backdrop --- */
.bsec-vm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s ease;
    box-sizing: border-box;
}

.bsec-vm-backdrop.bsec-vm-active {
    opacity: 1;
    visibility: visible;
}

/* --- Dialog Container --- */
.bsec-vm-dialog {
    position: relative;
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 
        0 24px 48px -12px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(15, 23, 42, 0.08);
    padding: 22px 22px 20px;
    box-sizing: border-box;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    color: #0f172a;
    max-height: 90vh;
    overflow-y: auto;
}

.bsec-vm-backdrop.bsec-vm-active .bsec-vm-dialog {
    transform: scale(1) translateY(0);
}

/* --- Close Button --- */
.bsec-vm-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.bsec-vm-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: scale(1.05);
}

/* --- Product Header Row --- */
.bsec-vm-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 28px; /* space for close button */
}

.bsec-vm-thumb-wrap {
    width: 68px;
    height: 68px;
    min-width: 68px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bsec-vm-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    padding: 0 !important;
    margin: 0 !important;
}

.bsec-vm-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bsec-vm-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bsec-vm-title a {
    color: inherit;
    text-decoration: none;
}

.bsec-vm-pricing-row {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
    line-height: 1.2;
}

.bsec-vm-price {
    font-size: 18px;
    font-weight: 800;
    color: #1B4D3E;
    letter-spacing: -0.3px;
}

.bsec-vm-compare-price {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: line-through;
}

.bsec-vm-discount-badge {
    display: inline-flex;
    align-items: center;
    background: #ecfdf5;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    line-height: 1;
}

.bsec-vm-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #16a34a;
    margin-top: 1px;
}

.bsec-vm-stock-status.is-out-of-stock {
    color: #dc2626;
}

.bsec-vm-stock-dot {
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background: currentColor;
}

/* --- Divider --- */
.bsec-vm-divider {
    border: 0;
    height: 1px;
    background: #f1f5f9;
    margin: 16px 0 14px;
}

/* --- Variant Selector Section --- */
.bsec-vm-variants-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bsec-vm-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    margin: 0;
}

.bsec-vm-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.bsec-vm-pill {
    padding: 7px 13px;
    border-radius: 9px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    line-height: 1.25;
}

.bsec-vm-pill:hover:not(.is-disabled):not(.is-active) {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.bsec-vm-pill.is-active {
    border-color: #1B4D3E;
    background: #f0fdf4;
    color: #1B4D3E;
    font-weight: 700;
    box-shadow: 0 0 0 1px #1B4D3E;
}

.bsec-vm-pill.is-disabled {
    border-color: #f1f5f9;
    background: #f8fafc;
    color: #94a3b8;
    text-decoration: line-through;
    cursor: not-allowed;
    opacity: 0.6;
}

.bsec-vm-pill-price {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}

.bsec-vm-pill.is-active .bsec-vm-pill-price {
    color: #166534;
    font-weight: 600;
}

/* --- Action Row: Quantity + Add CTA --- */
.bsec-vm-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.bsec-vm-qty-wrap {
    display: inline-flex;
    align-items: center;
    height: 42px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.bsec-vm-qty-btn {
    width: 34px;
    height: 100%;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.bsec-vm-qty-btn:hover {
    background: #edf2f7;
    color: #0f172a;
}

.bsec-vm-qty-input {
    width: 34px;
    height: 100%;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
}

.bsec-vm-qty-input::-webkit-outer-spin-button,
.bsec-vm-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bsec-vm-add-btn {
    flex: 1;
    height: 42px;
    background: #1B4D3E;
    color: #ffffff;
    border: 0;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    box-shadow: 0 3px 8px rgba(27, 77, 62, 0.22);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.bsec-vm-add-btn:hover:not(:disabled) {
    background: #143d31;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(27, 77, 62, 0.3);
}

.bsec-vm-add-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(27, 77, 62, 0.2);
}

.bsec-vm-add-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.75;
}

.bsec-vm-btn-sep {
    opacity: 0.5;
    font-size: 12px;
}

.bsec-vm-btn-price {
    font-weight: 800;
    letter-spacing: -0.2px;
}

/* Spinner */
.bsec-vm-btn-spinner svg {
    animation: bsecVmSpin 0.75s linear infinite;
    display: block;
}

@keyframes bsecVmSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- View Full Product Link Below Controls --- */
.bsec-vm-view-product-wrap {
    margin-top: 14px;
    text-align: center;
    padding-top: 2px;
}

.bsec-vm-view-product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.bsec-vm-view-product-link:hover {
    color: #1B4D3E;
    text-decoration: underline;
}

/* --- Skeleton Loading Animation --- */
.bsec-vm-skel-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bsec-vm-skel-thumb {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: bsecVmShimmer 1.4s infinite;
}

.bsec-vm-skel-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bsec-vm-skel-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: bsecVmShimmer 1.4s infinite;
}

.bsec-vm-skel-pills {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.bsec-vm-skel-pill {
    width: 80px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: bsecVmShimmer 1.4s infinite;
}

@keyframes bsecVmShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    .bsec-vm-dialog {
        padding: 18px 16px 16px;
        border-radius: 16px;
    }
    
    .bsec-vm-thumb-wrap {
        width: 58px;
        height: 58px;
        min-width: 58px;
    }
    
    .bsec-vm-title {
        font-size: 14px;
    }
    
    .bsec-vm-price {
        font-size: 16px;
    }
    
    .bsec-vm-pill {
        padding: 6px 11px;
        font-size: 12px;
    }
    
    .bsec-vm-qty-wrap {
        height: 40px;
    }
    
    .bsec-vm-qty-btn {
        width: 30px;
    }
    
    .bsec-vm-qty-input {
        width: 30px;
    }
    
    .bsec-vm-add-btn {
        height: 40px;
        font-size: 13px;
        padding: 0 12px;
    }
}
