:root {
    --radius: 0.75rem;
    --color-background: oklch(1 0 0);
    --color-foreground: oklch(0.16 0.01 270);
    --color-card: oklch(1 0 0);
    --color-card-foreground: oklch(0.16 0.01 270);
    --color-popover: oklch(1 0 0);
    --color-popover-foreground: oklch(0.16 0.01 270);
    --color-primary: oklch(0.585 0.232 26.5);
    --color-primary-foreground: oklch(0.99 0 0);
    --color-primary-dark: oklch(0.5 0.21 27);
    --color-ink: oklch(0.16 0.008 270);
    --color-secondary: oklch(0.97 0.004 270);
    --color-secondary-foreground: oklch(0.16 0.01 270);
    --color-muted: oklch(0.968 0.004 270);
    --color-muted-foreground: oklch(0.5 0.012 270);
    --color-accent: oklch(0.96 0.02 27);
    --color-accent-foreground: oklch(0.5 0.21 27);
    --color-destructive: oklch(0.585 0.232 26.5);
    --color-destructive-foreground: oklch(0.99 0 0);
    --color-success: oklch(0.62 0.16 150);
    --color-success-foreground: oklch(0.99 0 0);
    --color-border: oklch(0.92 0.004 270);
    --color-input: oklch(0.92 0.004 270);
    --color-ring: oklch(0.585 0.232 26.5);
    --shadow-soft: 0 1px 2px oklch(0 0 0 / 0.04), 0 8px 24px -12px oklch(0 0 0 / 0.12);
    --shadow-card: 0 2px 8px -2px oklch(0 0 0 / 0.06), 0 12px 40px -16px oklch(0 0 0 / 0.18);
    --shadow-lift: 0 12px 28px -8px oklch(0.58 0.22 27 / 0.28), 0 24px 60px -24px oklch(0 0 0 / 0.28);
}

* { border-color: var(--color-border); }

[x-cloak] { display: none !important; }

body {
    background-color: var(--color-background);
    color: var(--color-foreground);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    font-family: 'Archivo', system-ui, sans-serif;
    letter-spacing: -0.02em;
}

/* Container */
.container-tc {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 1.25rem;
}
@media (min-width: 768px) {
    .container-tc { padding-inline: 2rem; }
}

/* Utilities */
.text-balance { text-wrap: balance; }

.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes tc-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.animate-tc-pop { animation: tc-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes confetti-fall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Scrollbar hide */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================
   CAROUSEL / SLIDER
   ============================================ */
.carousel-wrapper { position: relative; }
.carousel-track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
    scroll-snap-align: start;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Responsive slide widths */
@media (max-width: 639px) {
    .carousel-slide { width: 100% !important; }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .carousel-slide.cols-2 { width: 50% !important; }
    .carousel-slide.cols-3 { width: 33.333% !important; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    .carousel-slide.cols-3 { width: 33.333% !important; }
    .carousel-slide.cols-4 { width: 25% !important; }
}
@media (min-width: 1280px) {
    .carousel-slide.cols-4 { width: 25% !important; }
    .carousel-slide.cols-3 { width: 33.333% !important; }
}

/* ============================================
   SIMILAR PRODUCTS - Always slider, 2 per view on mobile
   ============================================ */
@media (max-width: 639px) {
    .similar-products-carousel .carousel-slide.cols-4 { width: 50% !important; }
    .similar-products-carousel .carousel-nav-btn { display: none !important; }
    .similar-products-carousel .carousel-track { gap: 0.5rem !important; }
    .similar-products-carousel .carousel-slide > div {
        border-radius: 0.5rem !important;
    }
    .similar-products-carousel .carousel-slide a.relative {
        padding: 0.5rem !important;
    }
    .similar-products-carousel .carousel-slide .flex.flex-col.p-4 {
        padding: 0.5rem !important;
    }
    .similar-products-carousel .carousel-slide .font-display.text-base {
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
    }
    .similar-products-carousel .carousel-slide .text-sm.text-muted-foreground {
        font-size: 0.65rem !important;
    }
    .similar-products-carousel .carousel-slide .font-display.text-lg {
        font-size: 0.85rem !important;
    }
    .similar-products-carousel .carousel-slide .text-xs.text-muted-foreground.line-through {
        font-size: 0.6rem !important;
    }
    .similar-products-carousel .carousel-slide .absolute.left-3.top-3 {
        left: 0.25rem !important;
        top: 0.25rem !important;
        gap: 0.25rem !important;
    }
    .similar-products-carousel .carousel-slide .absolute.left-3.top-3 span {
        font-size: 0.55rem !important;
        padding: 0.15rem 0.4rem !important;
    }
    .similar-products-carousel .carousel-slide button {
        height: 1.75rem !important;
        font-size: 0.6rem !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    .similar-products-carousel .carousel-slide button svg {
        height: 0.75rem !important;
        width: 0.75rem !important;
    }
}

/* Tablet: 3 items per view */
@media (min-width: 640px) and (max-width: 1023px) {
    .similar-products-carousel .carousel-track { gap: 0.75rem !important; }
    .similar-products-carousel .carousel-slide > div {
        border-radius: 0.75rem !important;
    }
    .similar-products-carousel .carousel-slide a.relative {
        padding: 0.75rem !important;
    }
    .similar-products-carousel .carousel-slide .flex.flex-col.p-4 {
        padding: 0.75rem !important;
    }
    .similar-products-carousel .carousel-slide .font-display.text-base {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    .similar-products-carousel .carousel-slide .text-sm.text-muted-foreground {
        font-size: 0.75rem !important;
    }
    .similar-products-carousel .carousel-slide .font-display.text-lg {
        font-size: 1rem !important;
    }
    .similar-products-carousel .carousel-slide .text-xs.text-muted-foreground.line-through {
        font-size: 0.7rem !important;
    }
    .similar-products-carousel .carousel-slide .absolute.left-3.top-3 {
        left: 0.5rem !important;
        top: 0.5rem !important;
        gap: 0.35rem !important;
    }
    .similar-products-carousel .carousel-slide .absolute.left-3.top-3 span {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.5rem !important;
    }
    .similar-products-carousel .carousel-slide button {
        height: 2rem !important;
        font-size: 0.7rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .similar-products-carousel .carousel-slide button svg {
        height: 0.85rem !important;
        width: 0.85rem !important;
    }
}

/* ============================================
   BEST PRODUCTS - Grid on mobile/tablet
   ============================================ */
@media (max-width: 991px) {
    .best-products-carousel .carousel-track {
        display: grid !important;
        overflow-x: visible !important;
        scroll-snap-type: none !important;
    }
    .best-products-carousel .carousel-slide {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .best-products-carousel .carousel-nav-btn {
        display: none !important;
    }
}

/* Tablet: 3 items per line */
@media (min-width: 768px) and (max-width: 991px) {
    .best-products-carousel .carousel-track {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
    }
    .best-products-carousel .carousel-slide > div {
        border-radius: 0.75rem !important;
    }
    .best-products-carousel .carousel-slide a.relative {
        padding: 0.75rem !important;
    }
    .best-products-carousel .carousel-slide .flex.flex-col.p-4 {
        padding: 0.75rem !important;
    }
    .best-products-carousel .carousel-slide .font-display.text-base {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    .best-products-carousel .carousel-slide .text-sm.text-muted-foreground {
        font-size: 0.75rem !important;
    }
    .best-products-carousel .carousel-slide .font-display.text-lg {
        font-size: 1rem !important;
    }
    .best-products-carousel .carousel-slide .text-xs.text-muted-foreground.line-through {
        font-size: 0.7rem !important;
    }
    .best-products-carousel .carousel-slide .absolute.left-3.top-3 {
        left: 0.5rem !important;
        top: 0.5rem !important;
        gap: 0.35rem !important;
    }
    .best-products-carousel .carousel-slide .absolute.left-3.top-3 span {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.5rem !important;
    }
    .best-products-carousel .carousel-slide button {
        height: 2rem !important;
        font-size: 0.7rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .best-products-carousel .carousel-slide button svg {
        height: 0.85rem !important;
        width: 0.85rem !important;
    }
}

/* Mobile: 2 items per line */
@media (max-width: 767px) {
    .best-products-carousel .carousel-track {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .best-products-carousel .carousel-slide > div {
        border-radius: 0.5rem !important;
    }
    .best-products-carousel .carousel-slide a.relative {
        padding: 0.5rem !important;
    }
    .best-products-carousel .carousel-slide .flex.flex-col.p-4 {
        padding: 0.5rem !important;
    }
    .best-products-carousel .carousel-slide .font-display.text-base {
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
    }
    .best-products-carousel .carousel-slide .text-sm.text-muted-foreground {
        font-size: 0.65rem !important;
    }
    .best-products-carousel .carousel-slide .font-display.text-lg {
        font-size: 0.85rem !important;
    }
    .best-products-carousel .carousel-slide .text-xs.text-muted-foreground.line-through {
        font-size: 0.6rem !important;
    }
    .best-products-carousel .carousel-slide .absolute.left-3.top-3 {
        left: 0.25rem !important;
        top: 0.25rem !important;
        gap: 0.25rem !important;
    }
    .best-products-carousel .carousel-slide .absolute.left-3.top-3 span {
        font-size: 0.55rem !important;
        padding: 0.15rem 0.4rem !important;
    }
    .best-products-carousel .carousel-slide button {
        height: 1.75rem !important;
        font-size: 0.6rem !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    .best-products-carousel .carousel-slide button svg {
        height: 0.75rem !important;
        width: 0.75rem !important;
    }
}

/* ============================================
   PRODUCT GRID (listing + detail pages)
   ============================================ */
@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .product-grid > div > div {
        border-radius: 0.5rem !important;
    }
    .product-grid a.relative {
        padding: 0.5rem !important;
    }
    .product-grid .flex.flex-col.p-4 {
        padding: 0.5rem !important;
    }
    .product-grid .font-display.text-base {
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
    }
    .product-grid .text-sm.text-muted-foreground {
        font-size: 0.65rem !important;
    }
    .product-grid .font-display.text-lg {
        font-size: 0.85rem !important;
    }
    .product-grid .text-xs.text-muted-foreground.line-through {
        font-size: 0.6rem !important;
    }
    .product-grid .absolute.left-3.top-3 {
        left: 0.25rem !important;
        top: 0.25rem !important;
        gap: 0.25rem !important;
    }
    .product-grid .absolute.left-3.top-3 span {
        font-size: 0.55rem !important;
        padding: 0.15rem 0.4rem !important;
    }
    .product-grid button {
        height: 1.75rem !important;
        font-size: 0.6rem !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    .product-grid button svg {
        height: 0.75rem !important;
        width: 0.75rem !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
    }
}

/* ============================================
   PAGINATION - Pro pill style
   ============================================ */
#pagination .tc-page-active {
    box-shadow: 0 6px 18px -6px oklch(0.585 0.232 26.5 / 0.55), 0 0 0 1px oklch(0.585 0.232 26.5 / 0.08);
    transform: translateY(-1px);
}
#pagination .tc-page-active::after {
    content: '';
    position: absolute;
    inset: auto 50% -6px 50%;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: oklch(0.585 0.232 26.5 / 0.35);
    transform: translateX(-50%);
}
#pagination .tc-page {
    position: relative;
    cursor: pointer;
}
#pagination .tc-page:disabled {
    cursor: not-allowed;
}
#pagination .tc-page-ghost {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
}
@media (max-width: 480px) {
    #pagination { gap: 0.375rem !important; }
    #pagination .tc-page { width: 2.25rem; height: 2.25rem; font-size: 0.75rem; }
}

/* ============================================
   PRODUCT GALLERY (thumbs + main)
   Horizontal thumb strip on all viewports
   ============================================ */
.tc-thumbs {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.tc-thumbs::-webkit-scrollbar { height: 6px; width: 6px; }
.tc-thumbs::-webkit-scrollbar-track { background: transparent; }
.tc-thumbs::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 999px;
}
.tc-thumbs::-webkit-scrollbar-thumb:hover { background: var(--color-muted-foreground); }

.tc-thumb {
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.tc-thumb:hover { transform: translateY(-1px); }
.tc-thumb.tc-thumb-active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary), 0 4px 12px -4px oklch(0.58 0.22 27 / 0.25);
}
.tc-thumb.tc-thumb-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-primary);
}

.tc-main-nav { transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease; opacity: 0.9; }
.tc-main-image-wrap { position: relative; }
.tc-main-image-wrap:hover .tc-main-nav { opacity: 1; }
#main-image { transition: opacity 0.25s ease; }
