/* ==========================================================
   YouCan custom theme: RTL, mobile-first
   Change --accent to #25D366 for a green CTA. If you do,
   set --on-accent to #1A1A1A so button text stays readable.
   ========================================================== */

:root {
  --ink: #1A1A1A;
  --paper: #FFFFFF;
  --soft: #F8F9FA;
  --line: #E6E8EB;
  --muted: #5F6670;
  --accent: #0066FF;
  --accent-dark: #0052CC;
  --on-accent: #FFFFFF;
  --sale: #D92D20;

  --radius: 10px;
  --gap: 16px;
  --container: 1180px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute;
  inset-inline-start: 8px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-sm { min-height: 38px; padding: 0 16px; }
.btn-lg { min-height: 54px; padding: 0 34px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Announcement bar ---------- */
.announcement {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  font-size: .875rem;
  padding: 8px var(--gap);
}
.announcement a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 40px; width: auto; }
.logo-text { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }

.header-actions { display: flex; align-items: center; gap: 4px; }
.header-actions summary,
.cart-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
  transition: background-color .2s ease;
}
.header-actions summary::-webkit-details-marker { display: none; }
.header-actions summary:hover,
.cart-link:hover { background: var(--soft); }

.search { position: static; }
.search-form {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  display: flex;
  gap: 8px;
  padding: 12px var(--gap);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.search-form input {
  flex: 1;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: var(--soft);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 70vh;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    linear-gradient(to left, rgba(26,26,26,.15), rgba(26,26,26,.82)),
    var(--hero-image, none);
  background-size: cover;
  background-position: center;
}
.hero-inner { padding-block: 56px; }
.hero-title {
  max-width: 16ch;
  font-size: clamp(2rem, 7vw, 3.75rem);
  line-height: 1.25;
  font-weight: 700;
}
.hero-sub {
  max-width: 46ch;
  margin-block: 16px 28px;
  font-size: 1.05rem;
  color: rgba(255,255,255,.85);
}

/* ---------- Sections ---------- */
.section { padding-block: 48px; }
.section-soft { background: var(--soft); }
.section-title {
  margin-bottom: 24px;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
}

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
.category-card { display: block; }
.category-media {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--soft);
}
.category-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.category-card:hover .category-media img { transform: scale(1.04); }
.category-name { display: block; margin-top: 10px; font-weight: 600; text-align: center; }

/* ---------- Products ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.product-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: var(--soft);
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 12px;
}
.product-title {
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: auto; }
.price-now { font-weight: 700; font-size: 1.05rem; }
.price-old { color: var(--muted); font-size: .875rem; }

.badge {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: .75rem;
  font-weight: 600;
}
.badge-sale { background: var(--sale); }

/* ---------- Trust badges ---------- */
.trust-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.trust-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.trust-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
}
.trust-title { font-size: 1rem; font-weight: 600; }
.trust-text { font-size: .875rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.8); padding-top: 48px; }
.footer-grid { display: grid; gap: 32px; }
.footer-brand { font-size: 1.25rem; font-weight: 700; color: var(--paper); margin-bottom: 8px; }
.footer-text { max-width: 42ch; font-size: .9rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a:hover { color: var(--paper); }
.footer-social { display: flex; gap: 10px; }
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: var(--paper);
  transition: background-color .2s ease, border-color .2s ease;
}
.social-icon:hover { background: var(--accent); border-color: var(--accent); }
.footer-bottom {
  margin-top: 40px;
  padding-block: 18px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: .8rem;
  text-align: center;
}

/* ---------- Tablet and up ---------- */
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .trust-grid { grid-template-columns: repeat(3, 1fr); }
  .search-form { max-width: 520px; margin-inline: auto; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .section { padding-block: 72px; }
  .category-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .hero { min-height: 78vh; }
  .footer-grid { grid-template-columns: 2fr 1fr auto; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
