/* ==================== RTL OVERRIDES - MINIMAL & CLEAN ==================== */

/* Global RTL Direction */
html {
    direction: rtl;
    overflow-x: hidden;
}

body {
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ==================== FONTS ==================== */

/* Arabic Fonts */
body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 400;
    letter-spacing: 0.3px;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.story-title,
.hero-title {
    font-family: 'El Messiri', 'Amiri', serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.hero-content h1 {
    font-family: 'El Messiri', 'Amiri', serif;
    font-weight: 700;
    letter-spacing: 2px;
}

.product-name,
.product-brand,
.category-overlay h3,
.brand-name,
.story-label {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
}

.story-label {
    font-size: 14px !important;
    letter-spacing: 2px !important;
}

.hero-btn,
.btn-hero,
.btn-story,
.category-link,
.instagram-follow-btn,
button,
.btn {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.product-price {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

.section-subtitle {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
    font-size: 16px !important;
}

.hero-subtitle {
    font-size: 18px !important;
}

.product-badge,
.story-text {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
}

.nav-link-custom,
.mobile-nav-menu a,
.submenu-title,
.submenu-list a {
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
}

.footer-section h5,
.footer-section p,
.footer-section a,
.footer-section ul li {
    font-family: 'Cairo', sans-serif;
}

.footer-section h5 {
    font-weight: 600;
}

.brand-logo-text {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
}

.trust-heading,
.trust-subtitle {
    font-family: 'Cairo', sans-serif;
}

input,
textarea,
select,
.form-control {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
}

/* ==================== HEADER – MATCH ENGLISH (LTR LAYOUT) ==================== */

/* Keep header layout exactly like English: LTR, no mirroring */
header,
header .header-wrapper,
header .container-fluid,
header .header-top-row,
header .header-nav,
header .header-nav .container-fluid {
    direction: ltr !important;
    text-align: left !important;
}

.header-top-row .header-left-icons,
.header-top-row .header-right-icons,
header.scrolled .header-scrolled-icons-left,
header.scrolled .header-scrolled-icons-right {
    direction: ltr !important;
}

/* Scrolled bar: force same positions as English (left icons left, right icons right) */
header.scrolled .header-scrolled-icons-left {
    left: 0 !important;
    right: auto !important;
    justify-content: flex-start !important;
}

header.scrolled .header-scrolled-icons-right {
    right: 0 !important;
    left: auto !important;
    justify-content: flex-end !important;
}

header.scrolled .nav-logo-center {
    direction: ltr !important;
}

header .nav-menu {
    direction: ltr !important;
    flex-direction: row !important;
    justify-content: center !important;
}

/* Keep transparent/white header behavior identical to EN */
header:not(.home-header) {
    background-color: var(--white) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
}

header:not(.home-header)::before {
    opacity: 0 !important;
}

body.hero-header header:not(.scrolled) {
    background-color: transparent !important;
    box-shadow: none !important;
}

body.hero-header header:not(.scrolled)::before {
    opacity: 1 !important;
}

body.hero-header header.scrolled {
    background-color: var(--white) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

body.hero-header header.scrolled::before {
    opacity: 0 !important;
}

.currency-menu {
    right: 0 !important;
    left: auto !important;
}

.cart-count {
    right: 6px !important;
    left: auto !important;
    transform: translate(50%, -50%) !important;
}

/* ==================== RTL POSITION FLIPS ==================== */

/* Carousel Buttons */
.carousel-btn.prev,
.carousel-nav.carousel-prev {
    right: auto;
    left: 20px;
}

.carousel-btn.next,
.carousel-nav.carousel-next {
    left: auto;
    right: 20px;
}

.carousel-btn.prev i,
.carousel-btn.next i {
    transform: scaleX(-1);
}

/* Breadcrumbs */
.breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
    content: "‹";
}

/* Product Cards */
.product-details-row {
    flex-direction: row;
}

.product-add-to-cart {
    flex-direction: row-reverse;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
}

.product-add-to-cart span,
.product-details-row .product-add-to-cart span,
button.product-add-to-cart span {
    font-family: 'Cairo', sans-serif !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

.product-brand,
.product-name,
.product-price {
    text-align: right;
}

/* Search Overlay */
.search-clear {
    left: 15px;
    right: auto;
}

/* Cart count: see HEADER RTL section above (left: 6px for RTL) */

/* Mobile Navigation - Slide from RIGHT in RTL using transform */
.mobile-nav-panel {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
}

.mobile-nav.active .mobile-nav-panel {
    transform: translateX(0);
}

.mobile-nav-close {
    left: 20px;
    right: auto;
}

/* Submenu Layout - Flip images */
.submenu-featured-image.left {
    order: 3;
}

.submenu-featured-image.right {
    order: 1;
}

.submenu-grid {
    order: 2;
}

/* Mini Cart - Slide from left in RTL */
.mini-cart-panel {
    position: absolute !important;
    top: 0;
    right: auto !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
    box-shadow: 5px 0 25px rgba(0,0,0,0.15) !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mini-cart.active .mini-cart-panel {
    transform: translateX(0) !important;
}

/* Mini Cart RTL Styling */
.mini-cart-title,
.empty-cart-text,
.mini-cart-item-name,
.mini-cart-item-brand,
.mini-cart-note {
    font-family: 'Cairo', sans-serif !important;
    text-align: right;
}

.mini-cart-header {
    flex-direction: row-reverse;
}

.mini-cart-close {
    left: 30px;
    right: auto;
}

.mini-cart-item {
    flex-direction: row-reverse;
}

.mini-cart-item-details {
    text-align: right;
}

.mini-cart-item-qty {
    flex-direction: row-reverse;
}

.mini-cart-item-price {
    flex-direction: column-reverse;
    align-items: flex-start;
}

.item-remove {
    align-self: flex-start;
}

.mini-cart-subtotal {
    flex-direction: row-reverse;
}

.mini-cart-footer {
    text-align: right;
}

.btn-cart-checkout,
.btn-cart-view {
    font-family: 'Cairo', sans-serif !important;
}

/* Quick View */
.quick-view-close {
    right: auto;
    left: 20px;
}

.quick-view-badge {
    right: auto;
    left: 20px;
}

.quick-view-features,
.quick-view-actions {
    flex-direction: row-reverse;
}

.feature-item {
    text-align: right;
    flex-direction: row-reverse;
}

/* Trust Section */
.trust-item-modern {
    text-align: center;
}

.trust-number {
    direction: ltr;
}

.trust-items-horizontal {
    direction: rtl;
}

/* Categories */
.category-overlay,
.category-overlay h3,
.category-link {
    text-align: center;
}

/* Footer */
.footer-section ul {
    text-align: right;
}

.footer-description,
.footer-newsletter-text {
    text-align: right;
}

/* Story Section */
.story-content {
    text-align: right;
}

.story-image-wrapper {
    order: 2;
}

.story-content {
    order: 1;
}

/* Instagram */
.instagram-overlay {
    text-align: center;
}

/* Numbers and Prices - Keep LTR */
.product-price,
.cart-item-price,
.summary-subtotal,
.summary-total,
.order-total,
.points-value,
.stat-value {
    direction: ltr;
    display: inline-block;
}

/* ==================== RESPONSIVE - RTL SPECIFIC ==================== */

@media (max-width: 991px) {
    .story-image-wrapper,
    .story-content {
        order: 0;
    }
}

@media (max-width: 767px) {
    /* Prevent horizontal scroll */
    html,
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Header - Fixed and Full Width on Mobile */
    header {
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        z-index: 1000 !important;
        overflow-x: hidden !important;
    }
    
    .header-default {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .header-default .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Burger menu visible, desktop nav hidden */
    .burger-menu {
        display: flex !important;
    }
    
    nav.d-none.d-lg-block {
        display: none !important;
    }
    
    /* Ensure all sections fit */
    section,
    .hero-section,
    .container-fluid {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Product carousel container */
    .products-carousel-container,
    .products-carousel,
    .brands-carousel {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Search overlay */
    .search-close {
        left: 20px;
        right: auto;
    }
    
    .search-icon {
        left: auto;
        right: 15px;
    }
    
    .search-clear {
        left: 15px;
        right: auto;
    }
    
    /* Carousel buttons */
    .carousel-btn.prev,
    .carousel-nav.carousel-prev {
        left: 10px;
        right: auto;
    }
    
    .carousel-btn.next,
    .carousel-nav.carousel-next {
        right: 10px;
        left: auto;
    }
    
    /* Mobile nav panel - slides from right on mobile */
    .mobile-nav-panel {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }
    
    .mobile-nav.active .mobile-nav-panel {
        transform: translateX(0);
    }
    
    /* Mini cart mobile */
    .mini-cart-panel {
        position: absolute !important;
        left: 0 !important;
        right: auto !important;
        width: 100% !important;
        max-width: 100vw !important;
        transform: translateX(-100%) !important;
    }
    
    .mini-cart.active .mini-cart-panel {
        transform: translateX(0) !important;
    }
    
    /* Mini cart overlay */
    .mini-cart {
        overflow-x: hidden !important;
    }
    
    /* Section subtitle size override for mobile */
    .section-subtitle {
        font-size: 12px !important;
    }
    
    .hero-subtitle {
        font-size: 14px !important;
    }
}
