/* أساس تصميم صفحة products. */
/* ===== DESIGN SYSTEM (same as index) ===== */
:root{
  --charcoal:#171717;--ivory:#F7F5F0;--copper:#B78352;--copper-dark:#9A6B3F;--copper-light:#D4A87C;
  --white:#FFFFFF;--text:#252525;--muted:#747474;--border:#E8E4DC;--border-dark:#2A2A2A;
  --success:#2E7D5A;--error:#B3402E;--demo:#6B5B95;
  --font-ar:'Alexandria',system-ui,sans-serif;--font-en:'Inter',system-ui,sans-serif;
  --space-1:.25rem;--space-2:.5rem;--space-3:.75rem;--space-4:1rem;--space-5:1.25rem;--space-6:1.5rem;--space-8:2rem;--space-10:2.5rem;--space-12:3rem;--space-16:4rem;
  --radius-sm:6px;--radius-md:12px;--radius-lg:20px;--radius-full:999px;
  --shadow-sm:0 1px 3px rgba(23,23,23,.06);--shadow-card:0 2px 12px rgba(23,23,23,.06);--shadow-card-hover:0 12px 32px rgba(23,23,23,.12);--shadow-drawer:0 0 60px rgba(23,23,23,.25);
  --container-max:1440px;--container-pad:clamp(1rem,4vw,2.5rem);--header-h:72px;
  --transition:220ms cubic-bezier(.4,0,.2,1);--transition-fast:140ms cubic-bezier(.4,0,.2,1);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{font-family:var(--font-ar);font-size:15px;line-height:1.65;color:var(--text);background:var(--white);overflow-x:hidden;-webkit-font-smoothing:antialiased}
img,picture,svg{display:block;max-width:100%}img{height:auto}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
ul,ol{list-style:none}
input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--copper);outline-offset:3px;border-radius:var(--radius-sm)}
.container{width:100%;max-width:var(--container-max);margin-inline:auto;padding-inline:var(--container-pad)}
.section{padding-block:clamp(3rem,6vw,5rem)}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);padding:.75rem 1.5rem;font-family:var(--font-ar);font-size:.9rem;font-weight:600;border-radius:var(--radius-full);transition:all var(--transition);cursor:pointer;white-space:nowrap;min-height:44px;border:1.5px solid transparent;line-height:1.2}
.btn--copper{background:var(--copper);color:var(--white)}
.btn--copper:hover{background:var(--copper-dark);transform:translateY(-1px);box-shadow:0 8px 20px rgba(183,131,82,.3)}
.btn--dark{background:var(--charcoal);color:var(--white)}
.btn--dark:hover{background:#000;transform:translateY(-1px)}
.btn--outline{background:transparent;color:var(--charcoal);border-color:var(--charcoal)}
.btn--outline:hover{background:var(--charcoal);color:var(--white)}
.btn--ghost{background:transparent;color:var(--text)}
.btn--ghost:hover{background:var(--ivory)}
.btn--sm{padding:.5rem 1rem;font-size:.82rem;min-height:36px}
.btn--lg{padding:.95rem 2rem;font-size:1rem;min-height:50px}
.btn--block{width:100%}

/* Announcement + header (compact) */
.announcement{background:var(--charcoal);color:var(--white);font-size:.82rem;padding-block:.55rem}
.announcement__inner{display:flex;align-items:center;justify-content:center;gap:var(--space-2);text-align:center}
.announcement strong{color:var(--copper-light);font-weight:600}

.site-header{position:sticky;top:0;z-index:100;background:var(--white);border-bottom:1px solid var(--border);transition:box-shadow var(--transition)}
.site-header.is-scrolled{box-shadow:var(--shadow-sm)}
.header-main{display:flex;align-items:center;gap:var(--space-4);height:var(--header-h)}
.logo{display:flex;flex-direction:column;align-items:flex-start;gap:1px;flex-shrink:0;padding-inline-end:var(--space-3);border-inline-end:1px solid var(--border);margin-inline-end:var(--space-2)}
.logo__top{display:flex;align-items:center;gap:4px;font-family:var(--font-ar);font-size:1.35rem;font-weight:800;color:var(--charcoal);letter-spacing:-.02em;line-height:1}
.logo__top::before{content:'';width:18px;height:2px;background:var(--copper);border-radius:2px}
.logo__sub{font-family:var(--font-en);font-size:.6rem;font-weight:500;letter-spacing:.28em;color:var(--muted);padding-inline-start:22px}
.header-search{flex:1;position:relative;max-width:520px}
.header-search__input{width:100%;height:44px;padding:0 1rem 0 3rem;border-radius:var(--radius-full);border:1.5px solid var(--border);background:var(--ivory);font-size:.88rem;transition:border-color var(--transition)}
.header-search__input:focus{outline:none;border-color:var(--copper);background:var(--white)}
.header-search__btn{position:absolute;inset-inline-start:6px;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:var(--muted)}
.header-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
.header-icon{position:relative;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;color:var(--text);transition:background var(--transition-fast),color var(--transition-fast)}
.header-icon:hover{background:var(--ivory);color:var(--copper)}
.header-icon svg{width:22px;height:22px}
.header-icon__badge{position:absolute;top:2px;inset-inline-end:2px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--copper);color:var(--white);font-family:var(--font-en);font-size:.65rem;font-weight:700;display:grid;place-items:center;border:2px solid var(--white);line-height:1}
.header-menu-btn{display:none}
@media(max-width:1023px){
  .header-menu-btn{display:grid;place-items:center;width:44px;height:44px}
  .header-search{display:none}
  .header-icon--account,.header-icon--wishlist{display:none}
  .logo{border:none;padding:0;margin:0}
  .header-main{gap:var(--space-2)}
  .logo{margin-inline-end:auto}
}

/* Breadcrumb */
.breadcrumb{padding-block:var(--space-4);font-size:.82rem;color:var(--muted);display:flex;gap:var(--space-2);flex-wrap:wrap;align-items:center}
.breadcrumb a:hover{color:var(--copper)}
.breadcrumb__sep{opacity:.4}

/* Page head */
.page-head{padding-block:var(--space-6) var(--space-8);border-bottom:1px solid var(--border)}
.page-head__eyebrow{display:inline-block;font-family:var(--font-en);font-size:11px;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:var(--copper);margin-bottom:var(--space-2)}
.page-head h1{font-size:clamp(1.5rem,3vw,2.2rem);font-weight:700;letter-spacing:-.01em;line-height:1.2}
.page-head p{color:var(--muted);font-size:.92rem;margin-top:var(--space-2);max-width:640px}

/* Layout */
.catalog{display:grid;grid-template-columns:1fr;gap:var(--space-6);padding-block:var(--space-8)}
@media(min-width:1024px){.catalog{grid-template-columns:260px 1fr;gap:var(--space-8)}}

/* Sidebar / Filters */
.filters-panel{position:relative}
@media(min-width:1024px){.filters-panel{position:sticky;top:calc(var(--header-h) + 16px);align-self:start}}
.filters-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;padding:.75rem 1rem;background:var(--ivory);border:1.5px solid var(--border);border-radius:var(--radius-md);font-weight:600;font-size:.9rem}
.filters-toggle svg{width:18px;height:18px;transition:transform var(--transition)}
.filters-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
@media(min-width:1024px){.filters-toggle{display:none}}
.filters-body{display:none;margin-top:var(--space-3)}
.filters-body.is-open{display:block}
@media(min-width:1024px){.filters-body{display:block!important;margin-top:0}}

.filter-group{padding-block:var(--space-4);border-bottom:1px solid var(--border)}
.filter-group:first-child{padding-top:0}
.filter-group:last-child{border-bottom:none}
.filter-group__title{font-size:.85rem;font-weight:700;margin-bottom:var(--space-3);display:flex;align-items:center;justify-content:space-between;cursor:pointer}
.filter-group__title svg{width:14px;height:14px;transition:transform var(--transition);opacity:.5}
.filter-group.is-collapsed .filter-group__title svg{transform:rotate(-90deg)}
.filter-group.is-collapsed .filter-group__body{display:none}
.filter-group__body{display:flex;flex-direction:column;gap:var(--space-2)}

.filter-search{width:100%;padding:.55rem .8rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);background:var(--white);font-size:.85rem}
.filter-search:focus{outline:none;border-color:var(--copper)}

.filter-check{display:flex;align-items:center;gap:var(--space-2);cursor:pointer;font-size:.85rem;padding-block:2px;color:var(--text)}
.filter-check input{position:absolute;opacity:0;pointer-events:none}
.filter-check__box{width:18px;height:18px;border:1.5px solid var(--border);border-radius:4px;display:grid;place-items:center;flex-shrink:0;transition:all var(--transition-fast)}
.filter-check__box svg{width:12px;height:12px;opacity:0;color:var(--white);transition:opacity var(--transition-fast)}
.filter-check input:checked + .filter-check__box{background:var(--copper);border-color:var(--copper)}
.filter-check input:checked + .filter-check__box svg{opacity:1}
.filter-check__label{flex:1}
.filter-check__count{font-family:var(--font-en);font-size:.75rem;color:var(--muted)}

.price-range{display:flex;flex-direction:column;gap:var(--space-3)}
.price-range__inputs{display:grid;grid-template-columns:1fr auto 1fr;gap:var(--space-2);align-items:center}
.price-range__inputs input{width:100%;padding:.5rem .6rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:.85rem;text-align:center;font-family:var(--font-en)}
.price-range__inputs input:focus{outline:none;border-color:var(--copper)}
.price-range__inputs span{color:var(--muted);font-size:.8rem}

.filters-clear{width:100%;margin-top:var(--space-4);padding:.65rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-weight:600;font-size:.82rem;transition:all var(--transition-fast)}
.filters-clear:hover{background:var(--charcoal);color:var(--white);border-color:var(--charcoal)}

/* Toolbar (sort + result count) */
.toolbar{display:flex;flex-wrap:wrap;gap:var(--space-3);align-items:center;justify-content:space-between;margin-bottom:var(--space-5);padding:.75rem 1rem;background:var(--ivory);border-radius:var(--radius-md)}
.toolbar__count{font-size:.85rem;color:var(--muted)}
.toolbar__count strong{color:var(--charcoal);font-family:var(--font-en);font-weight:700}
.toolbar__sort{display:flex;align-items:center;gap:var(--space-2);font-size:.85rem}
.toolbar__sort select{padding:.5rem .8rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);background:var(--white);font-size:.82rem;cursor:pointer;min-width:170px}
.toolbar__sort select:focus{outline:none;border-color:var(--copper)}
.toolbar__chips{display:flex;flex-wrap:wrap;gap:6px;width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;background:var(--white);border:1px solid var(--border);border-radius:var(--radius-full);font-size:.75rem;color:var(--text)}
.chip button{display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:var(--ivory);font-size:11px;line-height:1}
.chip button:hover{background:var(--error);color:var(--white)}

/* Product grid */
.product-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--space-3)}
@media(min-width:600px){.product-grid{grid-template-columns:repeat(3,1fr)}}
@media(min-width:1280px){.product-grid{grid-template-columns:repeat(4,1fr);gap:var(--space-4)}}

.product-card{position:relative;background:var(--white);border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden;display:flex;flex-direction:column;transition:box-shadow var(--transition),transform var(--transition),border-color var(--transition)}
.product-card:hover{box-shadow:var(--shadow-card-hover);border-color:transparent;transform:translateY(-3px)}
.product-card__media{position:relative;aspect-ratio:1/1;background:var(--ivory);overflow:hidden;display:block}
.product-card__media img{width:100%;height:100%;object-fit:cover;transition:transform 600ms cubic-bezier(.4,0,.2,1)}
.product-card:hover .product-card__media img{transform:scale(1.04)}
.product-card__badges{position:absolute;top:var(--space-2);inset-inline-start:var(--space-2);display:flex;flex-direction:column;gap:4px;z-index:2}
.badge{display:inline-flex;align-items:center;gap:4px;font-size:.68rem;font-weight:600;padding:3px 8px;border-radius:var(--radius-full);line-height:1.4;white-space:nowrap}
.badge--discount{background:var(--error);color:var(--white)}
.badge--demo{background:var(--demo);color:var(--white)}
.badge--stock{background:var(--success);color:var(--white)}
.badge--out{background:var(--muted);color:var(--white)}
.product-card__wishlist{position:absolute;top:var(--space-2);inset-inline-end:var(--space-2);width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.92);backdrop-filter:blur(4px);display:grid;place-items:center;z-index:2;color:var(--text);transition:all var(--transition-fast);box-shadow:0 2px 8px rgba(0,0,0,.08)}
.product-card__wishlist:hover{background:var(--white);color:var(--error);transform:scale(1.08)}
.product-card__wishlist.is-active{color:var(--error)}
.product-card__wishlist.is-active svg{fill:currentColor}
.product-card__wishlist svg{width:18px;height:18px}
.product-card__body{padding:var(--space-3);display:flex;flex-direction:column;gap:var(--space-2);flex:1}
.product-card__brand{font-family:var(--font-en);font-size:.68rem;font-weight:600;letter-spacing:.08em;color:var(--muted);text-transform:uppercase}
.product-card__title{font-size:.85rem;font-weight:500;line-height:1.4;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.4em}
.product-card__title:hover{color:var(--copper)}
.product-card__price{display:flex;align-items:baseline;gap:var(--space-2);margin-top:auto;flex-wrap:wrap}
.price-current{font-family:var(--font-ar);font-size:1rem;font-weight:700;color:var(--charcoal)}
.price-compare{font-family:var(--font-ar);font-size:.8rem;color:var(--muted);text-decoration:line-through}
.product-card__actions{display:flex;gap:var(--space-2);margin-top:var(--space-1)}
.product-card__add{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:.55rem .7rem;background:var(--charcoal);color:var(--white);border-radius:var(--radius-full);font-size:.78rem;font-weight:600;transition:background var(--transition-fast),transform var(--transition-fast);min-height:36px}
.product-card__add:hover{background:var(--copper)}
.product-card__add:active{transform:scale(.97)}
.product-card__add.is-out{background:var(--muted);cursor:not-allowed}
.product-card__add svg{width:15px;height:15px}

/* Empty state */
.empty-state{grid-column:1/-1;text-align:center;padding:var(--space-16) var(--space-4);color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:var(--space-3)}
.empty-state svg{width:64px;height:64px;opacity:.25}
.empty-state h3{color:var(--text);font-size:1.1rem}

/* Load more */
.load-more-wrap{display:flex;justify-content:center;padding-top:var(--space-8)}

/* Footer (compact) */
.site-footer{background:var(--charcoal);color:#B8B5AD;padding-block:var(--space-8) var(--space-5);font-size:.82rem;margin-top:var(--space-12)}
.footer-bottom{display:flex;flex-wrap:wrap;gap:var(--space-3);align-items:center;justify-content:space-between;color:#8A877F}

/* Toast */
.toast-container{position:fixed;bottom:var(--space-6);inset-inline-start:50%;transform:translateX(50%);z-index:300;display:flex;flex-direction:column;gap:var(--space-2);pointer-events:none;width:calc(100% - 2rem);max-width:380px}
.toast{background:var(--charcoal);color:var(--white);padding:var(--space-3) var(--space-4);border-radius:var(--radius-md);font-size:.85rem;font-weight:500;display:flex;align-items:center;gap:var(--space-2);box-shadow:0 8px 24px rgba(0,0,0,.2);animation:toastIn 300ms cubic-bezier(.4,0,.2,1);pointer-events:auto}
.toast svg{width:18px;height:18px;flex-shrink:0;color:var(--success)}
.toast--error svg{color:#FF7A5C}
@keyframes toastIn{from{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}

/* Overlay + cart drawer */
.overlay{position:fixed;inset:0;background:rgba(23,23,23,.5);backdrop-filter:blur(2px);z-index:200;opacity:0;pointer-events:none;transition:opacity var(--transition)}
.overlay.is-open{opacity:1;pointer-events:auto}
.cart-drawer{position:fixed;top:0;inset-inline-start:0;height:100dvh;width:min(420px,92vw);background:var(--white);z-index:210;transform:translateX(-100%);transition:transform var(--transition);display:flex;flex-direction:column;box-shadow:var(--shadow-drawer)}
[dir="rtl"] .cart-drawer{transform:translateX(110%)}
.cart-drawer[aria-hidden="true"]{pointer-events:none}.cart-drawer.is-open{transform:translateX(0);visibility:visible;pointer-events:auto}
.cart-drawer__head{display:flex;align-items:center;justify-content:space-between;padding:var(--space-4) var(--space-5);border-bottom:1px solid var(--border)}
.cart-drawer__title{font-size:1.05rem;font-weight:700}
.cart-drawer__body{flex:1;overflow-y:auto;padding:var(--space-4) var(--space-5)}
.cart-drawer__foot{padding:var(--space-4) var(--space-5);border-top:1px solid var(--border);background:var(--ivory)}
.cart-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:var(--space-12) var(--space-4);gap:var(--space-3);color:var(--muted)}
.cart-empty svg{width:64px;height:64px;opacity:.3}
.cart-empty h3{color:var(--text);font-size:1rem}
.cart-item{display:grid;grid-template-columns:72px 1fr auto;gap:var(--space-3);padding-block:var(--space-3);border-bottom:1px solid var(--border);align-items:center}
.cart-item:last-child{border-bottom:none}
.cart-item__img{width:72px;height:72px;border-radius:var(--radius-sm);background:var(--ivory);object-fit:cover}
.cart-item__title{font-size:.82rem;font-weight:600;line-height:1.3;margin-bottom:2px}
.cart-item__brand{font-family:var(--font-en);font-size:.65rem;color:var(--muted);letter-spacing:.05em;text-transform:uppercase;margin-bottom:var(--space-2)}
.cart-item__qty{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:var(--radius-full);overflow:hidden;height:28px}
.cart-item__qty button{width:26px;height:26px;display:grid;place-items:center;font-size:14px;font-weight:600;transition:background var(--transition-fast)}
.cart-item__qty button:hover{background:var(--ivory)}
.cart-item__qty span{min-width:26px;text-align:center;font-family:var(--font-en);font-size:.78rem;font-weight:600}
.cart-item__price{font-size:.85rem;font-weight:700;text-align:end}
.cart-item__remove{font-size:.72rem;color:var(--muted);margin-top:4px;text-align:end;transition:color var(--transition-fast)}
.cart-item__remove:hover{color:var(--error)}
.cart-summary-row{display:flex;justify-content:space-between;margin-bottom:var(--space-2);font-size:.88rem}
.cart-summary-row.total{font-size:1.05rem;font-weight:700;color:var(--charcoal);padding-top:var(--space-3);border-top:1px solid var(--border);margin-top:var(--space-3)}
.drawer__close{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--ivory)}
.drawer__close:hover{background:var(--border)}

/* Skeleton */
.skeleton{background:linear-gradient(90deg,#F0EDE5 25%,#E5E0D5 50%,#F0EDE5 75%);background-size:200% 100%;animation:shimmer 1.4s infinite;border-radius:var(--radius-md)}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.skeleton-card{aspect-ratio:1/1;border-radius:var(--radius-md);margin-bottom:var(--space-3)}
.skeleton-line{height:12px;border-radius:6px;margin-bottom:var(--space-2)}
