/* ==========================================================================
   Hepravet Egypt — Base Stylesheet (RTL / Arabic)
   Variables, reset, typography, buttons, header, footer, common components
   ========================================================================== */

/* -----------------------------
   1. Reset & Root
   ----------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #611e03;
    --color-primary-dark: #401301;
    --color-primary-darker: #2a0c01;
    --color-primary-light: #f8ece4;
    --color-primary-soft: #f3ddd0;

    --color-accent: #c97a4a;
    --color-accent-dark: #a3582f;
    --color-accent-light: #f5e6dc;

    --color-green: #3d8b40;
    --color-green-dark: #2a662d;
    --color-green-light: #e8f5e9;

    --color-warning: #e67e22;
    --color-danger: #c0392b;
    --color-success: #27ae60;

    --color-bg: #fbf7f4;
    --color-bg-alt: #f5ede6;
    --color-surface: #ffffff;
    --color-border: #ead9cd;
    --color-border-light: #f2e6de;
    --color-text: #2a1408;
    --color-text-muted: #7a6259;
    --color-text-light: #a89588;

    --font-base: "Tajawal", "Inter", "Segoe UI", "Tahoma", Arial, sans-serif;
    --font-heading: "Tajawal", "Inter", "Segoe UI", "Tahoma", Arial, sans-serif;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 5.5rem;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(42, 20, 8, 0.07);
    --shadow-md: 0 4px 12px rgba(42, 20, 8, 0.1);
    --shadow-lg: 0 10px 30px rgba(42, 20, 8, 0.14);

    --container-max: 1200px;
    --header-height: 96px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    line-height: 1.3;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 2.5rem;
}
h2 {
    font-size: 2rem;
}
h3 {
    font-size: 1.5rem;
}
h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-muted);
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: 1rem;
}

/* -----------------------------
   2. Layout Helpers
   ----------------------------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    width: 100%;
}

.section {
    padding: var(--space-2xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-header h2 {
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--color-text-muted);
}

.section-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* -----------------------------
   3. Buttons
   ----------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    line-height: 1.2;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-accent);
    color: #fff;
}

.btn-secondary:hover {
    background-color: var(--color-accent-dark);
    color: #fff;
}

.btn-outline {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: transparent;
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-ghost {
    color: var(--color-text);
    background-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.btn-added {
    background-color: var(--color-success) !important;
    color: #fff !important;
    cursor: default !important;
    pointer-events: none !important;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background-color: #962d22;
    color: #fff;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* -----------------------------
   4. Header & Navigation
   ----------------------------- */
.site-header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    /* gap: var(--space-lg); */
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.brand-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name strong {
    color: var(--color-primary-dark);
    font-size: 1.4rem;
    font-weight: 800;
}

.brand-name span {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.9rem;
    color: var(--color-text);
    font-weight: 500;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.main-nav a:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.main-nav a.active {
    background-color: var(--color-primary);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-inline-start: auto;
}

/* Icon-only nav links (cart, favorites) with notification badge */
.main-nav a.nav-icon-link {
    position: relative;
    padding: 0.5rem 0.6rem;
    gap: 0;
}

.main-nav a.nav-icon-link .ico {
    width: 22px;
    height: 22px;
    stroke-width: 1.9;
}

/* Label is hidden on desktop (icon-only); shown inside the mobile drawer */
.nav-icon-label {
    display: none;
}

.nav-badge {
    line-height: 20px !important;
    position: absolute;
    top: -8px;
    inset-inline-end: -8px;
    min-width: 20px;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-color: var(--color-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-surface);
    box-sizing: content-box;
    pointer-events: none;
    text-align: center;
}

.main-nav a.nav-icon-link.active .nav-badge {
    border-color: var(--color-primary);
}

.main-nav a.nav-icon-link:hover .nav-badge {
    border-color: var(--color-primary-light);
}

/* -----------------------------
   4b. SVG Icons
   ----------------------------- */
.ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.btn-sm .ico,
.main-nav a .ico {
    width: 16px;
    height: 16px;
}

.ico-flip {
    transform: scaleX(-1);
}

.ico-fill {
    fill: currentColor;
    stroke: none;
}

/* -----------------------------
   4c. Mobile Nav Toggle (CSS-only checkbox hack)
   ----------------------------- */
.nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

.nav-toggle-label {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    background-color: transparent;
    transition: background-color 0.2s ease;
    margin-inline-start: auto;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle-label:hover {
    background-color: var(--color-primary-light);
}

.nav-toggle-label span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition:
        transform 0.3s ease,
        opacity 0.2s ease;
}

.nav-toggle:focus-visible ~ .site-header .nav-toggle-label {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.nav-toggle:checked ~ .site-header .nav-toggle-label span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle:checked ~ .site-header .nav-toggle-label span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle:checked ~ .site-header .nav-toggle-label span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-panel {
    display: contents;
}

.nav-backdrop {
    display: none;
}

html:has(.nav-toggle:checked) {
    overflow: hidden;
}

/* -----------------------------
   5. Page Banner (inner pages)
   ----------------------------- */
.page-banner {
    position: relative;
    color: #fff;
    padding: 4rem 0 3.5rem;
    text-align: center;
    overflow: hidden;
}

.page-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        var(--color-primary-dark) 0%,
        var(--color-primary) 50%,
        var(--color-accent) 100%
    );
    z-index: 0;
}

.pb-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    pointer-events: none;
}

.pb-shape-1 {
    width: 320px;
    height: 320px;
    top: -80px;
    inset-inline-end: -60px;
    background: #fff;
}

.pb-shape-2 {
    width: 180px;
    height: 180px;
    bottom: -40px;
    inset-inline-start: -30px;
    background: #fff;
}

.pb-shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    inset-inline-end: 20%;
    background: rgba(255, 255, 255, 0.08);
}

.page-banner-inner {
    position: relative;
    z-index: 1;
}

.pb-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(6px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.page-banner h1 {
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: var(--space-xs);
}

.page-banner p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
    max-width: 600px;
    margin-inline: auto;
}

.pb-breadcrumb {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pb-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.82rem;
}

.pb-breadcrumb li + li::before {
    content: "/";
    margin-inline-end: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
}

.pb-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.pb-breadcrumb a:hover {
    color: #fff;
}

.pb-breadcrumb li[aria-current="page"] {
    color: #fff;
    font-weight: 600;
}

/* ---------- Legal Pages (privacy / terms) ---------- */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: var(--color-text);
}

.legal-content h2 {
    font-size: 1.5rem;
    color: var(--color-primary-dark);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.legal-content h3 {
    font-size: 1.15rem;
    color: var(--color-text);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.legal-content p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.legal-content ul {
    padding-inline-start: 1.5rem;
    margin-bottom: 1rem;
}

.legal-content ul li {
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

/* -----------------------------
   6. Product Card (shared)
   ----------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.product-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-image {
    aspect-ratio: 1;
    background-color: var(--color-primary-light);
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: var(--space-sm);
    inset-inline-start: var(--space-sm);
    background-color: var(--color-warning);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

.product-badge.new {
    background-color: var(--color-accent);
}

.product-badge.sale {
    background-color: var(--color-danger);
}

.product-favorite {
    position: absolute;
    top: var(--space-sm);
    inset-inline-end: var(--space-sm);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-danger);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-size: 1.1rem;
    transition:
        transform 0.2s ease,
        color 0.2s ease;
}
.product-favorite:hover {
    transform: scale(1.15);
}
.product-favorite.fav-active {
    background-color: var(--color-danger);
    color: #fff;
    box-shadow: 0 2px 10px rgba(192, 57, 43, 0.45);
}

.product-info {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-category {
    font-size: 0.75rem;
    color: var(--color-accent-dark);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.product-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

.product-description {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    flex: 1;
}

.product-pricing {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.product-price-old {
    font-size: 0.95rem;
    color: var(--color-text-light);
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: var(--space-sm);
}

.product-actions .btn {
    flex: 1;
}

/* -----------------------------
   7. Forms (shared)
   ----------------------------- */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(97, 30, 3, 0.18);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-helper {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--space-md) 0;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-muted);
    cursor: pointer;
}

/* -----------------------------
   8. Status Badge (shared)
   ----------------------------- */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-pending {
    background-color: #fef3e0;
    color: #b66800;
}

.status-completed {
    background-color: #e3f6e7;
    color: #1f7a35;
}

.status-shipped {
    background-color: #e0f0fa;
    color: #1c5e89;
}

.status-cancelled {
    background-color: #fde5e3;
    color: #962d22;
}

/* -----------------------------
   9. Empty State
   ----------------------------- */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
}

.empty-icon {
    font-size: 4rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    margin-bottom: var(--space-sm);
}

.empty-state p {
    margin-bottom: var(--space-lg);
}

/* -----------------------------
   10. Footer
   ----------------------------- */
.site-footer {
    background-color: #2a1408;
    color: #d8c5b8;
    padding: var(--space-2xl) 0 var(--space-lg);
    /* margin-top: var(--space-2xl); */
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: var(--space-md);
}

.footer-col p,
.footer-col a {
    color: #c4b0a3;
    font-size: 0.9rem;
}

.footer-col a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.footer-col .ico {
    width: 14px;
    height: 14px;
    color: #e6c9b3;
}

.footer-col ul li {
    margin-bottom: var(--space-xs);
}

.footer-col a:hover {
    color: #fff;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-brand .brand-logo {
    width: 56px;
    height: 56px;
    background-color: #fff;
    border-radius: 12px;
    padding: 4px;
}

.footer-brand strong {
    color: #fff;
    font-size: 1.15rem;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    color: #c4b0a3;
    font-size: 0.9rem;
}

.contact-list .icon {
    color: #e6c9b3;
    margin-top: 2px;
}

.social-icons {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.social-icons a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c3d1ca;
    font-weight: 700;
    transition: all 0.2s ease;
}

.social-icons a:hover {
    background-color: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: #7e8d86;
}

.footer-legal {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-legal a {
    color: #7e8d86;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: var(--color-primary);
}

.newsletter-form {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.newsletter-form input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.9rem;
}

.newsletter-form input::placeholder {
    color: #7e8d86;
}

.newsletter-form button {
    padding: 0.6rem 1rem;
    background-color: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
}

/* -----------------------------
   11. Utilities
   ----------------------------- */
.text-center {
    text-align: center;
}
.text-muted {
    color: var(--color-text-muted);
}
.mt-sm {
    margin-top: var(--space-sm);
}
.mt-md {
    margin-top: var(--space-md);
}
.mt-lg {
    margin-top: var(--space-lg);
}
.mb-0 {
    margin-bottom: 0;
}
.mb-md {
    margin-bottom: var(--space-md);
}
.mb-lg {
    margin-bottom: var(--space-lg);
}

.section-surface {
    background-color: var(--color-surface);
}

/* -----------------------------
   12. Responsive (base layout)
   ----------------------------- */
@media (max-width: 992px) {
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.6rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---- Tablet / small desktop: switch nav to hamburger drawer ---- */
@media (max-width: 1100px) {
    .nav-toggle-label {
        display: flex;
    }

    .header-actions {
        margin-inline: 0;
    }

    .header-inner {
        flex-wrap: nowrap;
        gap: var(--space-md);
    }

    .brand-logo {
        width: 60px;
        height: 60px;
    }

    .brand-name strong {
        font-size: 1.15rem;
    }

    .brand-name span {
        font-size: 0.78rem;
    }

    .nav-panel {
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
        align-items: stretch;
        position: fixed;
        top: var(--header-height);
        bottom: 0;
        /* AR (RTL) default: drawer anchored to the LEFT, slides in from the LEFT */
        left: 0;
        right: auto;
        width: min(85vw, 320px);
        background-color: var(--color-surface);
        padding: var(--space-lg);
        box-shadow: 10px 0 30px rgba(42, 20, 8, 0.18);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 250;
        overflow-y: auto;
        border-right: 1px solid var(--color-border);
        border-left: none;
    }

    /* EN (LTR): drawer anchored to the RIGHT, slides in from the RIGHT */
    html[dir="ltr"] .nav-panel,
    body.dir-ltr .nav-panel {
        left: auto;
        right: 0;
        transform: translateX(100%);
        box-shadow: -10px 0 30px rgba(42, 20, 8, 0.18);
        border-right: none;
        border-left: 1px solid var(--color-border);
    }

    .nav-toggle:checked ~ .site-header .nav-panel {
        transform: translateX(0);
    }

    .main-nav {
        width: 100%;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .main-nav a {
        padding: 0.85rem 1rem;
        font-size: 1rem;
        width: 100%;
        gap: 0.55rem;
    }

    .main-nav a .ico {
        width: 18px;
        height: 18px;
    }

    .main-nav a.nav-icon-link {
        padding: 0.85rem 1rem;
        gap: 0.6rem;
        justify-content: flex-start;
    }

    .main-nav a.nav-icon-link > .ico {
        order: 0;
    }

    .main-nav a.nav-icon-link .nav-icon-label {
        display: inline-block;
        order: 1;
        flex: 1;
        text-align: start;
        font-weight: 500;
    }

    .main-nav a.nav-icon-link .nav-badge {
        position: static;
        order: 2;
        margin-inline-start: 0;
        border: none;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
        margin-top: auto;
        padding-top: var(--space-md);
        border-top: 1px solid var(--color-border);
    }

    .header-actions .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        top: var(--header-height);
        bottom: 0;
        inset-inline: 0;
        background-color: rgba(42, 20, 8, 0.45);
        z-index: 240;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-toggle:checked ~ .site-header .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .section {
        padding: var(--space-xl) 0;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .section-title-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-title-bar .btn {
        align-self: stretch;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }
    h1 {
        font-size: 1.6rem;
    }
    h2 {
        font-size: 1.4rem;
    }
    .container {
        padding: 0 var(--space-md);
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .product-info {
        padding: var(--space-sm);
    }
    .product-name {
        font-size: 0.95rem;
    }
    .product-price {
        font-size: 1.05rem;
    }

    .header-inner {
        gap: var(--space-sm);
    }

    .brand-name span {
        display: none;
    }

    .page-banner {
        padding: 2.5rem 0 2rem;
    }
    .page-banner h1 {
        font-size: 1.6rem;
    }
    .pb-icon {
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
        margin-bottom: 0.9rem;
    }
    .pb-shape-1 {
        width: 180px;
        height: 180px;
        top: -50px;
        inset-inline-end: -40px;
    }
    .pb-shape-2 {
        width: 100px;
        height: 100px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }
}

/* -----------------------------
   18. Language Toggle (AR/EN)
   ----------------------------- */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline-end: var(--space-sm);
    padding: 4px;
    background: var(--color-primary-light);
    border-radius: 999px;
    border: 1px solid var(--color-border);
}

.lang-toggle button {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    padding: 5px 11px;
    min-width: 36px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    line-height: 1;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.lang-toggle button:hover {
    color: var(--color-primary-dark);
}

.lang-toggle button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.lang-toggle button.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* Place toggle inside the header-actions slot consistently across LTR/RTL */
.header-actions .lang-toggle {
    margin-inline-end: 0;
}

/* Mobile: keep toggle compact and visible inside the nav panel */
@media (max-width: 900px) {
    .lang-toggle {
        margin: 0 0 var(--space-sm) 0;
        align-self: stretch;
        justify-content: center;
    }
    .lang-toggle button {
        flex: 1 1 0;
    }
}

/* -----------------------------
   19. No-flicker reveal
   ----------------------------- */
body {
    opacity: 0;
    transition: opacity 0.18s ease-in;
}
body.i18n-ready {
    opacity: 1;
}
/* If JS is disabled, still show the page */
.no-js body {
    opacity: 1;
}

/* -----------------------------
   20. LTR (English) tweaks
   The site was designed RTL-first. These flips keep visuals correct in LTR.
   ----------------------------- */
html[dir="ltr"] .ico-flip {
    transform: scaleX(-1);
}

html[dir="ltr"] .offers-strip-link {
    /* The Arabic uses ← arrow in the link text; swap for an LTR arrow visually */
    unicode-bidi: plaintext;
}

html[dir="ltr"] .cart-actions .btn-outline,
html[dir="ltr"] .cart-secure-note {
    direction: ltr;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-primary-light);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary-light) var(--color-bg);
}

/* ==========================================================================
   Preloader
   ========================================================================== */
.pf-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;
}
.pf-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.pf-loader-logo {
    width: 90px;
    height: auto;
    animation: pfLoaderPulse 1.2s ease-in-out infinite;
}
.pf-loader-bar {
    width: 140px;
    height: 3px;
    background: var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.pf-loader-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        var(--color-primary),
        transparent
    );
    border-radius: 10px;
    animation: pfLoaderSlide 1.4s ease-in-out infinite;
}

@keyframes pfLoaderPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}
@keyframes pfLoaderSlide {
    0% {
        left: -40%;
    }
    100% {
        left: 100%;
    }
}
