:root{
    --bg: #FAF6F0;
    --surface: #FFFFFF;
    --surface-alt: #F2E9DA;
    --text: #2A211B;
    --text-muted: #7A6A5B;
    --accent: #A9814A;
    --accent-deep: #6B4A2B;
    --border: #E4D6BF;
    --shadow: rgba(42,33,27,0.08);
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg: #1C1712;
      --surface: #241E17;
      --surface-alt: #2E261C;
      --text: #F2E9DC;
      --text-muted: #B6A48D;
      --accent: #C6A366;
      --accent-deep: #E3C48C;
      --border: #3C3225;
      --shadow: rgba(0,0,0,0.35);
    }
  }
  :root[data-theme="dark"]{
    --bg: #1C1712;
    --surface: #241E17;
    --surface-alt: #2E261C;
    --text: #F2E9DC;
    --text-muted: #B6A48D;
    --accent: #C6A366;
    --accent-deep: #E3C48C;
    --border: #3C3225;
    --shadow: rgba(0,0,0,0.35);
  }

  *{box-sizing:border-box;}
  html{scroll-behavior:smooth; scroll-padding-top:96px;}
  body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:'Tajawal', sans-serif;
    line-height:1.7;
    -webkit-font-smoothing:antialiased;
  }
  img{max-width:100%; display:block;}
  a{color:inherit;}
  h1,h2,h3{font-family:'Aref Ruqaa', serif; margin:0; font-weight:700;}
  .wrap{max-width:1180px; margin:0 auto; padding:0 24px;}

  /* ---------- header ---------- */
  header{
    position:sticky; top:0; z-index:40;
    background:color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter:blur(10px);
    border-bottom:1px solid var(--border);
  }
  .header-top{
    display:flex; align-items:center; justify-content:space-between;
    padding:16px 24px; max-width:1180px; margin:0 auto; gap:16px;
  }
  .brand{display:flex; align-items:center; gap:10px;}
  .brand-mark{
    width:42px; height:42px; border-radius:50%;
    background:var(--accent-deep); color:var(--surface);
    display:flex; align-items:center; justify-content:center;
    font-family:'Aref Ruqaa', serif; font-size:20px; flex:none;
  }
  .brand-name{font-size:24px; color:var(--text); line-height:1;}
  .brand-tagline{font-size:12px; color:var(--text-muted); margin-top:2px;}

  .header-actions{display:flex; align-items:center; gap:10px;}
  .icon-btn{
    width:40px; height:40px; border-radius:50%;
    border:1px solid var(--border); background:var(--surface);
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; color:var(--text); flex:none;
  }
  .icon-btn svg{width:20px; height:20px; flex:none;}
  .contact-btn{
    display:flex; align-items:center; gap:8px;
    border:1px solid var(--border); background:var(--surface);
    color:var(--text-muted); padding:9px 16px; border-radius:24px;
    font-size:13px; cursor:default; white-space:nowrap;
  }
  .contact-btn svg{width:16px; height:16px; flex:none;}

  .share-wrap{position:relative;}
  .share-popover{
    position:absolute; top:calc(100% + 10px); inset-inline-end:0;
    background:var(--surface); border:1px solid var(--border);
    border-radius:14px; box-shadow:0 10px 30px var(--shadow);
    min-width:200px; padding:8px; display:none; flex-direction:column; gap:2px;
    z-index:60;
  }
  .share-popover.open{display:flex;}
  .share-option{
    display:flex; align-items:center; gap:10px; width:100%;
    background:none; border:none; text-decoration:none;
    color:var(--text); font-family:'Tajawal',sans-serif; font-size:13.5px;
    padding:10px 12px; border-radius:9px; cursor:pointer; text-align:right;
  }
  .share-option:hover{background:var(--surface-alt);}
  .share-option svg{width:17px; height:17px; color:var(--accent-deep); flex:none;}

  .toast{
    position:fixed; bottom:80px; left:50%; transform:translateX(-50%) translateY(20px);
    background:var(--accent-deep); color:var(--surface);
    padding:11px 22px; border-radius:24px; font-size:13.5px;
    opacity:0; pointer-events:none; transition:opacity .25s ease, transform .25s ease;
    z-index:120; white-space:nowrap;
  }
  .toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

  .search-row{
    max-width:1180px; margin:0 auto; padding:0 24px 14px;
    display:none;
  }
  .search-row.open{display:block;}
  .search-box{
    display:flex; align-items:center; gap:10px;
    background:var(--surface); border:1px solid var(--border);
    border-radius:12px; padding:10px 14px;
  }
  .search-box svg{width:18px; height:18px; color:var(--text-muted); flex:none;}
  .search-box input{
    border:none; outline:none; background:transparent; color:var(--text);
    font-family:'Tajawal', sans-serif; font-size:15px; width:100%;
  }
  .search-box input::placeholder{color:var(--text-muted);}

  nav.catnav{
    border-top:1px solid var(--border);
    overflow-x:auto; white-space:nowrap;
    scrollbar-width:none;
  }
  nav.catnav::-webkit-scrollbar{display:none;}
  nav.catnav .wrap{display:flex; gap:8px; padding:10px 24px;}
  nav.catnav a{
    flex:none; font-size:13px; color:var(--text-muted);
    text-decoration:none; padding:7px 14px; border-radius:20px;
    border:1px solid transparent;
  }
  nav.catnav a:hover, nav.catnav a:focus-visible{
    border-color:var(--border); color:var(--text); background:var(--surface);
  }
  nav.catnav a.home{color:var(--accent-deep); font-weight:700;}

  /* ---------- hero ---------- */
  .hero{
    position:relative; overflow:hidden;
    padding:72px 24px 56px;
    border-bottom:1px solid var(--border);
  }
  .hero-pattern{
    position:absolute; inset:0; opacity:.35; pointer-events:none;
    mask-image:linear-gradient(to bottom, black, transparent 85%);
  }
  .hero-inner{position:relative; max-width:820px; margin:0 auto; text-align:center;}
  .hero h1{
    font-size:clamp(34px, 6vw, 58px);
    color:var(--text); margin-bottom:18px;
  }
  .hero p{
    font-size:clamp(16px, 2.4vw, 19px);
    color:var(--text-muted); max-width:520px; margin:0 auto 30px;
  }
  .hero-cta{
    display:inline-flex; align-items:center; gap:10px;
    background:var(--accent-deep); color:var(--surface);
    padding:14px 30px; border-radius:30px; text-decoration:none;
    font-size:15px; font-weight:700; border:none; cursor:pointer;
  }
  .hero-cta svg{width:18px; height:18px;}

  /* ---------- categories ---------- */
  .section-heading{
    text-align:center; max-width:560px; margin:0 auto 40px;
  }
  .section-heading h2{font-size:clamp(26px,4vw,36px); margin-bottom:10px;}
  .section-heading p{color:var(--text-muted); font-size:15px; margin:0;}
  .categories{padding:72px 24px 20px;}
  .cat-grid{
    display:grid; grid-template-columns:repeat(4, 1fr); gap:16px;
  }
  .cat-card{
    background:var(--surface); border:1px solid var(--border);
    border-radius:16px; padding:26px 14px; text-align:center;
    text-decoration:none; color:var(--text);
    transition:transform .18s ease, border-color .18s ease;
  }
  .cat-card:hover, .cat-card:focus-visible{
    transform:translateY(-4px); border-color:var(--accent);
  }
  .cat-card svg{width:34px; height:34px; color:var(--accent-deep); margin:0 auto 14px;}
  .cat-card span{display:block; font-size:14.5px; font-weight:700;}

  /* ---------- product sections ---------- */
  .cat-section{padding:64px 24px; border-top:1px solid var(--border);}
  .cat-section.alt{background:var(--surface-alt);}
  .cat-section-head{
    display:flex; align-items:center; gap:14px; margin-bottom:34px;
    max-width:1180px; margin-inline:auto;
  }
  .cat-section-head .cat-icon{
    width:48px; height:48px; border-radius:50%; background:var(--surface);
    border:1px solid var(--border); display:flex; align-items:center; justify-content:center; flex:none;
  }
  .cat-section-head svg{width:24px; height:24px; color:var(--accent-deep);}
  .cat-section-head h2{font-size:26px;}
  .cat-count{font-size:13px; color:var(--text-muted); margin-inline-start:auto;}

  .product-grid{
    max-width:1180px; margin:0 auto;
    display:grid; grid-template-columns:repeat(3, 1fr); gap:20px;
  }
  .product-card{
    background:var(--surface); border:1px solid var(--border);
    border-radius:14px; overflow:hidden; cursor:pointer;
  }
  .product-card .thumb{
    aspect-ratio:4/3; background:var(--surface-alt);
    display:flex; align-items:center; justify-content:center;
    overflow:hidden;
  }
  .product-card .thumb img{width:100%; height:100%; object-fit:cover;}
  .product-card .info{padding:14px 16px 18px;}
  .product-card .info h3{font-family:'Tajawal',sans-serif; font-size:15.5px; font-weight:700; margin-bottom:4px;}
  .product-card .info p{font-size:13px; color:var(--text-muted); margin:0 0 8px;}
  .product-card .price{font-size:14px; color:var(--accent-deep); font-weight:700;}

  .empty-card{
    grid-column:1 / -1;
    display:flex; flex-direction:column; align-items:center; gap:10px;
    padding:48px 20px; color:var(--text-muted); text-align:center;
    border:1px dashed var(--border); border-radius:14px;
  }
  .empty-card svg{width:32px; height:32px; color:var(--accent);}
  .empty-card strong{color:var(--text); font-weight:700; font-size:15px;}

  .no-results{
    text-align:center; padding:60px 20px; color:var(--text-muted);
  }

  /* ---------- lightbox ---------- */
  .lightbox{
    position:fixed; inset:0; background:rgba(20,15,10,.86);
    display:none; align-items:center; justify-content:center;
    z-index:100; padding:24px;
  }
  .lightbox.open{display:flex;}
  .lightbox img{max-width:min(90vw, 900px); max-height:85vh; border-radius:10px;}
  .lightbox-close{
    position:absolute; top:20px; left:20px;
    width:42px; height:42px; border-radius:50%;
    background:rgba(255,255,255,.12); border:none; color:#fff;
    font-size:20px; cursor:pointer;
  }

  /* ---------- back to top ---------- */
  .to-top{
    position:fixed; bottom:22px; inset-inline-end:22px; z-index:40;
    width:46px; height:46px; border-radius:50%;
    background:var(--accent-deep); color:var(--surface);
    border:none; display:none; align-items:center; justify-content:center;
    box-shadow:0 6px 18px var(--shadow); cursor:pointer;
  }
  .to-top.show{display:flex;}
  .to-top svg{width:20px; height:20px;}

  /* ---------- footer ---------- */
  footer{
    background:var(--accent-deep); color:var(--surface);
    padding:48px 24px 26px; margin-top:0;
  }
  .footer-inner{max-width:1180px; margin:0 auto; text-align:center;}
  footer h2{font-size:26px; margin-bottom:10px; color:var(--surface);}
  footer p.note{font-size:13.5px; opacity:.8; margin:0 0 22px;}
  .footer-links{display:flex; justify-content:center; gap:14px; margin-bottom:26px;}
  .footer-links a, .footer-links span{
    width:40px; height:40px; border-radius:50%;
    border:1px solid rgba(255,255,255,.3);
    display:flex; align-items:center; justify-content:center;
    opacity:.55;
  }
  .footer-links svg{width:18px; height:18px;}
  footer .copyright{font-size:12.5px; opacity:.7; border-top:1px solid rgba(255,255,255,.18); padding-top:20px;}

  @media (max-width:860px){
    .cat-grid{grid-template-columns:repeat(2,1fr);}
    .product-grid{grid-template-columns:repeat(2,1fr);}
  }
  @media (max-width:560px){
    .brand-name{font-size:20px;}
    .brand-tagline{display:none;}
    .contact-btn span{display:none;}
    .contact-btn{padding:9px 12px;}
    .hero{padding:52px 18px 40px;}
    .categories{padding:52px 18px 10px;}
    .cat-section{padding:46px 18px;}
    .product-grid{grid-template-columns:repeat(2,1fr); gap:14px;}
  }
  @media (prefers-reduced-motion: reduce){
    html{scroll-behavior:auto;}
    .cat-card{transition:none;}
  }