/* Theme overrides loaded after compiled Tailwind */

/* 1) Dynamic product-card price badge styling with automatic contrast */
.product-card .current-price {
    background-color: var(--price-badge-bg, rgb(var(--color-primary-400))) !important;
}
.product-card .current-price,
.product-card .current-price * {
    color: var(--price-badge-text, #111827) !important;
}

/* 2) Dynamic discount badge on cards and single product */
.campaign-badges span,
.choice-price-discount {
    background-color: var(--badge-discount-bg, #dc2626) !important;
    color: var(--badge-discount-text, #ffffff) !important;
}

/* 3) Dynamic Quick Add button on product cards */
.quick-add-btn {
    background-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    color: var(--btn-cart-text, #111827) !important;
}

/* 4) Dynamic Header Counters (Cart & Wishlist) */
[data-cart-count],
[data-wishlist-count] {
    background-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    color: var(--btn-cart-text, #111827) !important;
}

/* 5) Dynamic Tabs in Single Product */
.tab-btn.amazon-detail-tab.active {
    background-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    color: var(--btn-cart-text, #111827) !important;
}

/* 6) Dynamic Pagination & Buttons in Vendor Stores */
.vendor-store [aria-current="page"] {
    background-color: var(--btn-cart-bg, #111827) !important;
    color: var(--btn-cart-text, #ffffff) !important;
}

/* 7) Hide the old hover button on product cards */
.product-card .quick-look-button {
    display: none !important;
}

/* 8) Dynamic Sidebar Filter Colors */
.price-quick-btn.active {
    background-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    color: var(--btn-cart-text, #111827) !important;
}
.price-quick-btn:hover {
    background-color: #e5e7eb !important;
    color: #111827 !important;
}
.size-filter-item.active {
    background-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    border-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    color: var(--btn-cart-text, #111827) !important;
}
.active-filter-tag {
    background-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    color: var(--btn-cart-text, #111827) !important;
}
.color-filter-item.active .color-swatch {
    outline: 2px solid var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    outline-offset: 2px;
}
.rating-filter-item.active {
    background-color: rgba(var(--color-primary-400, 243 244 246), 0.15) !important;
    outline: 1px solid var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
}
.quick-filter-item.active {
    background-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    border-color: var(--btn-cart-bg, rgb(var(--color-primary-400))) !important;
    color: var(--btn-cart-text, #ffffff) !important;
}

/* 9) Prevent horizontal overflow on the entire page.
   IMPORTANT: never put `overflow-x: hidden` on <body> while <html> has it too. A non-visible
   overflow on both makes <body> its own scroll container, and `position: sticky` (the header)
   then sticks to <body> instead of the viewport - so it scrolls away and "sticky" never works.
   The viewport takes <html>'s value; <body> uses `clip`, which clips without becoming a
   scroll container (browsers without `clip` support just leave body visible). */
html {
    overflow-x: hidden;
}

body {
    overflow-x: clip;
}

.home-banners {
    overflow-x: hidden;
}

/* ===========================================
   NEW PRODUCT SLIDER STYLES
=========================================== */

/* Slider Container */
.product-slider-container {
    position: relative;
    max-width: 100%;
}

/* Slider Viewport */
.slider-viewport {
    overflow: hidden;
    max-width: 100%;
}

/* Slider Track */
.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Slider Slides */
.slider-slide {
    flex-shrink: 0;
}

/* Navigation Arrows */
.slider-nav {
    opacity: 0;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.product-slider-container:hover .slider-nav {
    opacity: 1;
}

.slider-prev {
    right: -20px;
}

.slider-next {
    left: -20px;
}

@media (max-width: 1024px) {
    .slider-prev {
        right: 8px;
    }
    
    .slider-next {
        left: 8px;
    }
    
    /* Always show on mobile */
    .slider-nav {
        opacity: 0.9;
    }
}

/* Slider Dots - Full styles defined in Progress dots section below */

/* Touch/Drag Cursor */
.slider-viewport {
    cursor: grab;
}

.slider-viewport:active {
    cursor: grabbing;
}

/* Smooth scroll for touch devices */
@media (hover: none) {
    .slider-track {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* Responsive Slide Widths */
.slider-slide {
    /* Mobile: 2 items */
    width: calc((100% - 16px) / 2) !important;
}

@media (min-width: 640px) {
    .slider-slide {
        /* Tablet: 3 items */
        width: calc((100% - 32px) / 3) !important; /* gap-4 = 16px, total gaps = 2 * 16 = 32px */
    }
}

@media (min-width: 1024px) {
    .slider-slide {
        /* Desktop: 5 items */
        width: calc((100% - 96px) / 5) !important; /* lg:gap-6 = 24px, total gaps = 4 * 24 = 96px */
    }
}

@media (min-width: 1440px) {
    .slider-slide {
        /* Large: 6 items */
        width: calc((100% - 120px) / 6) !important; /* lg:gap-6 = 24px, total gaps = 5 * 24 = 120px */
    }
}

/* Animation for slide entrance */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slider-slide {
    animation: slideIn 0.4s ease-out;
}

/* Progress dots animation */
.slider-progress {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: #d1d5db;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slider-dot:hover {
    background-color: #9ca3af;
    transform: scale(1.1);
}

.slider-dot.active {
    transform: scale(1.1);
}

.slider-dot.bg-primary-500 {
    width: 24px;
    background: var(--btn-cart-bg, #c8a165);
}

/* 10) RTL price order: WooCommerce wraps the price in <bdi> and marks the symbol dir=auto,
   so <bdi> resolves to LTR and the currency lands first when reading Arabic.
   Force RTL so the number is read first, then the currency (e.g. 599 جنيه). */
[dir="rtl"] .woocommerce-Price-amount bdi,
html[dir="rtl"] .woocommerce-Price-amount bdi {
    direction: rtl;
    unicode-bidi: isolate;
}
