/* Product Page Specific Styles */

/* Variant Selectors */
.variant-section {
    margin-bottom: 16px;
}

.variant-label {
    font-size: 14px;
    font-weight: 600;
    color: #0f1111;
    margin-bottom: 8px;
}

.variant-label span {
    font-weight: 400;
    color: #565959;
}

.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid #ddd;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    position: relative;
}

.color-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.color-option.active {
    border-color: var(--brand-green, #8FBC8F);
    box-shadow: 0 0 0 2px rgba(143, 188, 143, 0.3);
}

.color-option:hover:not(.active):not(.unavailable) {
    border-color: #999;
}

.size-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.size-option {
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--brand-text, #1a1a1a);
}

.size-option.active {
    border-color: var(--brand-green, #8FBC8F);
    background: rgba(143, 188, 143, 0.1);
}

.size-option:hover:not(.active):not(.unavailable) {
    border-color: #999;
}

/* Unavailable variant styles */
.color-option.unavailable,
.size-option.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
    border-color: #ddd;
    background: #f5f5f5;
    position: relative;
}

.color-option.unavailable .unavailable-line {
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 2px;
    background: rgba(0, 0, 0, 0.4);
    transform: rotate(-45deg);
    pointer-events: none;
}

.size-option.unavailable {
    text-decoration: line-through;
    color: #999;
}

.product-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-green-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.back-button:hover {
    color: var(--brand-green);
}

.header-logo {
    width: 40px;
    height: 40px;
}

/* Main Content */
.product-main {
    min-height: calc(100vh - 80px);
    background: white;
    padding: 20px 12px 40px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.product-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Loading & Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--brand-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-state h2 {
    color: var(--brand-text);
    margin-bottom: 1rem;
}

/* Product Content */
.product-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    max-width: 100%;
}

.product-info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    border-radius: 0;
    padding: 2rem;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Desktop: Smaller gallery, larger product details */
@media (min-width: 769px) {
    .product-info-section {
        grid-template-columns: 1.1fr 1.9fr;
        align-items: start; /* Prevent grid items from stretching */
    }
}

/* Image Gallery */
.image-gallery {
    position: relative;
    min-width: 0; /* Prevents grid blowout */
}

/* Sticky image gallery on desktop - must come after base styles */
@media (min-width: 769px) {
    .image-gallery {
        position: sticky;
        top: 120px; /* Below fixed category nav (60px) + search header (~60px) */
        align-self: start; /* Ensure it doesn't stretch in grid */
    }
}

.gallery-main {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: white;
}

.main-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 550px;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: var(--brand-green);
    width: 24px;
    border-radius: 4px;
}

/* Product Details */
.product-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    width: fit-content;
}

.product-badge.sold-out {
    background: #fee2e2;
    color: #991b1b;
}

.product-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-text);
    line-height: 1.2;
    margin: 0;
    /* Override truncation from global styles.css */
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-green-dark);
}

.product-supplier {
    font-size: 1rem;
    color: #6b7280;
}

.product-description-wrapper {
    position: relative;
}

.product-description {
    font-size: 1.1rem;
    color: #374151;
    line-height: 1.6;
    transition: max-height 0.3s ease;
}

.product-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description.expanded {
    display: block;
}

/* Style HTML content within descriptions */
.product-description p {
    margin: 0 0 1rem 0;
}

.product-description p:last-child {
    margin-bottom: 0;
}

.product-description ul,
.product-description ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.product-description li {
    margin-bottom: 0.5rem;
}

.product-description h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-green-dark);
    margin: 1rem 0 0.5rem 0;
}

.product-description hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1rem 0;
}

.product-description strong {
    font-weight: 600;
    color: #1f2937;
}

.product-description em {
    font-style: italic;
    color: #6b7280;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--brand-green-dark);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: var(--brand-orange);
}

.read-more-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.read-more-btn.expanded svg {
    transform: rotate(180deg);
}

.product-specs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 12px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spec-label {
    font-weight: 600;
    color: #6b7280;
}

.spec-value {
    color: var(--brand-text);
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: #c27455;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background: #b06545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 116, 85, 0.3);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.product-link-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}

.product-link-disclaimer {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.5;
    max-width: 34rem;
}

.product-link-disclaimer a {
    color: var(--brand-orange);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-link-disclaimer a:hover {
    color: var(--brand-green-dark);
}

/* Reviews Section */
.reviews-section {
    background: white;
    border-radius: 0;
    padding: 2rem;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-text);
    margin-bottom: 1.5rem;
}

.review-stats {
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.average-rating {
    text-align: center;
}

.rating-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--brand-green-dark);
    line-height: 1;
}

.stars {
    font-size: 1.5rem;
    color: #fbbf24;
    margin: 0.5rem 0;
}

.review-count {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Write Review */
.write-review {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 12px;
}

.write-review h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-text);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--brand-text);
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-green);
}

.star-rating-input {
    display: flex;
    gap: 0.25rem;
    font-size: 2rem;
}

.star-rating-input .star {
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star-rating-input .star.active,
.star-rating-input .star:hover {
    color: #fbbf24;
}

/* Reviews List */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.no-reviews {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.review-card {
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.reviewer-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reviewer-name {
    font-weight: 700;
    color: var(--brand-text);
}

.review-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.review-rating {
    color: #fbbf24;
    font-size: 1.25rem;
}

.review-comment {
    color: #374151;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-info-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem 0;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-price {
        font-size: 1.5rem;
    }

    .main-image {
        max-height: 300px;
    }

    /* Touch swipe for mobile */
    .gallery-main {
        touch-action: pan-x;
    }
}

@media (max-width: 480px) {
    .product-container {
        padding: 0;
    }

    .reviews-section,
    .product-info-section {
        padding: 1rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Mobile Sticky CTA Button */
.mobile-sticky-cta {
    display: none;
    position: fixed;
    top: 108px; /* Flush below category nav (60px) + search header (~48px) */
    left: 0;
    right: 0;
    z-index: 85;
    background: white;
    padding: calc(0.75rem + 5px) 1rem 0.75rem 1rem; /* Extra 5px top padding */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e5e7eb;
}

.mobile-sticky-cta .sticky-cta-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    margin: 0;
}

.mobile-sticky-cta .btn-primary {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    white-space: nowrap;
}

.mobile-sticky-cta .sticky-login-link {
    font-size: 0.8rem;
    color: var(--brand-orange);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-sticky-cta .sticky-login-link:hover {
    color: var(--brand-green-dark);
}

@media (max-width: 768px) {
    .mobile-sticky-cta {
        display: block;
    }

    /* Hide original button on mobile since it's in the sticky bar */
    .product-link-block {
        display: none;
    }
}

/* ========================================
   Product Image Gallery Enhancements
   ======================================== */

/* Gallery Main - Swipeable container */
.gallery-main {
    position: relative;
    touch-action: pan-x;
    user-select: none;
}

.main-image {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

/* Gallery Dots - Enhanced styling */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 0;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: var(--brand-green);
    width: 24px;
    border-radius: 4px;
}

.gallery-dot:hover:not(.active) {
    background: #9ca3af;
}

/* Gallery Thumbnails - Desktop product page */
.gallery-thumbnails {
    display: none; /* Hidden on mobile by default */
    gap: 8px;
    margin-top: 16px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-green) transparent;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: var(--brand-green);
    border-radius: 3px;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.gallery-thumb.active {
    border-color: var(--brand-green);
    opacity: 1;
}

.gallery-thumb:hover:not(.active) {
    opacity: 0.85;
    border-color: #d1d5db;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Desktop: Show thumbnails, hide dots */
@media (min-width: 769px) {
    .gallery-thumbnails {
        display: flex;
    }

    .gallery-dots {
        display: none;
    }
}

/* "More" thumbnail styling for desktop */
.gallery-thumb-more {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
    background: #e5e7eb;
}

.gallery-thumb-more:hover {
    border-color: #d1d5db;
    background: #d1d5db;
}

.gallery-thumb-more img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: grayscale(50%);
}

.gallery-thumb-more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-weight: 700;
    font-size: 16px;
}

/* ========================================
   Product Gallery Fullscreen Lightbox
   ======================================== */

.product-gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.product-gallery-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* Close button */
.gallery-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gallery-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main image container */
.gallery-lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    overflow: hidden;
    position: relative;
}

/* Navigation buttons */
.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}

.gallery-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-lightbox-prev {
    left: 16px;
}

.gallery-lightbox-next {
    right: 16px;
}

.pinch-zoom-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    overflow: visible;
}

.gallery-lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 180px);
    object-fit: contain;
    border-radius: 4px;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Thumbnail strip */
.gallery-lightbox-thumbnails {
    display: flex;
    gap: 8px;
    padding: 16px;
    overflow-x: auto;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.gallery-lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-lightbox-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gallery-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.gallery-thumbnail.active {
    border-color: white;
    opacity: 1;
}

.gallery-thumbnail:hover:not(.active) {
    opacity: 0.8;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   Similar Items Section
   ======================================== */

.similar-items-section {
    background: white;
    border-radius: 0;
    padding: 2rem;
    box-shadow: none;
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.similar-items-section .section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-text);
    margin-bottom: 1.5rem;
}

.similar-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.similar-item-card {
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e5e7eb;
}

.similar-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.similar-item-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: white;
}

.similar-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.similar-item-card:hover .similar-item-image img {
    transform: scale(1.05);
}

.similar-item-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.similar-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.similar-item-supplier {
    font-size: 0.8rem;
    color: #6b7280;
}

.similar-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-top: 0.25rem;
}

.similar-items-empty,
.similar-items-loading {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    font-size: 1rem;
}

/* Similar Items - Tablet */
@media (max-width: 1024px) {
    .similar-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Similar Items - Mobile */
@media (max-width: 768px) {
    .similar-items-section {
        padding: 1.5rem 0;
        margin-top: 1.5rem;
    }

    .similar-items-section .section-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .similar-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .similar-item-info {
        padding: 0.75rem;
    }

    .similar-item-title {
        font-size: 0.85rem;
    }

    .similar-item-price {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .similar-items-section {
        padding: 1rem 0;
    }

    .similar-items-grid {
        gap: 0.75rem;
    }

    .similar-item-info {
        padding: 0.5rem;
    }

    .similar-item-title {
        font-size: 0.8rem;
    }

    .similar-item-supplier {
        font-size: 0.75rem;
    }

    .similar-item-price {
        font-size: 0.85rem;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    /* White background for mobile lightbox */
    .product-gallery-lightbox {
        background: white;
    }

    .gallery-lightbox-main {
        padding: 50px 10px 10px;
    }

    .gallery-lightbox-image {
        max-height: calc(100vh - 160px);
    }

    .gallery-lightbox-thumbnails {
        padding: 12px;
        justify-content: flex-start;
        background: #f5f5f5;
    }

    .gallery-thumbnail {
        width: 50px;
        height: 50px;
    }

    /* Dark controls on white background */
    .gallery-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
        color: #333;
        background: rgba(0, 0, 0, 0.1);
    }

    .gallery-lightbox-close:hover {
        background: rgba(0, 0, 0, 0.2);
    }

    .gallery-lightbox-nav {
        width: 40px;
        height: 40px;
        color: #333;
        background: rgba(0, 0, 0, 0.1);
    }

    .gallery-lightbox-nav:hover {
        background: rgba(0, 0, 0, 0.2);
    }

    .gallery-lightbox-prev {
        left: 8px;
    }

    .gallery-lightbox-next {
        right: 8px;
    }

    .gallery-thumbnail.active {
        border-color: var(--brand-green);
    }
}

/* =============================================================================
   Variant Selector Styles - Updated 2026-01-12
   ============================================================================= */

.variant-selector {
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 12px;
    box-sizing: border-box;
}

.variant-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-text, #333);
    margin: 0 0 0.75rem 0;
}

/* Thumbnail container - wraps on desktop, scrolls on mobile */
.variant-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    box-sizing: border-box;
}

.variant-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    min-width: 80px;
    max-width: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.variant-thumb.active {
    border-color: var(--brand-green, #8FBC8F);
    box-shadow: 0 0 0 2px rgba(143, 188, 143, 0.3);
}

/* Only apply hover effects on devices that support hover */
@media (hover: hover) {
    .variant-thumb:hover:not(.active) {
        border-color: #9ca3af;
    }
}

.variant-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    pointer-events: none;
}

.variant-label-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    padding: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    box-sizing: border-box;
}

.variant-sold-out-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    pointer-events: none;
}

/* Split mode (size buttons + color thumbnails) */
.variant-selector-split {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.variant-size-section,
.variant-color-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variant-size-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-size-btn {
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}

@media (hover: hover) {
    .variant-size-btn:hover:not(.active) {
        border-color: #9ca3af;
        background: #f5f5f5;
    }
}

.variant-size-btn.active {
    border-color: var(--brand-green, #8FBC8F);
    background: rgba(143, 188, 143, 0.1);
    color: var(--brand-green-dark, #5a7d5a);
    font-weight: 600;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .variant-selector,
    .variant-selector-split {
        margin: 0.75rem 0 1rem;
        padding: 0.75rem;
    }

    /* Horizontal scroll on mobile */
    .variant-thumbnails {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 4px 0;
    }

    .variant-thumbnails::-webkit-scrollbar {
        display: none;
    }

    .variant-thumb {
        width: 72px;
        height: 72px;
        min-width: 72px;
        max-width: 72px;
        flex-shrink: 0;
    }

    .variant-thumb img {
        width: 100%;
        height: 100%;
    }

    .variant-label-text {
        font-size: 0.65rem;
        padding: 3px;
    }

    .variant-sold-out-badge {
        font-size: 0.55rem;
        padding: 1px 3px;
    }

    /* Size buttons */
    .variant-size-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 4px 0;
    }

    .variant-size-buttons::-webkit-scrollbar {
        display: none;
    }

    .variant-size-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .variant-thumb {
        width: 64px;
        height: 64px;
        min-width: 64px;
        max-width: 64px;
    }

    .variant-size-btn {
        padding: 10px 14px;
        font-size: 0.875rem;
    }
}

/* =============================================================================
   Hierarchical Variant Selector (Level + Format)
   ============================================================================= */

.variant-selector-hierarchical {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.variant-series-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: -0.5rem;
}

.variant-level-section,
.variant-format-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Level Pills */
.variant-level-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variant-level-pill {
    min-width: 48px;
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    background: white;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
    text-align: center;
}

@media (hover: hover) {
    .variant-level-pill:hover:not(.active) {
        border-color: var(--brand-green, #8FBC8F);
        background: rgba(143, 188, 143, 0.05);
    }
}

.variant-level-pill.active {
    border-color: var(--brand-green, #8FBC8F);
    background: var(--brand-green, #8FBC8F);
    color: white;
}

/* Format Cards */
.variant-format-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-format-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    text-decoration: none;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .variant-format-card:hover:not(.active) {
        border-color: #9ca3af;
        background: #fafafa;
    }
}

.variant-format-card.active {
    border-color: var(--brand-green, #8FBC8F);
    background: rgba(143, 188, 143, 0.08);
}

.variant-format-card.sold-out {
    opacity: 0.6;
}

.format-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--brand-text, #333);
}

.format-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-green-dark, #5a7d5a);
}

.format-sold-out {
    font-size: 0.75rem;
    font-weight: 600;
    color: #991b1b;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* =============================================================================
   Cross-Supplier Variant Selector
   ============================================================================= */

.variant-selector-cross-supplier {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cross-supplier-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.supplier-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    text-decoration: none;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .supplier-option:hover:not(.active) {
        border-color: #9ca3af;
        background: #fafafa;
    }
}

.supplier-option.active {
    border-color: var(--brand-green, #8FBC8F);
    background: rgba(143, 188, 143, 0.08);
}

.supplier-option.sold-out {
    opacity: 0.7;
}

.supplier-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.supplier-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--brand-text, #333);
}

.lowest-price-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    background: var(--brand-green, #8FBC8F);
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.supplier-price-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.supplier-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-green-dark, #5a7d5a);
}

.supplier-availability {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.supplier-availability.in-stock {
    background: #dcfce7;
    color: #166534;
}

.supplier-availability.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

/* Mobile responsive for hierarchical and cross-supplier */
@media (max-width: 768px) {
    .variant-selector-hierarchical,
    .variant-selector-cross-supplier {
        margin: 0.75rem 0 1rem;
        padding: 0.75rem;
    }

    .variant-level-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 4px 0;
    }

    .variant-level-pills::-webkit-scrollbar {
        display: none;
    }

    .variant-level-pill {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .variant-format-card,
    .supplier-option {
        padding: 12px 14px;
    }

    .format-name,
    .supplier-name {
        font-size: 0.9rem;
    }

    .format-price,
    .supplier-price {
        font-size: 0.95rem;
    }

    .lowest-price-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .supplier-availability {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .variant-level-pill {
        min-width: 42px;
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .supplier-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .supplier-price-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
}

/* =============================================================================
   Educational Section Styles
   ============================================================================= */

.educational-section {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f0f7f0 0%, #f5f5f5 100%);
    border-radius: 12px;
    border: 1px solid #e0e8e0;
}

.educational-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-green-dark, #5a7d5a);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.educational-title::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235a7d5a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.educational-benefit {
    margin-bottom: 20px;
}

.educational-benefit-text {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

.life-skills-section {
    margin-top: 16px;
}

.grade-skill-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.grade-skill-group:last-child {
    margin-bottom: 0;
}

.grade-label {
    flex-shrink: 0;
    min-width: 50px;
    padding: 6px 12px;
    background: var(--brand-green, #8FBC8F);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    text-align: center;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: inline-block;
    padding: 6px 14px;
    background: white;
    color: var(--brand-text, #333);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    text-decoration: none;
    transition: all 0.2s ease;
}

.skill-tag:hover {
    background: var(--brand-green, #8FBC8F);
    color: white;
    border-color: var(--brand-green, #8FBC8F);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .educational-section {
        margin: 16px 0;
        padding: 16px;
    }

    .grade-skill-group {
        flex-direction: column;
        gap: 8px;
    }

    .grade-label {
        min-width: auto;
    }

    .skill-tag {
        font-size: 12px;
        padding: 5px 12px;
    }
}
