:root {
    --swiper-navigation-size: 22px;
    --swiper-theme-color: rgb(88, 88, 88);
}

@font-face {
    font-family: 'IRANYekanXVF';
    font-weight: 100 1000;
    /* full variable range */
    font-style: normal;
    font-display: swap;
    src: url('../fonts/IRANYekanXVF.woff2') format('woff2-variations'),
        url('../fonts/IRANYekanXVF.woff2') format('woff2');
}

/* Apply IRANYekanXVF as default font for all elements */
* {
    font-family: 'IRANYekanXVF', sans-serif !important;
    font-feature-settings: "ss02" !important;
    -moz-font-feature-settings: "ss02" !important;
    -webkit-font-feature-settings: "ss02" !important;
}

/* Alternative: More specific selectors to avoid overriding form inputs, etc. */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
    font-family: 'IRANYekanXVF', 'Vazirmatn', sans-serif;
}

/* Set default font weights for semantic elements */
h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
    font-weight: 600;
    /* Bold weight */
}

label,
caption,
legend,
th {
    font-weight: 500;
    /* Medium weight */
}

/* Default body text */
body {
    font-family: 'IRANYekanXVF', 'Vazirmatn', sans-serif;
    font-weight: 400;
    /* Regular weight */
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ========================================
   MEGA MENU STYLES - OPTIMIZED VERSION
   ======================================== */

/* Container */
/* Hide scrollbar utility (keep this - used by other components too) */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Header stays on top */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Position mega menu directly under header */
body.freeze .mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 100px);
}

/* کانتینر اصلی Swiper */
.categories-swiper {
    width: 100%;
    direction: rtl;
}

/* ⚠️ حذف تنظیمات width از swiper-slide - به Swiper واگذار شده */

/* استایل آیتم دسته‌بندی (داخل slide) */
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 10px;
}


/* Wrapper آیکون */
.category-icon-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* دایره پس‌زمینه */


.dark .category-icon-bg {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
}

/* آیکون */
.category-icon-wrapper img {
    position: relative;
    z-index: 1;
    width: 170px;
    height: 170px;
    object-fit: contain;
}

/* Hover Effect */
.category-item:hover .category-icon-bg {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

.dark .category-item:hover .category-icon-bg {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

/* عنوان */
.category-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.dark .category-title {
    color: #d1d5db;
}

.category-item:hover .category-title {
    color: #0ea5e9;
}

.dark .category-item:hover .category-title {
    color: #14b8a6;
}

/* دکمه‌های Navigation */
.categories-swiper .swiper-button-next,
.categories-swiper .swiper-button-prev {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #0ea5e9;
}

.swiper-button-next.swiper-button-disabled,
.swiper-button-prev.swiper-button-disabled {
    opacity: 1;
}

.swiper-button-next.swiper-button-disabled:after,
.swiper-button-prev.swiper-button-disabled:after {
    opacity: .35;
}

.categories-swiper .swiper-button-next:after,
.categories-swiper .swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

.dark .categories-swiper .swiper-button-next,
.dark .categories-swiper .swiper-button-prev {
    background: #374151;
    color: #14b8a6;
}

/* Responsive */
@media (max-width: 768px) {
    .category-icon-wrapper {
        width: 125px;
        height: 125px;
    }

    .category-icon-wrapper img {
        width: 110px;
        height: 110px;
    }

    .category-title {
        font-size: 12px;
    }

    .categories-swiper .swiper-button-next,
    .categories-swiper .swiper-button-prev {
        display: none;
    }
}




/* ==========================================
   Blog HomePage
   ========================================== */
.blog-swiper .blog-content-small h3 {
    font-size: 12px;
}

.blog-swiper .blog-date-small {
    font-size: 10px;
}

/* ==========================================
   PRODUCTS SWIPER - RTL SUPPORT
   ========================================== */
.products-carousle {
    border: 1px solid #B2B2B2;
    border-radius: 12px;
    position: relative;
    overflow: visible;
}

.products-carousle.sale-carousel {
    border: 1px solid rgba(210, 22, 22, 0.5);
    border-radius: 12px;
    box-shadow: 0px 8px #CF1616;
}

.products-carousel-wrapper {
    position: relative;
}


.products-swiper {
    width: 100%;
    position: relative;
    direction: rtl;
    overflow: hidden;
}

.products-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

/* ==========================================
   PRODUCT CARD
   ========================================== */

.product-card {
    background: transparent;
    ;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   PRODUCT SWIPER - SLIDE SEPARATOR
   ========================================== */

/* Draw a centered divider between slides using a pseudo-element */
.products-swiper .product-swiper-slide {
    position: relative;
}

/* The divider sits in the LEFT half of the gap (RTL: visually between cards) */


.dark .products-swiper .product-swiper-slide::after {
    background-color: #374151;
    /* dark mode color */
}

/* Hide divider on the first slide (no gap before it) */
.products-swiper .product-swiper-slide:first-child::after {
    display: none;
}



.dark .product-card {
    background: transparent;
}

/* ==========================================
   SALE TIMER (بالای کارت)
   ========================================== */
.sale-timer {
    position: static;
    /* no longer absolute — reserves its own space */
    width: 100%;
    direction: ltr;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 4px;
    margin-bottom: 6px;
    border-bottom: 2px solid #ee1c25;
    background: transparent;
}

/* Empty placeholder rendered when a product has no active sale — keeps
   the card at the same vertical position as cards that DO have a timer. */
.sale-timer-placeholder {
    width: 100%;
    min-height: 28px;
    /* matches .sale-timer's natural height */
    margin-bottom: 6px;
    /* same bottom margin as .sale-timer */
    flex-shrink: 0;
}

.sale-timer__time {
    order: 1;
    direction: ltr;
    unicode-bidi: plaintext;
    font-weight: 700;
    font-size: 13px;
    color: #ee1c25;
    letter-spacing: .5px;
    line-height: 1;
}

.sale-timer__icon {
    order: 2;
    display: flex;
    color: #ee1c25;
    flex-shrink: 0;
    line-height: 0;
    animation: sale-timer-flip 2.4s ease-in-out infinite;
    transform-origin: center;
}

@keyframes sale-timer-flip {

    0%,
    35% {
        transform: rotate(0deg);
    }

    50%,
    85% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(180deg);
    }
}

.sale-timer.is-expired {
    display: none;
}

/* actions now scoped to the image wrapper, not the whole card */
.product-image-wrapper {
    position: relative;
}

.product-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    /* or left, per your RTL layout */
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-list .product-actions {
    position: relative;
}

/* ==========================================
   PROGRESS BAR (نوار پیشرفت)
   ========================================== */

.timer-progress-bar {
    width: 100%;
    height: 6px;
    background: #fee2e2;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.dark .timer-progress-bar {
    background: rgba(220, 38, 38, 0.2);
}

.timer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 3px;
    transition: width 1s linear;
    position: relative;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
}

/* انیمیشن پالس برای نوار پیشرفت */
.timer-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}



/* ==========================================
   Product Single 
   ========================================== */

#purchase-box-inner .feature-item {}

.product-single .feature-list p {
    font-size: 12px;
}

.product-single .tab-content {}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Fixed layout styles */
.tab-contents-container {
    position: relative;
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* For the sticky sidebar */
#sticky-purchase-box {
    position: sticky;
    top: 125px;
    align-self: flex-start;
    transition: all 0.3s ease;
}



/* When sidebar should become fixed */
#sticky-purchase-box.fixed {
    top: 140px;
    right: auto;
    transform: translateX(0);
}

/* Ensure the main container has proper flex layout */
.flex.gap-4.mt-12.mb-12 {
    position: relative;
    align-items: flex-start;
}

/* Add these styles to prevent layout shift */
.tab-content {
    min-height: 400px;
}

#tab-comments {
    position: relative;
}

/* ==========================================
   Blog HomePage
   ========================================== */

footer .feature-box {
    position: relative;
    top: -50px;
}

footer .main-footer {
    background-color: #19393A;
    border-radius: 20px;
    min-width: 90%;
    margin-bottom: 20px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .sale-timer {
        padding: 8px 10px;
    }

    .timer-text {
        font-size: 14px;
    }

    .hourglass-icon {
        width: 16px;
        height: 16px;
    }

    .timer-progress-bar {
        height: 5px;
    }
}

@media (max-width: 480px) {
    .sale-timer {
        padding: 6px 8px;
        top: 8px;
        left: 8px;
        right: 8px;
    }

    .timer-text {
        font-size: 13px;
    }

    .hourglass-icon {
        width: 14px;
        height: 14px;
    }

    .timer-progress-bar {
        height: 4px;
    }
}


.timer-text {
    display: block;
}

/* ==========================================
   ACTION BUTTONS (Favorite & Compare)
   ========================================== */

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: #eeeeee;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #f9fafb;
    transform: scale(1.1);
}

.action-btn svg {
    color: #6b7280;
    transition: color 0.3s ease;
}

.favorite-btn:hover svg {
    color: #ef4444;
    fill: #ef4444;
}

.compare-btn:hover svg {
    color: #3b82f6;
}

.dark .action-btn {
    background: #374151;
    border-color: #4b5563;
}

.dark .action-btn:hover {
    background: #4b5563;
}

.dark .action-btn svg {
    color: #9ca3af;
}

/* ==========================================
   COLOR SELECTOR (عمودی در سمت راست تصویر)
   ========================================== */

.color-selector {
    position: absolute;
    right: 12px;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}

.color-option {
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
    cursor: pointer;
    ;
}

.color-option.disabled {
    cursor: no-drop;
    ;
}


/* ==========================================
   PRODUCT IMAGE
   ========================================== */

.product-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
}

.product-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* ==========================================
   PRODUCT INFO
   ========================================== */

.product-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    line-height: 1.5;
    min-height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #0ea5e9;
}

.dark .product-title {
    color: #d1d5db;
}

/* ==========================================
   PRICING
   ========================================== */

.product-pricing {
    gap: 8px;
}

.price-wrapper {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    flex-direction: column;
}

.original-price {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
    font-family: 'Arial', sans-serif;
}

.discount-badge {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.final-price {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    text-align: right;
    font-family: 'Arial', sans-serif;
}

.currency {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.dark .final-price {
    color: #f3f4f6;
}

.dark .currency {
    color: #9ca3af;
}

/* ==========================================
   SWIPER NAVIGATION BUTTONS
   ========================================== */

.products-swiper .swiper-button-next,
.products-swiper .swiper-button-prev {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #0ea5e9;
    transition: all 0.3s ease;
}

.products-swiper .swiper-button-next:after,
.products-swiper .swiper-button-prev:after {
    font-size: 20px;
    font-weight: bold;
}

.products-swiper .swiper-button-next:hover,
.products-swiper .swiper-button-prev:hover {
    background: #0ea5e9;
    color: white;
    transform: scale(1.1);
}


.dark .products-swiper .swiper-button-next,
.dark .products-swiper .swiper-button-prev {
    background: #374151;
    color: #14b8a6;
}

.dark .products-swiper .swiper-button-next:hover,
.dark .products-swiper .swiper-button-prev:hover {
    background: #14b8a6;
    color: white;
}


.products-carousle .swiper-button-next,
.products-carousle .swiper-button-prev {
    width: 42px;
    height: 42px;
    background: #fff;
    border-radius: 50%;
    z-index: 20;
    transform: scaleX(-1);
    border: 1px solid #b2b2b2;
}

.products-carousle .swiper-title {
    position: relative;
    padding-right: 1rem;
    justify-content: space-between;
    /* فضای بیشتر برای آیکون */
}

.feature-carousel .swiper-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    /* عرض آیکون */
    height: 32px;
    /* ارتفاع آیکون */

    /* SVG به صورت Base64 یا URL */
    background-image: url("../images/sale-sign.svg");

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sale-carousel {
    --swiper-theme-color: red;
}

.sale-carousel .swiper-title {
    color: red;
}

.sale-carousel .swiper-title {
    color: red;
}

/* RTL positioning (very important) */

.products-carousle .swiper-button-prev {
    right: -20px !important;
    left: auto;
}

.products-carousle .swiper-button-next {
    left: -20px !important;
    right: auto;
}

.products-carousle .swiper-button-prev svg {
    transform: rotate(180deg) !important;
    width: 25px;
    height: 25px;
}

.products-carousle .swiper-button-next svg {
    transform: rotate(0deg) !important;
    width: 25px;
    height: 25px;
}

.sale-carousel .swiper-button-next,
.sale-carousel .swiper-button-prev {
    border: 1px solid rgb(210, 22, 22);
}

/* ==========================================
   Categories Grid
   ========================================== */

.grid-border {
    margin-inline: auto;
    --gap: 2rem;
    --line-offset: calc(var(--gap) / 2);
    --line-thickness: 1px;
    --line-color: #f0f0f0;
    overflow: hidden;
    display: grid;
    gap: var(--gap)
}

.grid-border-item {
    position: relative
}

.grid-border-item:after,
.grid-border-item:before {
    content: "";
    position: absolute;
    background-color: var(--line-color);
    z-index: 1
}

.grid-border-item:after {
    inline-size: 100vw;
    block-size: var(--line-thickness);
    inset-inline-start: 0;
    inset-block-start: calc(var(--line-offset) * -1)
}

.grid-border-item:before {
    inline-size: var(--line-thickness);
    block-size: 100vh;
    inset-block-start: 0;
    inset-inline-start: calc(var(--line-offset) * -1)
}


/* ==========================================
   SWIPER PAGINATION
   ========================================== */

.products-swiper .swiper-pagination {
    bottom: 10px;
}

.products-swiper .swiper-pagination-bullet {
    background: #d1d5db;
    opacity: 1;
    transition: all 0.3s ease;
}

.products-swiper .swiper-pagination-bullet-active {
    background: #0ea5e9;
    width: 24px;
    border-radius: 4px;
}


/* Watch Histoty Start */

.watch-history .content {
    border: 1px solid #B2B2B2;
    border-radius: 12px;
}

.watch-history .flex-col {
    border-left: 1px solid #B2B2B2;
    border-radius: 0;
}

.watch-history .content-column {
    padding: 10px 0;
}

.watch-history .flex-col:last-child {
    border-left: 0;
}

.watch-history .product-list a {
    border-left: 1px solid #e2e2e2;
    border-radius: 0;
}

.watch-history .product-list a:last-child {
    border-left: 0;
}

/* Watch Histoty End */


/* ==========================================
   feature-carousel
   ========================================== */
.feature-carousel .products-carousle {
    box-shadow: 3px 20px 40px #0e4d584f;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .product-card {
        padding: 12px;
    }

    .sale-timer {
        font-size: 11px;
        padding: 4px 8px;
    }

    .action-btn {
        width: 32px;
        height: 32px;
    }

    .action-btn svg {
        width: 16px;
        height: 16px;
    }

    .color-option {
        width: 20px;
        height: 20px;
    }

    .product-image-wrapper {
        min-height: 160px;
    }

    .product-image {
        max-height: 160px;
    }

    .product-title {
        font-size: 13px;
    }

    .final-price {
        font-size: 14px;
    }

    .products-swiper .swiper-button-next,
    .products-swiper .swiper-button-prev {
        display: none;
    }
}

@media (max-width: 480px) {
    .color-selector {
        top: 80px;
    }

    .product-image-wrapper {
        min-height: 140px;
    }

    .product-image {
        max-height: 140px;
    }
}