@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('./sw-update-bar.css');

/* iOS-specific fixes for iPhone 13 Pro and other iOS devices */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific fixes */
    html {
        height: -webkit-fill-available;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        -webkit-font-smoothing: antialiased;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Fix for iOS Safari 100vh issue */
    .app-cart,
    #app-menu-drawer {
        height: 100vh;
        height: -webkit-fill-available;
        max-height: -webkit-fill-available;
    }

    /* Fix for iOS touch events */
    button,
    .btn-primary,
    .add-cart,
    .cart-icon-container,
    .nav-icon-link,
    .topnav,
    .quantity-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    /* Fix for iOS input zoom */
    input[type="text"],
    input[type="search"],
    input[type="number"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px !important;
        -webkit-appearance: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* iOS PWA specific fixes */
    @media (display-mode: standalone) {
        body {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }

        header {
            padding-top: env(safe-area-inset-top);
        }

        .app-cart {
            padding-bottom: env(safe-area-inset-bottom);
        }

        .fixed-whats-up {
            bottom: calc(20px + env(safe-area-inset-bottom));
        }

        .a-up {
            bottom: calc(20px + env(safe-area-inset-bottom));
        }
    }
}

/* iPhone 13 Pro specific fixes */
@media only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) {
    body {
        font-size: 19px; /* Slightly smaller font for better readability */
    }
    
    .shop-content {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Adjust grid for smaller screen */
    }
}

* {
    font-family: 'Cairo', 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
    scroll-behavior: smooth;
    scroll-padding: 2rem;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    /* --- Alerts & Danger --- */
    --danger-color: #EF4444;
    --danger-color-hover: #DC2626;

    /* --- Brand Main Colors (مستوحاة من السيارة في اللوجو) --- */
    --main-color: #1abc9c;
    /* Turquoise */
    --main-color-hover: #16a085;
    /* Darker turquoise */
    --sec-color: #2ecc71;
    --Soft-gold-color: #f1c40f;
    /* --- Text Colors --- */
    --text-color: #111827;
    --color-white: #fff;
    /* Dark neutral for readability */
    --text-utedm: #6b7280;
    /* Muted gray for secondary text */
    --text-dark-gray: #777;
    /* Muted gray for secondary text */
    /* --- Backgrounds --- */
    --bg-color: #ffffff !important;
    /* White clean background */
    --bg-light-gray: #f9fafb !important;
    /* Light gray */
    --bg-softer-gray: #f9fafb !important;
    /* Softer background */

    /* --- Surfaces --- */
    --surface: #ffffff;
    --surface-alt: #f3f4f6;
    --border-color: #e5e7eb;

    /* --- Brand Palette (متدرجات احترافية) --- */
    --color-primary: #1abc9c;
    --color-primary-hover: #16a085;
    --color-secondary: #00bcd4;
    --color-accent: #f1c40f;
    --color-danger: #e74c3c;
    --color-success: #2ecc71;

    --whatsapp-color: #25D366;

    /* --- Buttons (Gradient style) --- */
    --btn-fg: #ffffff;

    /* Gradient من التركواز إلى الأزرق */
    --btn-gradient: linear-gradient(135deg, #1abc9c 0%, #00bcd4 100%);
    --btn-gradient-hover: linear-gradient(135deg, #16a085 0%, #0097a7 100%);

    /* Gradient ذهبي للأزرار الخاصة */
    --btn-gradient-hover2: linear-gradient(90deg, #f1c40f 0%, #fffbe6 100%);
    --filter-hover: brightness(1.15) drop-shadow(0 0 6px #FFD700);
}


.delete-btn {
    background-color: var(--danger-color);
    color: var(--color-white);
}

.delete-btn:hover {
    background-color: var(--danger-color-hover);
}

::selection {
    color: var(--text-color);
    background-color: var(--main-color);
}


/* Desktop enhancements */
@media (min-width: 1025px) {

    /* Cart stays full-width slide; ensure it overlays content nicely */
    .app-cart {
        max-width: 100%;
    }

    /* Drawer width a bit larger on big screens */
    #app-menu-drawer {
        width: 22rem;
        max-width: 22rem;
        left: -22rem;
        /* hidden off-canvas; JS sets left: 0 when open */
    }
}

/* Mobile optimizations for smooth scrolling */
@media (max-width: 1024px) {
    .product-box,
    .category-item,
    .cart-item {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000;
        perspective: 1000;
    }
}

/* Small phones fine-tuning */
@media (max-width: 360px) {
    #app-menu-drawer .app-menu-list li a {
        padding: 10px 8px;
        font-size: 15px;
    }
}




body {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100); /* iOS Safari fix */
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-size: 20px;
    height: 100%;
    background-color: var(--bg-color);
    background-attachment: fixed;
    color: var(--text-color);
    -webkit-overflow-scrolling: touch;
    will-change: auto;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

main {
    flex: 1 0 auto;
}

button {
    border-radius: 10px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
}

button:hover {
    cursor: pointer;
}

button:active {
    transform: translateY(1px);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

button:disabled,
button[disabled] {
    background: var(--surface-alt) !important;
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: not-allowed;
    box-shadow: none;
}

/* Primary CTA buttons (gradient only on these classes) */
.btn-primary,
.add-cart {
    background: var(--btn-gradient);
    color: var(--color-white);
}

.btn-primary:hover,
.add-cart:hover {
    background: var(--btn-gradient-hover);
}

/* --- Theme extensions (colors only, no layout changes) --- */
/* Links */
a,
.menu a,
.nav-link {
    color: var(--color-secondary);
    text-decoration-color: rgba(14, 165, 233, 0.4);
    /* Example: 40% opacity of your secondary color */
}

a:hover,
.menu a:hover,
.nav-link:hover {
    color: #0a6fa6;
}

/* Section titles */
.section-title,
.category-title,
h2,
h3 {
    color: var(--text-color);
}

/* Inputs and selects */
input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
select,
textarea {
    background-color: var(--surface);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    /* fallback for color-mix */
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    /* fallback for color-mix */
}

/* Product cards */
.product-box {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    padding: 5px;
}

.product-box:hover {
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.10);
    transform: translateY(-2px);
    transition: .4s;
}


/* Prices */
.product-price {
    color: var(--text-color);
}

.product-old-price,
.product-price-old,
.price-old {
    color: var(--text-muted);
}

.badge-discount {
    color: var(--color-accent);
    animation: pulse 2s infinite;
     border-radius: 10px;
    padding:2px 4px;
}

/* Badges */
.badge {
    background-color: var(--surface-alt);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.badge-success {
    background-color: #e6f9ef;
    color: #05502c;
    border-color: #b6f0d2;
}

.badge-warning {
    background-color: var(--bg-color);
    color: #7a4a03;
    border-color: #ffe6b6;
}

.badge-danger {
    background-color: #fdeaea;
    color: #6b1111;
    border-color: #f7b6b6;
}

/* Header/Footer surfaces */
header,
.header,
footer,
.footer {
    color: var(--text-color);
    background-color: var(--surface);
    border-color: var(--border-color);
}

.footer {
    border-top: 1px solid var(--border-color);
}

/* Focus visible accessibility */
:focus-visible {
    outline: 3px solid #0ea5e9;
    outline-offset: 2px;
}



.container {
    /* max-width: 1068px; */
    margin: auto;
    width: 90%;
}



.product-table {
    padding-bottom: 10px;
}


img {
    width: 100%;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-softer-gray);
    color: var(--text-color);
    box-shadow: 0 1px 4px hs1(0 4% 15% / 10%);
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 2px solid var(--sec-color);
    padding: 1px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.logo-img:hover {
    filter: var(--filter-hover);
}

#div-logo {
    display: flex;
    align-items: center;
}



.nav span {
    font-weight: 700;
}

.cart-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 2px;
}

.cart-icon-container i {
    font-size: 1.7rem;
    color: var(--sec-color);
    margin-bottom: 2px;
}

.cart-icon-container span {
    color: var(--sec-color);
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    line-height: 1.1;
    opacity: 0.95;
    letter-spacing: 0.2px;
    font-family: 'Cairo', 'Poppins', sans-serif;
}

.cart-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cart-icon-container span {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: bold;
}

#app-cart-icon {
    font-size: 1.4rem;
    cursor: pointer;
    border: solid 2px var(--sec-color);
    color: var(--sec-color);
    border-radius: 50%;
    /* padding: 5px; */
}

#app-cart-icon:hover {
    color: var(--main-color);
    filter: var(--filter-hover);
}



.app-cart {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--main-color);
    box-shadow: 2px 0 4px hsla(0, 4%, 15%, 0.1);
    transition: left 0.35s ease;
}

.app-cart.active {
    left: 0;
    transition: left 0.35s ease;
    z-index: 9999;
}

.cart-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    color: var(--main-color);
}

.cart-box {
    display: grid;
    grid-template-columns: 32% 50% 18%;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.cart-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    padding: 10px;
}

.detail-box {
    display: grid;
    row-gap: .5rem;
}

.cart-product-title {
    font-size: 1.2rem;
    text-transform: uppercase;
}

.cart-price {
    font-weight: 500;
    font-size: 1.1rem;
}

.cart-quantity {
    border: 1px solid var(--text-color);
    outline-color: var(--main-color);
    width: 3.4rem;
    text-align: center;
    font-size: 1.2rem;
}

.cart-remove {
    padding: 1px 7px;
    background: var(--bg-color);
    color: var(--danger-color);
    border: none;
    cursor: pointer;
    margin: 0 0 0 38px;
    border-radius: 6px;
    font-size: 1.4rem;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30, 144, 255, 0.08);
    font-weight: 600;
    transition: background 0.2s;
}

.cart-remove:hover {
    background: var(--main-color);
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(30, 144, 255, 0.13);
}


.total {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.5rem;
    padding: 10px;
    border-top: 1px solid var(--text-color);
    font-size: 1.2rem;
}

.total-title {
    font-weight: 600;
    color: var(--main-color);
}

.total-price {
    margin-right: .5rem;
    color: var(--text-color);
}

#total-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.btn-buy {
    display: none;
    /* margin: 1.5rem auto 0 auto; */
    padding: 0 6px;
    /* border: none; */
    /* background-color: var(--sec-color); */
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-buy:hover {
    background-color: var(--main-color);
    color: var(--bg-color);
}

.whats-buy {
    margin-right: 0.2rem;
}

.whats-buy {
    color: #25d366;
    font-size: 30px;
    font-weight: 500;
    transition: color 0.2s;
}

.whats-buy:hover {
    color: #128c7e;
}


#app-cart-close {
    position: absolute;
    top: 1rem;
    right: .8rem;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 10px;
}

#app-cart-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111;
}


.product-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: fill;
    margin-bottom: .5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: .5rem;
}

.product-price {
    font-weight: bold;
    color: var(--text-color);
}

.product-code {
    font-size: 0.85em;
    color: #666;
    margin: 4px 0;
    text-align: center;
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #e9ecef;
}

.product-short-desc {
    font-size: 0.95em;
    color: #444;
    margin: 8px 0 4px 0;
    text-align: center;
}

/* Keep the original .add-cart for the shop page */
.add-cart {
    display: block;
    /* width: 90%; */
    margin: 0 auto 8px auto;
    padding: 5px;
    color: var(--color-white);
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}

.add-cart i {
    margin-left: 4px;
}

.shop-title {
    margin: 50px 5px 1.5rem 5px;
    border-bottom: 2px solid black;
    font-size: 1.4rem;
    font-weight: bold;
}

#footer {
    background-color: var(--bg-softer-gray);
    color: var(--text-color);
    text-align: center;
    padding: 20px 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 1rem;
}

#footer a {
    color: var(--text-color);
    text-decoration: none;
}

#footer .a-up {
    color: var(--sec-color);
    text-decoration: none;
}

#footer a:hover {
    color: var(--main-color);
}


.a-up {
    position: fixed;
    bottom: 20px;
    /* default bottom spacing */
    right: -55px;
    /* hidden by default; JS sets to 20px when showing */
    z-index: 9999;
    width: 52px;
    height: 52px;
    border-radius: 26px;
    background: var(--text-color);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    /* start hidden */
    pointer-events: none;
    /* ignore clicks when hidden */
    transition: right 0.25s ease, opacity 0.25s ease, transform 0.2s ease, background 0.2s ease;
}

.a-up .fa-arrow-up {
    font-size: 22px;
    line-height: 1;
}

.a-up:hover {
    transform: scale(1.05);
}

/* Fixed WhatsApp button aligned bottom-left, parallel to .a-up */
.fixed-whats-up {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    width: 52px;
    height: 52px;
    border-radius: 26px;
    background-color: rgb(77, 194, 71);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.fixed-whats-up i {
    font-size: 36px;
    line-height: 1;
}

.fixed-whats-up:hover {
    transform: scale(1.05);
}

/* Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
    .a-up {
        width: 48px;
        height: 48px;
        bottom: 18px;
    }

    .a-up .fa-arrow-up {
        font-size: 20px;
    }

    .fixed-whats-up {
        width: 44px;
        height: 44px;
        bottom: 14px;
    }

    .fixed-whats-up i {
        font-size: 30px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .a-up {
        width: 44px;
        height: 44px;
        bottom: 14px;
    }

    .a-up .fa-arrow-up {
        font-size: 18px;
    }

    .fixed-whats-up {
        width: 44px;
        height: 44px;
        bottom: 14px;
    }

    .fixed-whats-up i {
        font-size: 30px;
    }

    /* Cart responsive tweaks */
    .app-cart {
        padding: 16px;
    }

    .cart-box {
        grid-template-columns: 28% 1fr auto;
        gap: 0.6rem;
    }

    .cart-img {
        width: 100px;
        height: 100px;
        padding: 6px;
    }

    .cart-product-title {
        font-size: 1rem;
    }

    .cart-price {
        font-size: 1rem;
    }

    .cart-quantity {
        width: 2.6rem;
        font-size: 1rem;
    }

    .cart-remove {
        margin: 0;
        font-size: 1.1rem;
    }

    .total {
        font-size: 1rem;
    }
}

.progress-bar {
    height: 2px;
    background: var(--text-dark-gray);
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
}

li a {
    color: var(--color-white);
}

a:hover {
    /* color: #4946fd */
    color: var(--sec-color);
}

.topnav {
    color: white;
    padding: 5px 7px;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    display: block;

}

.topnav:hover {
    filter: var(--filter-hover);
    border-radius: 50%;
}

.topnav #myLinks {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 85vw;
    max-width: 320px;
    background: var(--bg-color);
    padding: 3rem 1rem 1rem 1rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
    transform: translateX(0);
}

.topnav #myLinks.closing {
    transform: translateX(-100%);
}

.menu-close-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 24px;
    transition: all 0.2s ease;
}

.menu-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--main-color);
}

.topnav.open #myLinks {
    max-height: 60vh;
    opacity: 1;
    pointer-events: auto;
}




/* Drawer class (applied by JS) to ensure reliable styling */
#myLinks.drawer {
    position: fixed;
    top: 0;
    left: -85vw;
    /* Start from left, outside the viewport */
    height: 100vh;
    width: 85vw;
    max-width: 20rem;
    background: var(--bg-color);
    color: #111;
    padding: 0.5rem 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
    transform: translateX(0);
    opacity: 1;
    max-height: none;
    overflow-y: auto;
    transition: left 0.3s ease;
    pointer-events: none;
    z-index: 999;
}

.topnav.open #myLinks.drawer {
    left: 0;
    opacity: 1;
    pointer-events: auto;
}

#myLinks.drawer.closing-right {
    left: -85vw;
}

/* Overlay for mobile drawer */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease;
    z-index: 9998;
}

#myLinks {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

#myLinks li {
    margin: 0;
    padding: 0;
}

#myLinks a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s ease;
}

#myLinks a:hover {
    background: var(--main-color);
    color: var(--color-white);
}

#myLinks hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.menu-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1002;
}

.menu-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Prevent body scroll when drawer is open (mobile only) */
body.no-scroll {
    overflow: hidden;
}

/* Mobile menu styles */
@media (max-width: 1024px) {
    .topnav {
        position: relative;
        z-index: 1000;
    }

    .topnav #myLinks {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 85vw;
        max-width: 320px;
        background: var(--bg-color);
        color: #111;
        padding: 20px 0;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
        transition: left 0.3s ease-in-out;
        z-index: 1001;
        overscroll-behavior: contain;
        opacity: 1;
        visibility: visible;
    }

    .topnav.open #myLinks {
        left: 0;
        pointer-events: auto;
    }

    /* Improved menu animation */
    .topnav #myLinks.closing {
        left: -100%;
    }

    /* Close button inside drawer (top-left) */
    .menu-close {
        position: absolute;
        top: 10px;
        left: 10px;
        /* top-left corner */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: none;
        background: transparent;
        color: #444;
        cursor: pointer;
        transition: background-color 0.15s ease, color 0.15s ease;
        z-index: 1001;
    }

    .menu-close:hover {
        background: rgba(0, 0, 0, 0.06);
        color: #111;
    }
}

.cart-label {
    color: var(--sec-color) !important;
    font-size: 0.72rem !important;
    font-weight: 600;
    margin: 0;
    padding: 0;
    line-height: 1.1;
    opacity: 0.95;
    letter-spacing: 0.2px;
    font-family: 'Cairo', 'Poppins', sans-serif;
    text-align: center;
    display: block;
}




/* Style for the main product image to indicate clickability */




input {
    border-radius: 10px;
    padding: 5px;
}

/* Style for the original price */
.product-original-price {
    text-decoration: line-through;
    /* Strike-through to indicate discount */
    color: #888;
    /* Gray color for original price */
    font-size: 0.9rem;
    /* Slightly smaller font size */
    margin-right: 5px;
    /* Add spacing between original and current price */
}

#main-image-hint {
    display: none;
    color: #888;
    font-size: 13px;
    margin-right: 8px;
}

/* 
.fa-whatsapp {
    font-size: 30px;
} */

.about-link {
    display: inline-block;
    margin: 1rem 0;
    /* color: var(--main-color-hover); */
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s;
}

.about-link:hover {
    /* color: #0056b3; */
    text-decoration: none;
}

.footer-main-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.footer-main-links .about-link {
    font-size: 1.05rem;
    color: var(--main-color);
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s;
    margin: 0 0.2rem;
}

.footer-main-links .about-link:hover {
    color: var(--main-color-hover);
    text-decoration: none;
}

.footer-sep {
    color: #bbb;
    font-size: 1.2rem;
    margin: 0 0.2rem;
    -webkit-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}


.whats-dev i {
    color: #25d366;
    font-size: 1.5rem;
    transition: color 0.2s;
}

.whats-dev i:hover {
    color: #128c7e;
}


.footer-copy {
    text-align: center;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.footer-copy a {
    color: var(--sec-color);
    text-decoration: underline;
}

.footer-copy a:hover {
    color: var(--main-color);
}

.about-main {
    min-height: 60vh;
    padding: 5rem 0 3rem 0;
}

/* Discount badge for product box */
.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e53935;
    /* background: var(--color-primary); */
    /* background: var(--sec-color); */
    color: var(--color-white);
    font-size: 1.1em;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 16px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    letter-spacing: 1px;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
    transition: background 0.2s;
}

.product-box {
    position: relative;
}

#product-on-sale {
    cursor: pointer;
}







/* حاوية جديدة للعناصر التي ستكون في صف واحد */
.products-select-controls {
    display: flex;
    flex-direction: column;
    /* عمودي للموبايل افتراضيًا */
    gap: 15px;
    /* مسافة بين عناصر التحكم */
    width: 100%;
    flex-grow: 1;
    /* السماح لهذه الحاوية بالنمو لملء المساحة المتبقية */
    justify-content: center;
    /* توسيط العناصر داخلها عموديًا */
}

.control-group {
    /* مجموعة لكل مدخل والـ label الخاص به */
    display: flex;
    flex-direction: column;
    /* Label فوق المدخل */
    width: 100%;
    /* تأخذ العرض الكامل في الوضع العمودي */
}


#apply-coupon-btn,
.btn-checkout {
    background-color: var(--main-color);
    color: white;

}

#apply-coupon-btn:hover,
.btn-checkout:hover {
    background-color: var(--main-color-hover);
}

#go-to-selected-product-btn {
    padding: 10px 15px;
    background-color: var(--main-color);
    color: var(--color-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    margin: 5px auto;
    width: auto;
    /* العرض الكامل في الوضع العمودي */
    margin-top: 5px;
    /* هامش بسيط إذا لزم الأمر */
    flex-shrink: 0;
    /* منع الزر من الانكماش */
}

#go-to-selected-product-btn:hover:not(:disabled) {
    background-color: var(--main-color-hover);
}

#go-to-selected-product-btn:active:not(:disabled) {
    transform: scale(0.98);
}

#go-to-selected-product-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/* --- Tablet and larger screens (e.g., max-width: 768px) --- */
/* هنا سنجعل العناصر في صف واحد (flex-direction: row) */
@media (max-width: 768px) {
    .products-select-controls {
        flex-direction: row;
        /* العناصر الآن في صف واحد */
        align-items: flex-end;
        /* محاذاة العناصر لأسفل (خاصة الزر مع المدخلات) */
        gap: 20px;
        /* مسافة أكبر بين العناصر في الصف */
    }

    .control-group {
        flex: 1 1 0;
        /* السماح للمجموعات بالنمو والانكماش بشكل متساوٍ */
        min-width: 0;
        /* مهم للسماح بالانكماش بشكل صحيح */
    }


    #all-products-select {
        font-size: 1em;
    }

    #go-to-selected-product-btn {
        padding: 10px 20px;
        /* تعديل الحشو */
        margin-top: 0;
        /* لا حاجة لهامش علوي هنا لأنه في نفس الصف */
        align-self: flex-end;
        /* لضمان أن الزر محاذي للأسفل مع المدخلات إذا كان ارتفاعه مختلفًا */
    }
}



/* _____________________________________________ */
@media (max-width: 1080px) {


    .container {
        width: 90%;
        margin: 0 auto;
    }

    .category-section,
    .product-details-container {
        margin-top: 85px;
    }

}

/* --- Optional: Desktop specific tweaks --- */
@media (max-width: 992px) {
    .products-select-controls {
        gap: 25px;
    }
}

@media (max-width: 900px) {
    body {
        font-size: 18px;
    }

    .product-box {
        width: 45%;
    }

}

@media (max-width:600px) {
    .footer-copy {
        font-size: 0.98rem;
    }

    .discount-badge {
        font-size: 0.90em;
        padding: 3px 8px;
        top: 6px;
        left: 6px;
    }

    .product-box {
        width: 95%;
    }


    .shop-title {
        margin: 20px 5px 1rem 5px;
        font-size: 1.1rem;
    }



    /* 
    .hello {
        font-size: 12px;
    } */

    .app-cart {
        position: fixed;
        top: 0;
        left: -100%;
        /* unify with desktop behavior */
        width: 100%;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
        background-color: var(--bg-color);
        border: 1px solid var(--main-color);
        box-shadow: 2px 0 4px hsla(0, 4%, 15%, 0.1);
        transition: left 0.35s ease;
        /* same as base */
        z-index: 9999;
    }

    .cart-title {
        text-align: center;
        font-size: 1.5rem;
        font-weight: 600;
        margin-top: 2rem;
    }

    .cart-box {
        display: grid;
        grid-template-columns: 32% 50% 18%;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
    }

    .cart-img {
        width: 100px;
        height: 100px;
        object-fit: contain;
        padding: 10px;
    }

    .detail-box {
        display: grid;
        row-gap: .5rem;
    }

    .cart-product-title {
        font-size: 1rem;
        text-transform: uppercase;
    }

    .cart-price {
        font-weight: 500;
        font-size: 1.1rem;
    }

    .cart-quantity {
        border: 1px solid var(--text-color);
        outline-color: var(--main-color);
        text-align: center;
        font-size: 1rem;
    }

    .cart-remove {
        font-size: 1.1rem;
    }



    .total {
        margin-top: 1.5rem;
        border-top: 1px solid var(--text-color);
    }

    .total-title {
        font-size: 1rem;
        font-weight: 600;
    }

    .total-price {
        margin-right: .5rem;
    }

    .btn-buy {
        padding: 6px 9px;
        color: var(--text-color);
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
    }

    .btn-buy:hover {
        background-color: var(--main-color);
        color: var(--bg-color);
    }

    #app-cart-close {
        top: 1rem;
        right: .8rem;
        font-size: 2rem;
        color: var(--text-color);
        cursor: pointer;
    }



    .product-title {
        font-size: 1.1rem;
        margin-bottom: .5rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .add-cart {
        font-size: .9rem;
        /* padding: 8px; */
    }

    .product-details-container .add-cart {
        /* Slightly less padding on smaller screens */
        font-size: 1em;
       
    }


    .topnav.icon {
        font-size: 20px;
        padding: 3px 13px;
    }

    .category-section {
        margin-top: 80px;
    }

    .product-details-container {
        margin-top: 100px;
    }
}

@media (max-width:500px) {


    .category-section {
        margin-top: 60px;
    }

    .nav.container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 7px 0 3px 0;
    }

    #div-logo {
        flex-direction: row;
        align-items: center;
        gap: 0.3rem;
        margin-bottom: 0;
    }

    .logo-img {
        width: 50px;
        height: 50px;
        padding: 1px;
    }

    .cart-icon-container {
        font-size: 0.9rem;
        gap: 0;
        margin-right: 1px;
    }

    .cart-icon-container i {
        font-size: 1rem;
    }

    .cart-label {
        font-size: 0.5rem !important;
    }

    .topnav {
        font-size: 11px;
        padding: 2px 2px;
    }

    .topnav #myLinks {
        font-size: 9px;
        padding: 2px 2px;
    }

    #app-menu-trigger {
        font-size: 13px;
        padding: 1px 5px;
    }
}

@media (max-width:400px) {

    #go-to-selected-product-btn {
        padding: 8px 12px;
        font-size: 0.9em;
        margin-top: 5px;
    }

    .discount-badge {
        font-size: 0.85em;
        padding: 3px 8px;
        top: 6px;
        left: 6px;
    }

    body.admin-login-page {
        padding: 0;
    }


    .logo {
        font-size: 1rem;
    }

    /* .cart {
        width: 320px;
    } */

    #app-menu-trigger {
        font-size: 15px;
        padding: 3px 13px;
    }
}

@media (max-width:360px) {

    .whats-buy {
        font-size: 20px;
    }

    .category-section {
        margin-top: 70px;
    }

    * {
        font-size: 15px;
    }

    .cart-box {
        display: grid;
        grid-template-columns: 32% 50% 18%;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
    }

    .cart-img {
        width: 80px;
        height: 80px;
        object-fit: contain;
        padding: 10px;
    }

    .detail-box {
        display: grid;
        row-gap: .5rem;
    }

    .cart-product-title {
        font-size: 1rem;
        text-transform: uppercase;
    }

    .cart-price {
        font-weight: 500;
        font-size: 1rem;
    }

    .cart-quantity {
        border: 1px solid var(--text-color);
        outline-color: var(--main-color);
        text-align: center;
        font-size: 1rem;
    }

    .cart-remove {
        font-size: 20px;
    }

    .total {
        margin-top: 1.5rem;
        border-top: 1px solid var(--text-color);
    }

    .total-title {
        font-size: 1rem;
        font-weight: 600;
    }

    .total-price {
        margin-left: .5rem;
    }

    .btn-buy {
        font-size: .8rem;
        font-weight: 500;
    }

    #app-cart-close {
        top: 1rem;
        right: .8rem;
        font-size: 2rem;
    }


    .product-title {
        font-size: 1rem;
        margin-bottom: .5rem;
    }

    .product-price {
        font-size: .9rem;
    }

    .product-original-price {
        font-size: .8rem;
    }

    .add-cart {
        font-size: .8rem;
        /* padding: 8px; */
    }

    #footer {
        padding: 35px 20px;
        font-size: 14px;
    }

    /* Small screens: sizing handled above in media queries. Removed conflicting overrides. */


    #app-menu-trigger {
        font-size: 20px;
    }

    .topnav {
        padding: 5px 5px;
        font-size: 12px;
    }

    .topnav #myLinks {
        font-size: 10px;
    }

}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Fade-in 
 for products */
.fade-in-product {
    opacity: 0;
    animation: fadeInProduct 1.2s forwards;
}

@keyframes fadeInProduct {
    to {
        opacity: 1;
    }
}

/* __________________ */
/* _____________ */
















/* _____________ */
/* __________________ */

/* ===== AppMenu (Isolated Mobile Drawer) ===== */
/* Menu trigger button in header */
#app-menu-trigger {
    font-size: 27px;
    /* Larger icon */
    color: var(--sec-color);
    /* Gold color to match theme */
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

#app-menu-trigger i {
    font-size: 1.7rem;
}

/* Overlay */
#app-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9998;
}

#app-menu-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Drawer (RTL: slide from right) */
#app-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    /* RTL drawer from right */
    height: 100vh;
    width: 85vw;
    max-width: 360px;
    background: var(--color-white);
    color: #111;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 10000;
    overflow-y: auto;
}

#app-menu-drawer.open {
    transform: translateX(0);
}

/* Close button inside drawer */
#app-menu-drawer .app-menu-close {
    position: absolute;
    top: 10px;
    left: 10px;
    /* place at drawer's left edge */
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #444;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

#app-menu-drawer .app-menu-close i {
    font-size: 24px;
}

#app-menu-drawer .app-menu-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111;
}

#app-menu-drawer .app-menu-close:active {
    transform: scale(0.96);
}

/* Prevent background scroll when drawer is open */
body.no-scroll {
    overflow: hidden !important;
    touch-action: none;
}

/* List styling */
#app-menu-drawer .app-menu-list {
    padding: 16px 12px 24px 12px;
}


#app-menu-drawer .app-menu-list li a {
    display: flex;
    font-size: 16px;
    /* align icon and text */
    align-items: center;
    gap: 10px;
    /* space between icon and text */
    padding: 10px 12px;
    color: #222;
    font-weight: 400;
    /* per request: lighter links so headings stand out */
    border-radius: 8px;
    /* transition: background 0.15s ease, color 0.15s ease; */
    transition: background 0.2s ease, color 0.2s ease;

}

/* Icon badge look */
#app-menu-drawer .app-menu-list li a i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border-radius: 8px;
    color: var(--main-color);
    background: rgba(30, 144, 255, 0.10);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) inset;
}

#app-menu-drawer .app-menu-list li a:hover {
    background: var(--main-color);
    color: var(--color-white);
}

/* Slightly enhance icon color on hover */
#app-menu-drawer .app-menu-list li a:hover i {
    color: var(--color-white);
}

#app-menu-drawer .app-menu-list hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 6px 0;
}

/* Headings inside the app menu list (added via JS as <li><p>...) */
#app-menu-drawer .app-menu-list li p {
    display: block;
    margin: 8px 4px 4px;
    padding: 4px 8px;
    color: #111;
    font-weight: 700;
    font-size: 16px;
    opacity: 0.95;
}

/* Show menu trigger and drawer on all screen sizes */
#app-menu-trigger {
    display: flex;
    /* Adjust position for desktop */
    bottom: 30px;
    right: 30px;
}

/* Ensure overlay and drawer are always available */
#app-menu-overlay {
    display: block;
}

#app-menu-drawer {
    display: block;
}

@media (min-width: 1080px) {

    body *,
    header *,
    footer *,
    #app-menu-drawer .app-menu-list li a,
    #footer a,
    #app-menu-trigger i {
        font-size: 20px;
    }

    button {
        font-size: 18px;
    }

    #app-menu-trigger i,
    #app-cart-icon {
        font-size: 40px;
        width: 45px;
        height: 45px;
    }
     .nav-icon-link i {
        font-size: 35px;
        /* width: 40px;
        height: 40px; */
    }

    .nav span {
        font-size: 20px;
    }
}
/* toast alert */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: #ffffff;
    color: var(--text-color);
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast i {
    font-size: 24px;
}

.toast.success {
    border-right: 4px solid #4CAF50;
}

.toast.success i {
    color: #4CAF50;
}
/* _____ */
/* إضافة في ملف style.css */
.badges-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge {
    padding: 6px 12px;
    border-radius: 4px;
    /* font-size: 0.85rem; */
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge i {
    font-size: 0.8rem;
}

.badge-out-of-stock {
    background-color: #6c757d;
    color: white;
    animation: pulse 2s infinite;
    border-radius: 10px;
    padding:2px 4px;
}

.badge-discount {
    background-color: #dc3545;
    color: white;
}

.product-box.out-of-stock {
    opacity: 0.85;
}

.product-box.out-of-stock img {
    filter: grayscale(30%);
}

.product-box.out-of-stock .add-cart.disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ___ */
.low-stock-warning {
    color: #dc3545;
    font-size: 0.9em;
    font-weight: bold;
    display: block;
    margin: 5px 0;
    animation: blink 2s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
/* ___ */
.flex-center-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

#product-search-field {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
}

#filter-search {
    flex: 1;
}
/* ___ */
/* =================================== */
/* ====== تصميم بانر تثبيت PWA ====== */
/* =================================== */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    font-family: 'Cairo', sans-serif;
}

.install-banner-content {
    display: flex;
    align-items: center;
}

.install-banner-icon {
    width: 48px;
    height: 48px;
    margin-left: 15px; /* في النسخة العربية، استخدم margin-left */
}

.install-banner-text strong {
    font-size: 16px;
    color: #333;
    display: block;
}

.install-banner-text p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.install-banner-actions {
    display: flex;
    gap: 10px;
}

.install-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.install-btn.install {
    background-color: #007bff; /* لون أساسي جذاب */
    color: white;
}

.install-btn.install:hover {
    background-color: #0056b3;
}

.install-btn.dismiss {
    background-color: #e9ecef;
    color: #495057;
}

.install-btn.dismiss:hover {
    background-color: #ced4da;
}

/* تصميم للشاشات الصغيرة */
@media (max-width: 600px) {
    .install-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .install-banner-content {
        justify-content: center;
        margin-bottom: 15px;
    }
    .install-banner-actions {
        justify-content: center;
    }
}

/* ____ */
@media (max-width: 1080px) {
    main {
        padding-top: 75px;
    }
}
@media (max-width:500px) {
    main {
        padding-top: 60px;
    }
}
@media (max-width:360px) {
    main {
        padding-top: 65px;
    }
}

/* ===== أزرار التحكم في الكمية للعربة ===== */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.quantity-btn:hover {
    background: var(--main-color);
    color: var(--color-white);
    border-color: var(--main-color);
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface-alt);
    color: var(--text-muted);
}

.cart-quantity {
    border: 1px solid var(--border-color);
    outline-color: var(--main-color);
    width: 60px;
    text-align: center;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    background: var(--surface);
    color: var(--text-color);
}

/* تحسينات للموبايل */
@media (max-width: 768px) {
    .quantity-controls {
        gap: 6px;
    }

    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .cart-quantity {
        width: 50px;
        font-size: 13px;
        padding: 3px;
    }
}

@media (max-width: 480px) {
    .quantity-controls {
        gap: 4px;
    }

    .quantity-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .cart-quantity {
        width: 40px;
        font-size: 12px;
        padding: 2px;
    }
}
