:root {
    --background: 240 4.8% 95.9%;
    --text: 240 10% 3.9%;
    --warning: 0 72% 51%;
    --success: 142 71% 45%;
    --success-secondary: 160 84% 39%;
    --muted: 0 0% 100%;
    --border: 240 5.9% 90%;
    --primary: 199 89% 50%;
    --primary-btn: 198 93% 45%;
    --secondary: 240 6% 90%;
    --ring: 240 10% 3.9%;
    --radius: 0.5rem;
    --site-font-scale: 0.9375;
    --site-header-offset: 106px;
    overflow-y: scroll;
}

.dark {
    --background: 240 10% 3.9%;
    --text: 0 0% 98%;
    --warning: 0 84% 60%;
    --success: 142 69% 58%;
    --success-secondary: 161 94% 30%;
    --muted: 270 4% 10%;
    --border: 240 3.7% 15.9%;
    --primary: 198 93% 57%;
    --primary-btn: 198 93% 38%;
    --secondary: 240 4% 16%;
    --ring: 240 4.9% 83.9%;
    color-scheme: dark;
}

input {
    &:-webkit-autofill,
    &:-webkit-autofill:hover {
        -webkit-text-fill-color: hsl(var(--text));
        -webkit-box-shadow: 0 0 0 40rem hsl(var(--muted)) inset,
        0 0 0 1px hsl(var(--muted)) inset;
    }

    &:-webkit-autofill:focus {
        -webkit-text-fill-color: hsl(var(--text));
        -webkit-box-shadow: 0 0 0 40rem hsl(var(--muted)) inset,
        0 0 0 1px hsl(var(--muted)) inset;
    }
}

::selection {
    background: #8884;
}

::-webkit-scrollbar {
    width: .34rem;
    height: .5rem
}

::-webkit-scrollbar-track {
    background-color: hsl(var(--muted)) !important
}

::-webkit-scrollbar-thumb {
    border-radius: calc(var(--radius) - 4px);
    background-color: hsl(var(--secondary)) !important
}


html {
    scrollbar-color: hsl(215.4 16.3% 46.9% / .3);
    font-size: calc(16px * var(--site-font-scale, 0.9375));
}

html.dark {
    scrollbar-color: hsl(215.4 16.3% 56.9% / .3)
}

/* Product prices — medium weight reads cleaner than bold */
.product-price {
    font-weight: 500;
    letter-spacing: -0.01em;
}

.product-price del,
.product-price-old {
    font-weight: 400;
}

/* Product detail description — slightly smaller body text */
.prose.product-detail-text {
    font-size: 0.875rem;
    line-height: 1.75;
}

.prose.product-detail-text :where(h1, h2, h3, h4) {
    font-size: 1.05em;
    line-height: 1.4;
}


::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    z-index: 1;
}

::view-transition-new(root) {
    z-index: 2147483646;
}

.dark::view-transition-old(root) {
    z-index: 2147483646;
}

.dark::view-transition-new(root) {
    z-index: 1;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
input[type="number"] {
    -webkit-appearance: none;
    margin: 0;
    -moz-appearance: textfield !important;
}


.scroll-lock {
    overflow-y: scroll;
    position: fixed;
    width: 100%;
    top: var(--window-scroll-top);
}


body {
    background-color: hsl(var(--background));
    color: hsl(var(--text));
}

@media only screen and (min-width: 1024px) {

    .border-gradient::before {
        background: radial-gradient(
                300px circle at var(--x) var(--y),
                hsl(var(--primary)) 0,
                transparent 100%
        );
    }

}


.swiper-button-prev,
.swiper-button-next {
    background-color: #09090b;
    color: #ffffff;
}


.swiper-button-prev,
.swiper-button-next {
    width: 40px;
    height: 40px;

}

.swiper .swiper-pagination-bullet,
.swiper .swiper-pagination-bullet-active {
    background-color: black; /* bg-black */
    transition: all 0.3s; /* transition-all duration-300 */
    height: 0.375rem; /* h-1.5 (1.5 * 0.25rem) */
    width: 0.375rem; /* w-1.5 (1.5 * 0.25rem) */
}

.swiper .swiper-pagination-bullet-active {
    width: 1.25rem; /* w-5 (5 * 0.25rem) */
    border-radius: 0.5rem; /* rounded-lg */
    background-color: hsl(var(--primary)); /* bg-primary (replace #primary with the actual color value) */
}

/* Hero banner — full width, natural image height */
.hero-banner-section {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    overflow: hidden;
}

.hero-banner-section,
.main-banner.swiper {
    width: 100%;
    max-width: 100%;
}

.main-banner.swiper,
.main-banner .swiper-wrapper,
.main-banner .swiper-slide {
    height: auto !important;
}

.main-banner .swiper-wrapper {
    align-items: flex-start;
}

.main-banner .swiper-slide {
    width: 100% !important;
    height: auto;
}

.main-banner .main-banner__link {
    display: block;
    width: 100%;
    line-height: 0;
}

.main-banner .main-banner__image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: unset;
    object-position: center;
}

.main-banner .swiper-pagination {
    bottom: 8px !important;
}

main.site-main {
    padding-top: var(--site-header-offset);
}

/* Product / content sliders — avoid clipping card edges in container */
main section.container .swiper.product-slider,
main section.container .swiper.product-slider-wrapped,
main section.container .swiper.brand-slider,
main section.container .swiper.blog-swiper,
main section.container .swiper.best-sale-hour-slider {
    width: 100%;
    max-width: 100%;
    padding-inline: 2px;
    box-sizing: border-box;
}

main section.container .swiper .swiper-slide {
    height: auto;
}

/* Cart page — ensure dark theme contrast */
.cart-page {
    color: hsl(var(--text));
}

.cart-page .cart-panel {
    background-color: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
}

.cart-page table {
    background-color: transparent;
    color: hsl(var(--text));
}

.cart-page thead tr {
    background-color: hsl(var(--secondary));
    border-color: hsl(var(--border));
}

.cart-page tbody tr {
    background-color: transparent;
    border-color: hsl(var(--border));
}

.cart-page th,
.cart-page td {
    color: hsl(var(--text));
}

.cart-page input[type="text"] {
    background-color: hsl(var(--background));
    color: hsl(var(--text));
    border-color: hsl(var(--border));
}

.cart-page .cart-qty-box {
    background-color: hsl(var(--background));
    border-color: hsl(var(--border));
    color: hsl(var(--text));
}

.cart-page .cart-qty-box button {
    color: hsl(var(--text));
}

.cart-page .cart-qty-box button:hover {
    background-color: hsl(var(--secondary));
}

/* Desktop megamenu — product grid for leaf categories */
.mega-menu-products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.mega-menu-product-card {
    display: block;
    width: 100px;
    text-align: center;
    text-decoration: none;
    color: hsl(var(--text));
}

.mega-menu-product-thumb {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
}

.mega-menu-product-title {
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.35;
    color: hsl(var(--text) / 0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.mega-menu-product-card:hover .mega-menu-product-title {
    color: hsl(var(--primary));
}

/* دکمه‌های variant — فقط رنگ/بوردر؛ اندازه با Tailwind (مثلاً w-full py-2.5) */
.site-storefront .btn-outline {
    border-radius: var(--radius-lg);
    background-color: hsl(var(--background));
    color: hsl(var(--text));
    border: 2px solid hsl(var(--border));
    text-align: center;
    transition-duration: 0.2s;
}

.site-storefront .btn-outline:hover {
    background-color: hsl(var(--secondary));
}

.site-storefront .btn-success {
    border-radius: var(--radius-lg);
    background-color: hsl(var(--success));
    color: #fff;
    text-align: center;
    transition-duration: 0.2s;
}

.site-storefront .btn-success:hover {
    filter: brightness(0.92);
}

.site-storefront .btn-warning {
    border-radius: var(--radius-lg);
    background-color: hsl(var(--warning));
    color: #fff;
    text-align: center;
    transition-duration: 0.2s;
}

.site-storefront .btn-info {
    border-radius: var(--radius-lg);
    background-color: hsl(var(--primary));
    color: #fff;
    text-align: center;
    transition-duration: 0.2s;
}

.site-storefront .btn-danger {
    border-radius: var(--radius-lg);
    background-color: hsl(var(--warning));
    color: #fff;
    text-align: center;
    transition-duration: 0.2s;
}
