/* ==============================================
   ITEM PAGE STYLES
   Dedicated CSS for item.php product detail page
   ============================================== */

* {
    box-sizing: border-box;
}

body {
    background: var(--fluent-gray-10);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll from minor overflows */
}

/* ============================================
   ENHANCED NAVIGATION WITH BREADCRUMB
   ============================================ */

.item-nav {
    position: fixed;
    top: 20px;
    left: 5%;
    right: 5%;
    width: 90%;
    background: var(--fluent-white);
    border: 2px solid var(--fluent-black);
    border-radius: 12px;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.item-nav .nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.item-nav .nav-brand img {
    height: 44px;
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.breadcrumb a {
    color: var(--fluent-gray-70);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--fluent-black);
}

.breadcrumb .separator {
    color: var(--fluent-gray-50);
}

.breadcrumb .current {
    color: var(--fluent-black);
    font-weight: 600;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 5% 40px;
    width: 100%;
}

.item-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
    width: 100%;
}

/* Ensure grid items can shrink */
.item-image-section,
.item-details-section {
    min-width: 0;
}

/* Sourcing Header Banner — Fluent Compact */
.sourcing-header-banner {
    background: var(--fluent-white);
    border: 1px solid var(--fluent-gray-40);
    border-left: 3px solid var(--fluent-accent);
    border-radius: var(--fluent-radius-large);
    padding: 10px 14px;
    margin-bottom: 16px;
    box-shadow: var(--fluent-shadow-2);
    animation: slideInLeft 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes slideInLeft {
    from { transform: translateX(-12px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.sourcing-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sourcing-banner-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 30px;
    flex-shrink: 0;
}

.sourcing-banner-icon i {
    position: absolute;
    font-size: 18px;
    color: var(--fluent-accent);
    opacity: 0.08;
    transform: scale(1.5);
}

.banner-flag {
    width: 36px;
    height: 24px;
    object-fit: cover;
    border-radius: var(--fluent-radius-small);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--fluent-gray-30);
}

.banner-text strong {
    display: block;
    color: var(--fluent-gray-90);
    font-size: 13px;
    margin-bottom: 1px;
    letter-spacing: 0.2px;
}

.banner-text p {
    margin: 0;
    color: var(--fluent-gray-70);
    font-size: 12px;
    line-height: 1.4;
}

/* Batch Urgency UI (FOMO) — Fluent Compact */
.batch-urgency-ui {
    background: var(--fluent-white);
    border: 1px solid var(--fluent-gray-40);
    border-left: 3px solid var(--fluent-warning, #ffb900);
    border-radius: var(--fluent-radius-large);
    padding: 10px 14px;
    margin-bottom: 16px;
    box-shadow: var(--fluent-shadow-2);
}

.urgency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.urgency-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fluent-gray-90);
    display: flex;
    align-items: center;
    gap: 6px;
}

.urgency-title i {
    color: var(--fluent-warning, #ffb900);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.urgency-status {
    font-size: 11px;
    color: var(--fluent-gray-70);
    font-weight: 600;
}

.progress-track {
    height: 6px;
    background: var(--fluent-gray-30);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--fluent-warning, #ffb900);
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.urgency-footer {
    margin-top: 6px;
    font-size: 11px;
    color: var(--fluent-gray-70);
    line-height: 1.4;
}

/* ============================================
   IMAGE SECTION - FLOATING SHOWCASE CARD
   ============================================ */

.item-image-section {
    position: sticky;
    top: 100px;
    background: var(--fluent-white);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(2, 6, 23, 0.08);
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.05);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* Skeleton Loading */
.image-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 14px;
    z-index: 5;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.item-image-viewer {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    background: var(--fluent-gray-10);
    border-radius: 14px;
    overflow: hidden;
    cursor: crosshair;
    box-shadow: inset 0 2px 8px rgba(2, 6, 23, 0.04);
}

/* Performance-optimized blurred background layer */
.item-image-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    object-fit: cover;
    filter: blur(30px) brightness(0.9);
    opacity: 0.35;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.4s ease;
    will-change: filter, opacity;
}

.item-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
    transition: transform 0.1s ease-out;
    pointer-events: none; /* Let the viewer handle events for zoom */
}

/* Zoom Result Panel (Desktop Only) */
.zoom-result {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 14px;
}

.item-image-viewer:hover .zoom-result {
    opacity: 1;
}

/* Thumbnail Gallery */
.thumbnail-gallery-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 0 12px;
    scrollbar-width: none;
}

.gallery-thumbnail {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--fluent-gray-20);
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.gallery-thumbnail.active {
    border-color: var(--fluent-accent);
    box-shadow: 0 0 8px rgba(0, 120, 212, 0.25);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.gallery-thumbnail:hover img,
.gallery-thumbnail.active img {
    opacity: 1;
}

/* Image Counter Badge */
.image-counter-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    z-index: 15;
    pointer-events: none;
    user-select: none;
}

.image-counter-badge i {
    font-size: 11px;
    opacity: 0.85;
}

/* Thumbnail Gallery Wrapper with Arrows */
.thumbnail-gallery-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.thumb-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #333;
    font-size: 11px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.thumb-arrow:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}

.thumb-arrow:disabled {
    opacity: 0.25;
    cursor: default;
    background: #fff;
    color: #333;
}

.thumbnail-gallery-container {
    margin-top: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    scrollbar-width: none;
}

.thumbnail-gallery-container::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .image-counter-badge {
        bottom: 8px;
        left: 8px;
        padding: 5px 10px;
        font-size: 11px;
    }

    .thumb-arrow {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }

    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .item-image-viewer {
        cursor: pointer;
    }
    
    .zoom-result {
        display: none !important;
    }
    
    .item-image {
        pointer-events: auto; /* Allow touch on mobile for pinch-to-zoom in lightbox */
    }
}

@media (max-width: 768px) {
    .item-image-section {
        position: static;
        padding: 10px;
        margin-bottom: 20px;
        border-radius: 0;
    }
}

.item-image-section:hover .item-image {
    transform: scale(1.02);
}

/* Offer Badge — Diagonal ribbon in top-left */
.offer-ribbon {
    position: absolute;
    top: 12px;
    left: -28px;
    width: 110px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #d13438, #c50e2c);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    transform: rotate(-45deg);
    z-index: 9;
    box-shadow: 0 2px 10px rgba(209, 52, 56, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.offer-ribbon i {
    font-size: 9px;
}

/* Sourcing & Origin Flag (Stand-alone) */
.item-image-wrapper:hover .origin-flag-standalone {
    transform: scale(1.15);
}

.moq-badge-overlay {
    position: absolute;
    top: 0;
    right: 0;
    background: #d97706;
    color: #fff !important;
    padding: 5px 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 10;
    border-radius: 0 0 0 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: none;
    pointer-events: none;
    display: inline-block;
    white-space: nowrap;
}

/* ============================================
   MODERN VARIANT PICKER
   ============================================ */

.item-variant-section {
    margin: 25px 0 35px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--fluent-black);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.item-variant-section h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.variant-instruction {
    font-size: 13px;
    color: var(--fluent-gray-70);
    margin-bottom: 20px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.variant-instruction i {
    color: var(--fluent-primary);
}

.variant-picker-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.variant-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.variant-group-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--fluent-gray-70);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Color Swatches */
.swatch-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.swatch-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2px;
    background-clip: content-box;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.swatch.selected {
    border-color: var(--fluent-black);
    transform: scale(1.1);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--fluent-black);
}

.swatch-label {
    font-size: 11px;
    color: #666;
    font-weight: 600;
    max-width: 60px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Size Pills */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 60px;
    text-align: center;
}

.pill:hover:not(.disabled) {
    border-color: var(--fluent-black);
    background: #f8fafc;
    color: var(--fluent-black);
}

.pill.selected {
    background: var(--fluent-black);
    color: #fff;
    border-color: var(--fluent-black);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pill.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
    border-color: #e2e8f0;
    text-decoration: line-through;
}

/* Selection Summary */
.selection-summary {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
    font-size: 14px;
    color: #64748b;
}

.selection-summary strong {
    color: var(--fluent-black);
}

/* ============================================
   ITEM BADGES
   ============================================ */

.item-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.item-badge {
    padding: 9px 17px;
    border-radius: 0px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid currentColor;
    box-shadow: none;
}

.item-badge.type-product {
    color: #107c10;
}

.item-badge.type-manufactured_product {
    color: #0078d4;
}

.item-badge.type-service {
    color: #8764b8;
}

.item-badge.low-stock {
    color: #d13438;
    animation: pulse 2s infinite;
}

.item-badge.offer {
    color: #d13438;
}

.item-badge.sourcing {
    color: #0078d4;
}

.item-badge.local {
    color: #107c10;
}

.item-badge.moq-badge-detail {
    color: #605e5c;
}

.item-badge.pickup-only {
    background: transparent !important;
    color: #d13438 !important;
    border-color: #d13438 !important;
}

.item-badge.deliverable {
    background: transparent !important;
    color: #107c10 !important;
    border-color: #107c10 !important;
}



@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   DETAILS SECTION - PREMIUM CARD
   ============================================ */

.item-details-section {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--fluent-black);
}

.item-category {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-category::before {
    content: '';
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, #d13438, #ff6b6b);
    border-radius: 1px;
}

.item-name {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.item-description {
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   PRICE SECTION
   ============================================ */

.item-price-section {
    background: var(--fluent-gray-10);
    padding: 24px;
    border-radius: var(--fluent-radius-medium);
    margin-bottom: 24px;
}

.item-price-label {
    font-size: 13px;
    color: var(--fluent-gray-70);
    margin-bottom: 8px;
}

.item-price {
    font-size: 36px;
    font-weight: 700;
    color: var(--fluent-success);
}

.item-price.offer {
    color: #d13438;
}

.item-price-original {
    font-size: 20px;
    color: var(--fluent-gray-60);
    text-decoration: line-through;
    margin-right: 12px;
}

.item-discount-badge {
    display: inline-block;
    background: #d13438;
    color: white;
    padding: 6px 12px;
    border-radius: var(--fluent-radius-medium);
    font-size: 14px;
    font-weight: 700;
    margin-left: 12px;
}

.item-vat {
    font-size: 13px;
    color: var(--fluent-gray-70);
    margin-top: 5px;
}

/* Sourcing Shipping Notice — Fluent Compact */
.sourcing-shipping-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--fluent-white);
    border-radius: var(--fluent-radius-large);
    border: 1px solid var(--fluent-gray-40);
    border-left: 3px solid var(--fluent-accent);
    box-shadow: var(--fluent-shadow-2);
    font-size: 12px;
    color: var(--fluent-gray-80);
    line-height: 1.4;
}

.sourcing-shipping-notice i {
    color: var(--fluent-accent);
    font-size: 14px;
    margin-top: 1px;
    flex-shrink: 0;
}

.item-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14px;
}

.item-stock.in-stock {
    color: var(--fluent-success);
}

.item-stock.low-stock {
    color: #ff8c00;
}

.item-stock.out-of-stock {
    color: var(--fluent-error);
}

/* ============================================
   PHYSICAL SPECIFICATIONS
   ============================================ */

.item-specs {
    display: none;
    background: var(--fluent-gray-10);
    border: 1px solid var(--fluent-gray-30);
    border-radius: var(--fluent-radius-medium);
    padding: 20px;
    margin-bottom: 24px;
}

.item-specs h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--fluent-black);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-specs h4 i {
    color: var(--fluent-gray-60);
    font-size: 14px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.spec-label {
    font-size: 11px;
    color: var(--fluent-gray-60);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.spec-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--fluent-black);
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-buttons {
    display: flex;
    gap: 12px;
    margin: 30px 0 24px;
}

.add-to-cart-btn {
    flex: 1;
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    background: #fff;
    color: var(--fluent-black);
    border: 2px solid var(--fluent-black);
    border-radius: var(--fluent-radius-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.add-to-cart-btn:hover {
    background: var(--fluent-gray-10);
}

.add-to-cart-btn.added {
    background: #107c10;
    border-color: #107c10;
    color: white;
}

.buy-now-btn {
    flex: 2;
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    background: var(--fluent-black);
    color: white;
    border: none;
    border-radius: var(--fluent-radius-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.buy-now-btn:hover {
    background: var(--fluent-gray-90);
    transform: translateY(-2px);
}

.buy-now-btn:disabled,
.add-to-cart-btn:disabled {
    background: var(--fluent-gray-40);
    border-color: var(--fluent-gray-40);
    color: var(--fluent-gray-70);
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   SHARE SECTION
   ============================================ */

.share-section {
    border-top: 1px solid var(--fluent-gray-30);
    padding-top: 24px;
}

.share-section h4 {
    font-size: 14px;
    color: var(--fluent-gray-70);
    margin: 0 0 16px 0;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fluent-black);
    color: white;
    font-size: 18px;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    background: #333;
}

/* ============================================
   BACK LINK
   ============================================ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--fluent-gray-70);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--fluent-black);
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading-state {
    text-align: center;
    padding: 100px 20px;
}

.loading-state i {
    font-size: 48px;
    color: var(--fluent-gray-40);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ERROR STATE
   ============================================ */

.error-state {
    text-align: center;
    padding: 100px 20px;
}

.error-state i {
    font-size: 64px;
    color: var(--fluent-gray-40);
    margin-bottom: 20px;
}

.error-state h2 {
    color: var(--fluent-black);
    margin-bottom: 12px;
}

.error-state p {
    color: var(--fluent-gray-70);
}

.visit-shop-btn {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 28px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.visit-shop-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 900px) {
    main {
        padding: 16px 4% 20px;
        padding-top: 120px;
    }

    .item-container {
        grid-template-columns: 1fr;
        gap: 24px;
        width: 100%;
        max-width: 100%;
    }

    .item-details-section {
        padding: 25px;
        width: 100%;
        box-sizing: border-box;
    }

    .item-image-section {
        position: relative;
        top: auto;
        overflow: hidden;
        padding: 12px;
        border-radius: 0;
    }

    .item-image-section:hover {
        transform: none;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .item-image-section:hover .item-image {
        transform: none;
    }

    .item-image-wrapper {
        min-height: auto;
    }

    .offer-ribbon {
        top: 6px;
        left: -22px;
        width: 85px;
        font-size: 9px;
        padding: 5px 8px;
    }

    .item-badges {
        margin-bottom: 8px;
    }

    .item-badge {
        padding: 6px 12px;
        font-size: 10px;
        border-radius: 0px;
    }

    .moq-badge-overlay {
        font-size: 8px;
        padding: 3px 6px;
        top: 0;
        right: 0;
    }

    .item-details-section {
        padding: 20px;
    }

    .item-name {
        font-size: 24px;
    }

    .item-price {
        font-size: 26px;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    main {
        padding-top: 110px;
    }

    .item-nav {
        padding: 12px 15px;
        top: 10px;
        left: 3%;
        right: 3%;
        width: 94%;
    }

    .nav-left {
        flex: 1;
        min-width: 0;
        gap: 12px;
    }

    .breadcrumb {
        flex: 1;
        min-width: 0;
        gap: 6px;
        font-size: 11px;
    }

    .breadcrumb a,
    .breadcrumb .current {
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .breadcrumb .current {
        max-width: 90px;
    }

    .nav-right {
        flex-shrink: 0;
    }

    .action-buttons {
        gap: 8px;
    }

    .add-to-cart-btn,
    .buy-now-btn {
        padding: 12px 10px;
        font-size: 13px;
        gap: 6px;
    }

    .add-to-cart-btn i,
    .buy-now-btn i {
        font-size: 14px;
    }

    /* Variant Table Responsiveness */
    .variant-matrix-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
    }

    .variant-list-table {
        min-width: 500px; /* Force scroll on narrow screens */
    }

    .variant-list-table th, 
    .variant-list-table td {
        padding: 10px 12px !important;
        white-space: nowrap; /* Prevent awkward wrapping in cells */
    }
    
    .variant-list-table .variant-qty-input {
        width: 40px !important;
    }
}

@media (max-width: 480px) {
    main {
        padding-top: 100px;
    }

    .item-nav {
        left: 2%;
        right: 2%;
        width: 96%;
        border-radius: 12px;
        top: 10px;
        padding: 10px 12px;
    }

    .breadcrumb a:not(:first-child),
    .breadcrumb .separator:first-of-type {
        display: none;
    }

    .breadcrumb .current {
        max-width: 120px;
    }

    .item-details-section {
        padding: 15px;
        border-radius: 12px;
    }

    .item-variant-section {
        padding: 16px;
        margin: 20px 0 30px;
    }

    .variant-selector-header {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .add-to-cart-btn,
    .buy-now-btn {
        flex: none;
        padding: 14px;
        width: 100%;
    }

    /* Further Table Shrinking */
    .variant-list-table th, 
    .variant-list-table td {
        padding: 8px 8px !important;
        font-size: 12px !important;
    }
    
    .col-color {
        gap: 6px !important;
    }

    .col-qty {
        width: 90px;
    }

    .qty-control-wrapper {
        padding: 1px;
    }

    .qty-btn {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .variant-qty-input {
        width: 25px !important;
        font-size: 12px !important;
        height: 22px !important;
    }
}

/* ============================================
   IMMERSIVE THEATER LIGHTBOX
   ============================================ */

/* Full Screen Lightbox Container overrides */
#modal-lightbox {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

#modal-lightbox .fluent-modal-content {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

#modal-lightbox .fluent-modal-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 100;
    border-bottom: none !important;
    padding: 0 !important;
}

#modal-lightbox .fluent-modal-title {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    max-width: calc(100% - 60px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#modal-lightbox .fluent-modal-close {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    width: 40px;
    height: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#modal-lightbox .fluent-modal-close:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

#modal-lightbox .fluent-modal-body {
    padding: 0 !important;
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Lightbox Theater Container Styles */
.lightbox-theater-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

/* Atmospheric blurred dynamic backdrop */
.lightbox-bg-blur {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    object-fit: cover;
    filter: blur(50px) brightness(0.65) saturate(1.2);
    opacity: 0.35;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.4s ease, filter 0.4s ease;
    will-change: filter, opacity;
}

/* Image containment wrap */
.lightbox-image-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

/* Glassmorphism navigation buttons */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-nav-btn i {
    font-size: 18px;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-nav-btn.prev {
    left: 24px;
}

.lightbox-nav-btn.next {
    right: 24px;
}

/* Glassmorphism photo index counter */
.lightbox-meta-badge {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    user-select: none;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav-btn.prev {
        left: 12px;
    }

    .lightbox-nav-btn.next {
        right: 12px;
    }

    .lightbox-nav-btn i {
        font-size: 14px;
    }

    .lightbox-meta-badge {
        bottom: 16px;
        padding: 5px 12px;
        font-size: 11px;
    }
    
    #modal-lightbox .fluent-modal-header {
        top: 12px;
        left: 12px;
        right: 12px;
    }
    
    #modal-lightbox .fluent-modal-close {
        width: 32px;
        height: 32px;
    }
}