/* ===========================================
   Responsive Styles - جميع أحجام الشاشات
   All Screen Sizes Support
   =========================================== */

/* ============ Base Responsive Fixes ============ */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============ iPhone / iOS Button Fix ============ */
button, input[type="submit"], input[type="button"], input[type="reset"], .btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 8px;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Touch-friendly tap targets */
@media (max-width: 991px) {
    .btn, .nav-link, .bottom-nav-item, .header-action-btn, .mobile-menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    input[type="text"], input[type="email"], input[type="tel"], input[type="search"],
    input[type="number"], input[type="password"], select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    /* iOS safe area padding */
    .mobile-bottom-nav {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    
    .mobile-product-bar {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    /* Disable hover transforms on touch devices - prevents sticky hover states */
    .product-card:hover,
    .category-card:hover,
    .service-card:hover,
    .feature-card:hover {
        transform: none;
    }

    /* Tighter section spacing for mobile */
    .section-header {
        margin-bottom: 16px;
    }
}

/* Smooth transitions for all interactive elements */
* {
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============ Red Accent Theme Decoration ============ */
/* خط أحمر للهوية البصرية - Red thread for brand identity */
/* Using body selector prefix for higher specificity instead of !important */

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red-main), var(--primary-500), var(--red-main));
    z-index: 101;
}

body .header-main {
    border-bottom: 3px solid var(--red-main);
    position: relative;
}

/* Red accent on navigation active state */
body .nav-link::after {
    background: linear-gradient(90deg, var(--red-main), var(--secondary-500));
}

body .nav-item.active .nav-link::after,
body .nav-link:hover::after {
    background: linear-gradient(90deg, var(--red-main), var(--secondary-500));
}

/* Red accent on section titles */
body .section-title::after {
    background: linear-gradient(to left, var(--primary-500), var(--red-main), var(--secondary-500));
}

/* Red accent on buttons */
body .btn-primary:hover {
    box-shadow: 0 6px 20px var(--red-glow);
}

/* Red accent on feature cards hover */
body .feature-card:hover {
    border-color: var(--red-main);
}

/* Red accent on product cards hover */
body .product-card:hover {
    border-color: var(--red-main);
    box-shadow: 0 15px 30px rgba(229, 57, 53, 0.12);
}

/* Red accent on category cards */
body .category-card:hover {
    border-color: var(--red-main);
}

/* Red accent on service cards */
body .service-card:hover {
    border-color: var(--red-main);
}

/* Red glow on WhatsApp button */
body .whatsapp-float {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4), 0 0 0 3px var(--red-glow);
}

/* Red dot decoration in titles */
.section-title .red-dot {
    color: var(--red-main);
    font-size: 1.5rem;
    vertical-align: middle;
    margin-right: 6px;
    margin-left: 6px;
}

/* Footer red accent */
body .footer-column h3::after,
body .footer-column h4::after,
body .footer-col h4::after {
    background: linear-gradient(to left, var(--red-main), var(--secondary-500));
}

/* ============ Extra Large Screens (1400px+) ============ */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .hero-content h1,
    .hero-title {
        font-size: 3.4rem;
    }

    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============ Large Screens (1200px - 1399px) ============ */
@media (max-width: 1399px) and (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============ Medium-Large Screens (992px - 1199px) ============ */
@media (max-width: 1199px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero-content h1,
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-content p,
    .hero-desc {
        font-size: 1rem;
    }
}

/* ============ Medium Screens / Tablets (768px - 991px) ============ */
@media (max-width: 991px) {

    /* Header Adjustments */
    .header-top-content {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .header-contact {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-top-actions {
        justify-content: center;
    }

    .header-main-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-box {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 6px;
    }

    /* Navigation Mobile */
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }

    .header-nav.active {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
        padding: 12px;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: 14px 12px;
        border-bottom: 1px solid #f3f4f6;
    }

    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        display: none;
        padding-right: 20px;
    }

    .nav-item.active .nav-dropdown {
        display: block;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Hero Adjustments */
    .hero {
        min-height: auto;
    }

    .hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 24px;
        padding: 50px 0 10px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-content h1,
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 6px 16px;
    }

    .hero-desc {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        max-width: 220px;
        min-height: 220px;
    }

    .hero-orb {
        width: 160px;
        height: 160px;
    }
    
    .hero-float-icon {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .hero-stats {
        justify-content: center;
        gap: 24px;
        padding-bottom: 40px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .hero-wave svg {
        height: 50px;
    }

    /* Grid Adjustments */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ============ Small Tablets / Large Phones (600px - 767px) ============ */
@media (max-width: 767px) {

    /* Header */
    .header-top {
        padding: 4px 0;
        font-size: 0.75rem;
    }

    .header-contact a span {
        display: none;
    }

    .header-contact a i {
        font-size: 1.1rem;
    }

    .header-contact {
        gap: 16px;
    }

    .logo-img {
        height: 42px !important;
    }

    .header-action-btn {
        width: 36px;
        height: 36px;
    }

    .header-action-btn i {
        font-size: 0.95rem;
    }

    .header-action-btn.whatsapp-btn {
        display: none;
    }

    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }

    .cart-count {
        top: -3px;
        right: -3px;
        min-width: 16px;
        height: 16px;
        font-size: 0.55rem;
        border-width: 1.5px;
    }

    /* Hero */
    .hero {
        min-height: auto;
    }

    .hero-inner {
        padding: 40px 0 10px;
        gap: 20px;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 14px;
        margin-bottom: 16px;
    }

    .hero-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .hero-content h1 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .hero-content p,
    .hero-desc {
        font-size: 0.9rem;
        margin-bottom: 20px;
        line-height: 1.7;
    }

    .hero-buttons {
        gap: 10px;
    }

    .hero-buttons .btn {
        padding: 12px 22px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .hero-visual {
        display: none;
    }

    .hero-stats {
        gap: 18px;
        padding-bottom: 35px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .hero-stat-divider {
        height: 30px;
    }

    .hero-wave svg {
        height: 40px;
    }

    /* Sections */
    .section,
    .products-section,
    .categories-section,
    .features-section {
        padding: 28px 0;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .category-card {
        padding: 14px 10px;
    }

    .category-icon {
        width: 50px;
        height: 50px;
    }

    .category-icon i {
        font-size: 1.3rem;
    }

    .category-name {
        font-size: 0.85rem;
    }

    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card-image {
        height: 150px;
    }

    .product-card-body {
        padding: 10px;
    }

    .product-title {
        font-size: 0.85rem;
        min-height: 2.4em;
    }

    .price-current {
        font-size: 1rem;
    }

    /* Product action buttons - smaller on mobile */
    .product-action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .add-to-cart-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-card {
        padding: 20px 16px;
    }

    .service-icon {
        width: 56px;
        height: 56px;
    }

    .service-icon i {
        font-size: 1.4rem;
    }

    /* CTA */
    .cta-content h2 {
        font-size: 1.3rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ============ Mobile Phones (480px - 599px) ============ */
@media (max-width: 599px) {

    /* Container */
    .container {
        padding: 0 12px;
    }

    /* Header - already handled by 600px breakpoint in header-footer.css */
    .header-main {
        padding: 8px 0;
    }

    .header .logo-img {
        height: 36px;
    }

    .search-box {
        min-width: 100%;
    }

    .search-box input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .search-box button {
        width: 34px;
        height: 34px;
    }

    .header-action-btn {
        width: 34px;
        height: 34px;
    }

    .header-action-btn i {
        font-size: 0.9rem;
    }

    .mobile-menu-toggle {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .cart-count {
        top: -3px;
        right: -3px;
        min-width: 15px;
        height: 15px;
        font-size: 0.5rem;
        border-width: 1.5px;
    }

    /* Hero */
    .hero {
        min-height: auto;
    }

    .hero-inner {
        padding: 32px 0 6px;
        gap: 16px;
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: 5px 12px;
        margin-bottom: 12px;
    }

    .hero-badge i {
        font-size: 0.7rem;
    }

    .hero-title {
        font-size: 1.4rem;
        line-height: 1.4;
    }

    .hero-content h1 {
        font-size: 1.4rem;
        line-height: 1.4;
    }

    .hero-content p,
    .hero-desc {
        font-size: 0.88rem;
        line-height: 1.65;
        margin-bottom: 18px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .hero-visual {
        display: none;
    }

    .hero-stats {
        gap: 16px;
        padding-bottom: 30px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .hero-stat-divider {
        height: 28px;
    }

    .hero-wave svg {
        height: 35px;
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .feature-card {
        flex-direction: row;
        text-align: right;
        padding: 14px;
        gap: 14px;
    }

    body.ltr .feature-card {
        text-align: left;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
        border-radius: 10px;
    }

    .feature-icon i {
        font-size: 1.1rem;
    }

    .feature-card h3 {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }

    .feature-card p {
        font-size: 0.78rem;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .category-card {
        padding: 12px 6px;
        gap: 6px;
        border-radius: 10px;
    }

    .category-icon {
        width: 42px;
        height: 42px;
    }

    .category-icon i {
        font-size: 1.1rem;
    }

    .category-name {
        font-size: 0.75rem;
    }

    .category-count {
        font-size: 0.65rem;
    }

    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-card {
        border-radius: 12px;
    }

    .product-card-image {
        height: 130px;
    }

    .product-card-image img {
        padding: 8px;
    }

    .product-card-body {
        padding: 8px 10px;
    }

    .product-category {
        font-size: 0.65rem;
        margin-bottom: 3px;
    }

    .product-title {
        font-size: 0.78rem;
        min-height: 2.2em;
        margin-bottom: 6px;
    }

    .price-current {
        font-size: 0.9rem;
    }

    .price-old {
        font-size: 0.72rem;
    }

    .product-card-footer {
        padding: 6px 10px;
    }

    .product-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .product-actions-fixed {
        top: 8px;
        left: 8px;
        gap: 5px;
    }

    .product-action-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .add-to-cart-btn {
        padding: 7px 8px;
        font-size: 0.75rem;
    }

    /* Sections */
    .section,
    .products-section,
    .categories-section,
    .features-section {
        padding: 22px 0;
    }

    .section-title {
        font-size: 1.15rem;
        padding-bottom: 8px;
    }

    .section-title::after {
        width: 45px;
        height: 3px;
    }

    .view-all-link {
        font-size: 0.85rem;
    }

    /* CTA Section */
    .cta-section {
        padding: 28px 0;
    }

    .cta-content h2 {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }

    .cta-content p {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    /* Services */
    .services-grid {
        gap: 10px;
    }

    .service-card {
        padding: 18px 14px;
    }

    .service-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }

    .service-icon i {
        font-size: 1.2rem;
    }

    .service-card h3 {
        font-size: 0.95rem;
    }

    .service-card p {
        font-size: 0.82rem;
    }

    /* Footer */
    .footer .container {
        padding: 24px 12px 16px;
    }

    .footer-column h4 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .footer-column p,
    .footer-column ul a,
    .footer-contact li {
        font-size: 0.82rem;
    }

    .footer-social a {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .footer-bottom {
        padding-top: 14px;
    }

    .footer-bottom p {
        font-size: 0.78rem;
    }

    /* WhatsApp Float */
    .whatsapp-float {
        width: 48px;
        height: 48px;
        bottom: 16px;
        left: 16px;
        font-size: 1.5rem;
    }

    body.ltr .whatsapp-float {
        left: auto;
        right: 16px;
    }

    /* Toast */
    .toast {
        bottom: 80px;
        padding: 10px 14px;
        font-size: 0.82rem;
        max-width: calc(100% - 24px);
    }
}

/* ============ Extra Small Phones (below 480px) ============ */
@media (max-width: 479px) {

    .container {
        padding: 0 10px;
    }

    .header .logo-img {
        height: 30px;
    }

    .header-action-btn {
        width: 32px;
        height: 32px;
    }

    .header-action-btn i {
        font-size: 0.85rem;
    }

    .mobile-menu-toggle {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .cart-count {
        top: -2px;
        right: -2px;
        min-width: 14px;
        height: 14px;
        font-size: 0.48rem;
        border-width: 1.5px;
    }

    .search-box input {
        padding: 7px 10px;
        font-size: 0.85rem;
    }

    .search-box button {
        width: 32px;
        height: 32px;
    }

    /* Hero */
    .hero-inner {
        padding: 24px 0 4px;
    }

    .hero-badge {
        font-size: 0.65rem;
        padding: 4px 10px;
        margin-bottom: 10px;
    }

    .hero-title,
    .hero-content h1 {
        font-size: 1.2rem;
        line-height: 1.35;
    }

    .hero-content p,
    .hero-desc {
        font-size: 0.82rem;
        line-height: 1.6;
        margin-bottom: 14px;
    }

    .hero-buttons .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .hero-stats {
        gap: 12px;
        padding-bottom: 24px;
    }

    .stat-number {
        font-size: 1.15rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .hero-stat-divider {
        height: 24px;
    }

    .hero-wave svg {
        height: 28px;
    }

    /* Features */
    .feature-card {
        padding: 12px;
        gap: 12px;
    }

    .feature-icon {
        width: 42px;
        height: 42px;
    }

    .feature-icon i {
        font-size: 1rem;
    }

    .feature-card h3 {
        font-size: 0.85rem;
    }

    .feature-card p {
        font-size: 0.72rem;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .category-card {
        padding: 10px 4px;
        gap: 4px;
        border-radius: 8px;
    }

    .category-icon {
        width: 36px;
        height: 36px;
    }

    .category-icon i {
        font-size: 0.95rem;
    }

    .category-name {
        font-size: 0.68rem;
    }

    .category-count {
        font-size: 0.58rem;
    }

    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .product-card {
        border-radius: 10px;
    }

    .product-card-image {
        height: 115px;
    }

    .product-card-image img {
        padding: 6px;
    }

    .product-card-body {
        padding: 6px 8px;
    }

    .product-category {
        font-size: 0.6rem;
    }

    .product-title {
        font-size: 0.72rem;
        min-height: 2em;
        margin-bottom: 4px;
    }

    .price-current {
        font-size: 0.85rem;
    }

    .price-old {
        font-size: 0.68rem;
    }

    .product-card-footer {
        display: none;
    }

    .product-actions-fixed {
        top: 6px;
        left: 6px;
        gap: 4px;
    }

    .product-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .add-to-cart-btn {
        padding: 6px 7px;
        font-size: 0.7rem;
    }

    /* Sections */
    .section,
    .products-section,
    .categories-section,
    .features-section {
        padding: 18px 0;
    }

    .section-title {
        font-size: 1.05rem;
        padding-bottom: 6px;
    }

    .section-title::after {
        width: 40px;
        height: 2px;
    }

    .view-all-link {
        font-size: 0.8rem;
    }

    /* CTA */
    .cta-section {
        padding: 24px 0;
    }

    .cta-content h2 {
        font-size: 1.05rem;
    }

    .cta-content p {
        font-size: 0.8rem;
    }

    /* Services */
    .service-card {
        padding: 14px 12px;
    }

    .service-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 8px;
    }

    .service-icon i {
        font-size: 1rem;
    }

    .service-card h3 {
        font-size: 0.88rem;
    }

    .service-card p {
        font-size: 0.78rem;
    }

    /* Footer */
    .footer .container {
        padding: 20px 10px 14px;
    }

    .footer-column h4 {
        font-size: 0.9rem;
    }

    .footer-column p,
    .footer-column ul a,
    .footer-contact li {
        font-size: 0.78rem;
    }

    .footer-social a {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .footer-bottom p {
        font-size: 0.72rem;
    }

    /* WhatsApp Float */
    .whatsapp-float {
        width: 44px;
        height: 44px;
        bottom: 14px;
        left: 14px;
        font-size: 1.4rem;
    }

    body.ltr .whatsapp-float {
        left: auto;
        right: 14px;
    }

    /* Toast */
    .toast {
        bottom: 76px;
        padding: 8px 12px;
        font-size: 0.78rem;
    }
}

/* ============ Cart Sidebar Responsive ============ */
@media (max-width: 600px) {
    .cart-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .cart-header {
        padding: 16px;
    }

    .cart-header h3 {
        font-size: 1.1rem;
    }

    .cart-items {
        padding: 12px;
    }

    .cart-footer {
        padding: 16px;
    }

    .cart-footer .btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Cart sidebar must sit above bottom nav */
@media (max-width: 768px) {
    .cart-sidebar {
        z-index: 1100;
        padding-bottom: 0;
    }

    .cart-overlay {
        z-index: 1050;
    }

    /* Hide bottom nav when cart overlay is visible */
    .cart-overlay.active ~ .mobile-bottom-nav,
    body.cart-open .mobile-bottom-nav {
        display: none !important;
    }
}

/* ============ Products Page Responsive ============ */
@media (max-width: 1024px) {
    body .products-layout {
        grid-template-columns: 1fr;
    }

    body .products-sidebar {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        border-radius: 0;
        overflow-y: auto;
        transition: right 0.3s ease;
    }

    body.ltr .products-sidebar {
        right: auto;
        left: -320px;
        transition: left 0.3s ease;
    }

    body .products-sidebar.active {
        right: 0;
    }

    body.ltr .products-sidebar.active {
        right: auto;
        left: 0;
    }
}

@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        gap: 12px;
    }

    .products-search {
        width: 100%;
        max-width: 100%;
    }

    .products-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .view-toggle {
        display: none;
    }
}

/* ============ Checkout Page Responsive ============ */
@media (max-width: 768px) {
    body .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-sidebar {
        order: -1;
    }

    .checkout-form {
        padding: 20px;
    }
}

/* ============ Landscape Mode Adjustments ============ */
@media (max-height: 500px) and (orientation: landscape) {

    .hero {
        min-height: 260px;
    }

    .hero-inner {
        padding: 20px 0 4px;
        min-height: 260px;
        flex-direction: row;
        gap: 20px;
    }

    .hero-visual {
        display: none;
    }

    .hero-content h1,
    .hero-title {
        font-size: 1.3rem;
    }

    .hero-stats {
        padding-bottom: 16px;
    }

    .hero-wave svg {
        height: 25px;
    }
}

/* ============ Print Styles ============ */
@media print {

    .header,
    .footer,
    .whatsapp-float,
    .cart-sidebar,
    .cart-overlay {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ============ High DPI Screens ============ */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============ Reduced Motion ============ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============ Dark Mode Support (Optional) ============ */
@media (prefers-color-scheme: dark) {
    /* You can add dark mode styles here if needed */
}

/* ===========================================
   Mobile Bottom Navigation - Kulud Style
   شريط التنقل السفلي للموبايل
   =========================================== */

/* Hide on desktop */
.mobile-bottom-nav {
    display: none;
}

/* Mobile Product Bar - Hidden on desktop */
.mobile-product-bar {
    display: none !important;
}

/* Show on mobile */
@media (max-width: 768px) {
    /* شريط التنقل السفلي العام */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 8px 0 12px;
        border-top: 1px solid #e5e7eb;
    }
    
    /* في صفحة المنتج: إخفاء شريط التنقل السفلي */
    body.product-page .mobile-bottom-nav {
        display: none !important;
    }
    
    /* في صفحة المنتج: إظهار شريط الإضافة للسلة */
    body.product-page .mobile-product-bar {
        display: block !important;
    }
    
    /* إخفاء زر الواتساب العائم في كل الهواتف كما طلب المستخدم */
    .whatsapp-float {
        display: none !important;
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #4b5563 !important;
        font-size: 0.7rem;
        gap: 4px;
        padding: 4px 0;
        transition: color 0.2s ease;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item:visited {
        color: #4b5563 !important;
    }

    .bottom-nav-item i {
        font-size: 1.3rem;
        color: inherit;
        transition: color 0.2s ease;
    }

    .bottom-nav-item svg {
        stroke: #4b5563;
        transition: stroke 0.2s ease;
    }

    .bottom-nav-item.active,
    .bottom-nav-item.active:visited,
    .bottom-nav-item:hover {
        color: #0A2463 !important;
    }

    .bottom-nav-item.active i {
        color: var(--red-main, #DC2626) !important;
    }

    .bottom-nav-item.active .cart-svg-icon {
        stroke: var(--red-main, #DC2626) !important;
    }

    .bottom-nav-item.active svg {
        stroke: var(--red-main, #DC2626);
    }

    /* Cart badge */
    .cart-nav-item {
        position: relative;
        color: #0f2f74 !important;
        overflow: visible;
    }

    .cart-nav-item .cart-svg-icon {
        width: 20px;
        height: 20px;
        stroke: currentColor;
        stroke-width: 2.3;
        background: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        border: none;
        transition: transform 0.22s ease, stroke 0.22s ease;
        position: relative;
    }

    .cart-nav-item:hover .cart-svg-icon,
    .cart-nav-item.active .cart-svg-icon {
        transform: translateY(-1px);
        stroke: var(--red-main, #DC2626) !important;
    }

    .cart-nav-item span:not(.bottom-cart-count) {
        margin-top: 4px;
        font-weight: 700;
    }

    .bottom-cart-count {
        position: absolute;
        top: -4px;
        right: 50%;
        margin-right: -22px;
        transform: none;
        background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%);
        color: white;
        font-size: 0.62rem;
        font-weight: 800;
        min-width: 20px;
        height: 20px;
        border-radius: 999px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 6px;
        line-height: 1;
        border: 2px solid #ffffff;
        box-shadow:
            0 8px 14px rgba(220, 38, 38, 0.35),
            0 2px 5px rgba(0, 0, 0, 0.16);
        z-index: 5;
    }

    body.ltr .bottom-cart-count {
        right: auto;
        margin-right: 0;
        left: 50%;
        margin-left: -22px;
    }

    .bottom-nav-item span:not(.bottom-cart-count) {
        font-weight: 500;
    }

    /* WhatsApp special color */
    .bottom-nav-item:last-child i {
        color: #25D366 !important;
    }

    .bottom-nav-item:last-child:visited {
        color: #4b5563 !important;
    }

    .bottom-nav-item:last-child:visited i {
        color: #25D366 !important;
    }

    /* Add padding to body to prevent content from hiding behind nav */
    body {
        padding-bottom: 70px;
    }
    
    /* صفحة المنتج تحتاج padding أكبر بسبب شريطين */
    body.product-page {
        padding-bottom: 145px;
    }

    /* Hide desktop WhatsApp float on mobile when bottom nav exists */
    .whatsapp-float {
        display: none;
    }

    /* Adjust toast position */
    .toast {
        bottom: 90px;
    }
    
    /* Toast في صفحة المنتج يحتاج ارتفاع أعلى */
    body.product-page .toast {
        bottom: 160px;
    }
}

/* ===========================================
   Enhanced Mobile Product Cards - Kulud Style
   بطاقات المنتجات المحسنة للموبايل
   =========================================== */

@media (max-width: 767px) {

    /* Product card mobile behavior */
    .product-card {
        display: flex;
        flex-direction: column;
    }

    .product-card .product-card-image {
        width: 100%;
        flex-shrink: 0;
    }

    .product-card .product-title {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* Always visible add to cart button with gradient */
    .product-card .add-to-cart-btn {
        background: linear-gradient(135deg, var(--primary-500, #0A2463), var(--primary-light, #1A3E8C));
        color: white;
        border-radius: 8px;
        font-weight: 600;
        margin-top: 8px;
        -webkit-appearance: none;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .product-card .add-to-cart-btn:active {
        transform: scale(0.96);
        background: var(--red-main, #c90000);
    }

    /* Discount badge */
    .product-badge.sale {
        background: var(--red-main, #c90000);
        color: white;
        border-radius: 4px;
    }

    /* Quick actions hidden on product cards only - NOT on product detail page */
    .product-card .product-actions {
        display: none !important;
    }
    
    /* Keep product actions visible on product detail page */
    .product-detail-page .product-actions {
        display: flex !important;
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .products-grid {
        gap: 6px;
    }
}

/* ===========================================
   Enhanced Mobile Categories - Kulud Style
   الأقسام المحسنة للموبايل
   =========================================== */

@media (max-width: 767px) {
    /* Hide category count on mobile for cleaner look */
    .category-count {
        display: none;
    }
}

/* ===========================================
   Enhanced Mobile Header - Kulud Style
   الهيدر المحسن للموبايل
   Bottom nav replaces top nav on mobile
   =========================================== */

@media (max-width: 768px) {

    /* Hide top bar on mobile */
    .header-top {
        display: none;
    }

    /* Hide navigation - use bottom nav instead */
    .header-nav {
        display: none !important;
    }

    /* Hide desktop menu toggle - bottom nav replaces it */
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* ===========================================
   تحسينات صفحة تفاصيل المنتج للهاتف
   Product Detail Page Mobile Enhancements
   =========================================== */

@media (max-width: 767px) {
    /* إظهار أزرار صفحة المنتج */
    .product-detail-page .product-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .product-detail-page .btn-add-to-cart {
        display: flex !important;
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        min-height: 52px !important;
        border-radius: 12px !important;
    }
    
    .product-detail-page .btn-add-to-cart span {
        display: inline !important;
    }
    
    .product-detail-page .btn-whatsapp {
        display: flex !important;
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        min-height: 52px !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    
    .product-detail-page .quantity-selector {
        display: flex !important;
        width: fit-content !important;
        margin: 0 auto !important;
    }
    
    /* تحسين عرض الصورة */
    .product-detail-page .product-main-image {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }
    
    .product-detail-page .product-main-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    
    /* تحسين معلومات المنتج */
    .product-detail-page .product-info {
        padding: 0 !important;
    }
    
    .product-detail-page .product-title {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
    }
    
    .product-detail-page .product-stock {
        display: inline-flex !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
        font-size: 0.85rem !important;
        margin-bottom: 12px !important;
    }
    
    .product-detail-page .product-description p {
        font-size: 0.9rem !important;
        line-height: 1.7 !important;
    }
    
    /* تحسين الميزات */
    .product-detail-page .product-features {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .product-detail-page .feature {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px 12px !important;
        background: #f8f9fa !important;
        border-radius: 10px !important;
    }
    
    .product-detail-page .feature i {
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: white !important;
        border-radius: 8px !important;
        color: var(--red-main, #c90000) !important;
        font-size: 1rem !important;
        flex-shrink: 0 !important;
    }
    
    .product-detail-page .feature span {
        font-size: 0.85rem !important;
        font-weight: 500 !important;
    }
}

@media (max-width: 480px) {
    .product-detail-page .btn-add-to-cart {
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
    }
    
    .product-detail-page .btn-whatsapp {
        padding: 12px 16px !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
    }
    
    .product-detail-page .product-title {
        font-size: 1.1rem !important;
    }
}

/* ===========================================
   Enhanced Mobile Features Section
   قسم المميزات للموبايل
   =========================================== */

@media (max-width: 767px) {
    /* Hide feature descriptions on mobile for compact layout */
    .feature-card p {
        display: none;
    }
}
