/* ===== variables (defaults; overridden per-request by an inline block in base.html from Settings) ===== */
:root {
    --color-primary: #8FAF46;
    --color-secondary: #2B2B2B;
    --color-accent: #C9A227;
    --color-bg: #ffffff;
    --color-bg-alt: #f7f8f4;
    --color-text: #26281f;
    --color-text-muted: #6b6f61;
    --color-border: #e7e9e0;
    --radius: 12px;
    --font-ar: "Cairo", "Tajawal", sans-serif;
    --font-en: "Poppins", "Inter", sans-serif;
    --header-height: 76px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-ar);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

.container {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 20px;
}

.section { padding-block: 64px; }
.section-alt { background: var(--color-bg-alt); }

.section-heading { text-align: center; margin-bottom: 40px; }
.section-heading h2 { font-size: 1.9rem; margin: 0 0 10px; }
.section-heading p { color: var(--color-text-muted); margin: 0; }

/* ===== buttons & badges (shared) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(143,175,70,.35); }
.btn-outline { background: transparent; border-color: #fff; color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-dark { background: var(--color-secondary); color: #fff; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37,211,102,.35); }
.btn-block { width: 100%; justify-content: center; }

.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .74rem;
    font-weight: 700;
}
.badge-new { background: var(--color-accent); color: #fff; }
.badge-featured { background: var(--color-primary); color: #fff; }

/* ===== header ===== */
.site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 200;
    height: var(--header-height);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(6px);
    border-block-end: 1px solid var(--color-border);
    display: flex;
    align-items: center;
}
.site-header__inner {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.site-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-secondary);
    flex-shrink: 0;
}
.site-header__logo i { color: var(--color-primary); font-size: 1.5rem; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: .95rem;
    color: var(--color-text);
}
.main-nav a:hover, .main-nav a.active { background: var(--color-bg-alt); color: var(--color-primary); }

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--color-secondary);
    cursor: pointer;
    padding: 8px;
}

/* ===== mobile drawer ===== */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 300;
}
.drawer-overlay.open { display: block; }

.mobile-drawer {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    /* explicit height (not top:0;bottom:0 alone) — the sticky header's backdrop-filter
       creates a new containing block for fixed descendants, which silently collapses
       top/bottom-stretched fixed elements to their content height. */
    height: 100vh;
    width: min(82vw, 340px);
    background: #fff;
    z-index: 301;
    transform: translateX(100%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    overflow-y: auto;
}
html[dir="rtl"] .mobile-drawer { transform: translateX(-100%); }
/* Must out-specificity the html[dir="rtl"] rule above (which otherwise always wins
   over a plain .open class) so the drawer actually slides into view when opened. */
.mobile-drawer.open,
html[dir="rtl"] .mobile-drawer.open { transform: translateX(0); }

.mobile-drawer__close {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    margin-bottom: 20px;
}
.mobile-drawer nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-drawer nav a {
    padding: 14px 10px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

body.drawer-open { overflow: hidden; }

@media (max-width: 900px) {
    .main-nav { display: none; }
    .hamburger-btn { display: block; }
}

/* ===== footer ===== */
.site-footer {
    background: var(--color-secondary);
    color: #d8dacf;
    padding-block: 50px 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    margin-bottom: 30px;
}
.footer-col h4 { color: #fff; margin: 0 0 16px; font-size: 1.05rem; }
.footer-col p, .footer-col a { color: #b7bab0; font-size: .92rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a:hover { color: var(--color-primary); }
.footer-contact-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.footer-contact-item i { color: var(--color-primary); margin-top: 4px; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}
.footer-social a { color: #fff; }
.footer-social a:hover { background: var(--color-primary); color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.footer-col a.btn-whatsapp, .footer-col a.btn-whatsapp:hover { color: #fff; }
.footer-bottom {
    border-block-start: 1px solid rgba(255,255,255,.12);
    padding-top: 20px;
    text-align: center;
    font-size: .85rem;
    color: #8b8e82;
}

/* ===== floating whatsapp button ===== */
.whatsapp-float {
    position: fixed;
    inset-block-end: 24px;
    inset-inline-end: 24px;
    width: 58px; height: 58px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    z-index: 150;
    transition: transform .2s ease;
}
.whatsapp-float:hover { transform: scale(1.08); }

/* ===== page-navigation loading spinner ===== */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.85);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}
.page-loader.visible { opacity: 1; pointer-events: auto; }
.page-loader__spinner {
    width: 52px; height: 52px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: page-loader-spin .7s linear infinite;
}
@keyframes page-loader-spin { to { transform: rotate(360deg); } }

/* ===== page hero (shared, non-home pages) ===== */
.page-hero {
    background: linear-gradient(135deg, var(--color-secondary), #43481f);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding-block: 70px;
    text-align: center;
}
.page-hero h1 { font-size: 2.1rem; margin: 0 0 10px; }
.page-hero p { color: #dfe1d5; max-width: 560px; margin-inline: auto; }
.page-hero .btn { margin-top: 20px; }

/* ===== home: hero ===== */
.home-hero {
    background: linear-gradient(135deg, rgba(43,43,43,.88), rgba(67,72,31,.82));
    color: #fff;
    padding-block: 90px;
    text-align: center;
}
.home-hero h1 { font-size: 2.5rem; margin: 0 0 16px; }
.home-hero p { max-width: 620px; margin: 0 auto 28px; color: #e7e8dd; font-size: 1.05rem; }
.home-hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===== home: banner carousel + optional side products ===== */
.hero-split { display: flex; align-items: stretch; gap: 30px; margin-block: 30px; }
.hero-split--with-products .hero-carousel { flex: 0 0 70%; }
.hero-split:not(.hero-split--with-products) .hero-carousel { flex: 1; }

.hero-side-products { flex: 0 0 30%; display: flex; flex-direction: column; gap: 16px; }
.hero-side-product {
    position: relative;
    flex: 1;
    min-height: 150px;
    display: flex; align-items: flex-end; justify-content: flex-start;
    background: var(--color-secondary);
    background-size: cover;
    background-position: center;
    padding: 18px;
    border-radius: var(--radius);
    overflow: hidden;
}
.hero-side-product i {
    position: absolute; inset-block-start: 18px; inset-inline-start: 18px;
    font-size: 1.6rem; color: rgba(255,255,255,.85);
}
.hero-side-product span {
    color: #fff; font-weight: 700; font-size: 1.05rem;
    position: relative; z-index: 1;
}

@media (max-width: 860px) {
    .hero-split { flex-direction: column; }
    .hero-split--with-products .hero-carousel { flex: 1; }
    .hero-side-products { flex-direction: row; }
}

/* No dots indicator — overflow:hidden + border-radius here rounds all four
   corners of the slide directly, since the viewport is now the last child. */
.hero-carousel { position: relative; overflow: hidden; border-radius: var(--radius); }
.hero-carousel__viewport { position: relative; }
.hero-carousel__track { display: flex; transition: transform .5s ease; -webkit-transition: transform .5s ease; -moz-transition: transform .5s ease; -ms-transition: transform .5s ease; -o-transition: transform .5s ease; }
.hero-carousel__slide {
    flex: 0 0 100%;
    min-height: 320px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), #6f8a34);
    color: #ffffff;
    text-align: center;
    padding: 30px;
}
.hero-carousel__arrow {
    position: absolute; inset-block: 0; margin-block: auto;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.85); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.hero-carousel__arrow--prev { inset-inline-start: 16px; }
.hero-carousel__arrow--next { inset-inline-end: 16px; }

/* ===== home: why choose cards ===== */
.why-choose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 24px;
}
.why-choose-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 22px;
    text-align: center;
    transition: transform .2s ease, box-shadow .2s ease;
}
.why-choose-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.06); }
.why-choose-card__icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
}
.why-choose-card h3 { font-size: 1.05rem; margin: 0 0 8px; }
.why-choose-card p { color: var(--color-text-muted); font-size: .9rem; margin: 0; }

/* ===== home: stats ===== */
.stats-band { background: var(--color-secondary); color: #fff; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}
.stat-item i { font-size: 1.6rem; color: var(--color-primary); margin-bottom: 10px; display: block; }
.stat-item .stat-number { font-size: 2.1rem; font-weight: 800; }
.stat-item .stat-label { color: #b7bab0; font-size: .88rem; }

/* ===== home: CTA band ===== */
.cta-band {
    background: linear-gradient(135deg, var(--color-primary), #6f8a34);
    color: #fff;
    text-align: center;
    padding-block: 56px;
}
.cta-band h2 { margin: 0 0 10px; }
.cta-band p { margin: 0 0 22px; color: #eef3e2; }

/* ===== product listing toolbar (search + price sort) ===== */
.listing-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 28px;
}
.listing-toolbar input[type="text"],
.listing-toolbar select {
    padding: 11px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: .92rem;
    background: #fff;
    color: var(--color-text);
}
.listing-toolbar input[type="text"] { flex: 1; min-width: 200px; }
.listing-toolbar select { min-width: 180px; }
.listing-toolbar .btn-clear { background: #fff; border-color: var(--color-border); color: var(--color-text); }

/* ===== product cards / listing ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}
.product-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.08); }
.product-card__badges {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}
.product-card__image {
    height: 170px;
    background: var(--color-bg-alt);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-primary);
    font-size: 2.6rem;
    overflow: hidden;
}
.product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card__brand { color: var(--color-text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.product-card__name { font-size: 1.05rem; font-weight: 700; margin: 0; }
.product-card__name span { display: block; font-size: .82rem; font-weight: 400; color: var(--color-text-muted); }
.product-card__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--color-text-muted); }
.product-card__meta span { background: var(--color-bg-alt); padding: 3px 9px; border-radius: 12px; }
.product-card__price { margin-top: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--color-primary); }
.product-card__price .old-price { color: #aaa; font-weight: 400; text-decoration: line-through; font-size: .85rem; }
.product-card__price .on-request { color: var(--color-text-muted); font-weight: 600; font-size: .9rem; }
.product-card__link { position: absolute; inset: 0; z-index: 1; }

/* ===== product detail ===== */
.product-detail { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: start; }
@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail__image {
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    min-height: 320px;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-primary);
    font-size: 5rem;
    overflow: hidden;
}
.product-detail__image img { width: 100%; height: 100%; object-fit: cover; }
.product-detail h1 { font-size: 1.8rem; margin: 6px 0 4px; }
.product-detail .name-en { color: var(--color-text-muted); font-size: 1rem; margin-bottom: 14px; }
.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.spec-table th, .spec-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: start; font-size: .92rem; }
.spec-table th { color: var(--color-text-muted); font-weight: 600; width: 40%; }
.composition-box { background: var(--color-bg-alt); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; }
.composition-box h3 { margin: 0 0 12px; font-size: 1rem; }
.composition-box table { width: 100%; border-collapse: collapse; }
.composition-box td { padding: 7px 0; border-bottom: 1px dashed var(--color-border); font-size: .9rem; }
.composition-box td:last-child { text-align: end; font-weight: 700; color: var(--color-primary); }

/* ===== reviews page + carousel ===== */
/* .review-carousel wraps only the viewport + arrows (dots live outside it, in the
   #review-carousel wrapper below), so inset-block:0 on the arrows centers them
   against the track's height alone, not track+dots combined. */
.review-carousel { position: relative; padding-inline: 46px; }
.review-carousel__viewport { overflow: hidden; }
.review-carousel__track { display: flex; gap: 20px; transition: transform .45s ease; }
.review-card {
    flex: 0 0 calc(33.333% - 14px);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
}
@media (max-width: 900px) { .review-card { flex-basis: calc(50% - 10px); } }
@media (max-width: 620px) { .review-card { flex-basis: 100%; } }
.review-card__stars { color: var(--color-accent); margin-bottom: 10px; }
.review-card__comment { color: var(--color-text); font-size: .93rem; min-height: 60px; }
.review-card__name { margin-top: 14px; font-weight: 700; }
.review-carousel__arrow {
    position: absolute; inset-block: 0; margin-block: auto;
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; border: 1px solid var(--color-border); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.review-carousel__arrow--prev { inset-inline-start: 0; }
.review-carousel__arrow--next { inset-inline-end: 0; }
.review-carousel__dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.review-carousel__dots button {
    width: 9px; height: 9px; border-radius: 50%;
    border: none; background: var(--color-border); cursor: pointer; padding: 0;
}
.review-carousel__dots button.active { background: var(--color-primary); width: 22px; border-radius: 6px; }

.review-submit-cta { text-align: center; margin-top: 40px; }

.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 400;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    max-width: 460px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box__close { position: absolute; inset-inline-end: 16px; inset-block-start: 14px; background: none; border: none; font-size: 1.2rem; cursor: pointer; }
.star-rating { display: flex; gap: 6px; font-size: 1.6rem; color: var(--color-border); justify-content: center; margin: 10px 0 18px; }
.star-rating i { cursor: pointer; }
.star-rating i.active { color: var(--color-accent); }

/* ===== forms (contact / review) ===== */
.form-field { margin-bottom: 16px; text-align: start; }
.form-field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.form-field input, .form-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: .92rem;
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.form-alert-error { background: #fbe6e3; color: #8a2c22; }
.form-alert-success { background: #e7f3df; color: #395c1a; }

/* ===== contact page ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info-card { background: var(--color-bg-alt); border-radius: var(--radius); padding: 26px; margin-bottom: 20px; }
.contact-info-item { display: flex; gap: 14px; margin-bottom: 18px; }
.contact-info-item i { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--color-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-info-item h4 { margin: 0 0 4px; font-size: .95rem; }
.contact-info-item p, .contact-info-item a { margin: 0; color: var(--color-text-muted); font-size: .9rem; }
#map { height: 300px; border-radius: var(--radius); overflow: hidden; margin-top: 20px; }

/* ===== responsive scroll safety ===== */
.table-scroll { overflow-x: auto; }
