:root {
  --pink: #ef5d86;
  --pink-dark: #d94370;
  --pink-soft: #fff0f4;
  --blue: #55a8d2;
  --blue-dark: #2f86b2;
  --blue-soft: #eff9fd;
  --cream: #fffdfa;
  --ink: #25313a;
  --muted: #6c7881;
  --line: #e7e9eb;
  --white: #ffffff;
  --shadow: 0 12px 32px rgba(37,49,58,.09);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Tahoma, sans-serif;
  background: var(--cream);
  color: var(--ink);
  direction: rtl;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.container { width: min(1140px, calc(100% - 28px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,253,250,.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231,233,235,.85);
}
.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-mini { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mini img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 50%; border: 2px solid var(--pink-soft); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 0;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-dark); }
.btn-secondary { background: var(--blue-soft); color: var(--blue-dark); border: 1px solid #cfeaf6; }
.btn-outline { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: #fff1f1; color: #b52828; border: 1px solid #ffd0d0; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.hero { padding: 54px 0 28px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 34px; align-items: center; }
.hero-card {
  padding: 34px;
  border-radius: 34px;
  background: linear-gradient(135deg, var(--pink-soft), var(--blue-soft));
  border: 1px solid #f0e7ea;
  box-shadow: var(--shadow);
}
.eyebrow { color: var(--blue-dark); font-weight: 800; margin-bottom: 8px; }
h1 { font-size: clamp(38px, 7vw, 72px); line-height: .98; margin: 0; color: var(--pink); letter-spacing: -1px; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.8; max-width: 650px; }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-logo-wrap { display: grid; place-items: center; }
.hero-logo {
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  border: 10px solid #fff;
}

.section { padding: 26px 0 46px; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 30px; }
.section-head p { margin: 6px 0 0; color: var(--muted); }

.categories { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.category-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 700;
}
.category-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.shop-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 24px; align-items: start; }
.products-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(37,49,58,.05);
  display: flex;
  flex-direction: column;
}
.product-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f7f7f7; }
.product-placeholder { width: 100%; aspect-ratio: 4/3; display: grid; place-items: center; font-size: 54px; background: linear-gradient(135deg,var(--pink-soft),var(--blue-soft)); }
.product-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.product-category { font-size: 13px; color: var(--blue-dark); font-weight: 800; }
.product-card h3 { margin: 7px 0 4px; font-size: 19px; }
.product-desc { color: var(--muted); line-height: 1.6; font-size: 14px; flex: 1; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.price { font-weight: 900; color: var(--pink-dark); font-size: 19px; }

.cart {
  position: sticky;
  top: 94px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.cart h3 { margin: 0 0 12px; }
.cart-empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cart-item strong { display: block; }
.cart-item small { color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.cart-total { display: flex; justify-content: space-between; font-size: 19px; font-weight: 900; padding: 16px 0 10px; }
.order-fields { display: grid; gap: 10px; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  min-height: 44px;
  outline: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.empty-state, .notice {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.demo-badge { display: inline-block; margin-bottom: 10px; padding: 6px 10px; border-radius: 999px; background: #fff4d9; color: #7b5d11; font-size: 13px; font-weight: 800; }

.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Admin */
.admin-shell { min-height: 100vh; background: linear-gradient(135deg,#fffafa,#f5fbfe); padding: 26px 0 50px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand img { width: 56px; height: 56px; border-radius: 50%; object-fit: contain; background: #fff; }
.admin-grid { display: grid; grid-template-columns: 380px minmax(0,1fr); gap: 22px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 10px 28px rgba(37,49,58,.06); }
.panel h2, .panel h3 { margin-top: 0; }
.login-card { max-width: 440px; margin: 60px auto; }
.stack { display: grid; gap: 12px; }
.product-admin-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.product-admin-row img, .admin-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 14px; background: #f7f7f7; }
.admin-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; }
.small-btn { border: 1px solid var(--line); background: #fff; min-height: 38px; padding: 8px 10px; border-radius: 10px; font-weight: 700; }
.small-btn.edit { color: var(--blue-dark); }
.small-btn.delete { color: #b52828; }
.switch-line { display: flex; align-items: center; gap: 9px; }
.muted { color: var(--muted); }
.status { padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.status.ok { background: #eefaf1; color: #26753b; }
.status.err { background: #fff1f1; color: #a42626; }
.status.info { background: var(--blue-soft); color: var(--blue-dark); }
.hidden { display: none !important; }

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.admin-user-row:last-child { border-bottom: 0; }
.admin-user-row .email { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .hero-grid, .shop-layout, .admin-grid { grid-template-columns: 1fr; }
  .hero-logo-wrap { order: -1; }
  .hero-logo { width: 260px; }
  .cart { position: static; }
  .products-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .container { width: min(100% - 20px, 1140px); }
  .header-inner { min-height: 66px; }
  .brand-mini span { display: none; }
  .hero { padding-top: 24px; }
  .hero-card { padding: 22px; border-radius: 26px; }
  .hero-logo { width: 210px; }
  .products-grid { grid-template-columns: 1fr; }
  .section-head { display: block; }
  .product-admin-row { grid-template-columns: 58px 1fr; }
  .product-admin-row img, .admin-thumb { width: 58px; height: 58px; }
  .admin-actions { grid-column: 1 / -1; justify-content: stretch; }
  .admin-actions .small-btn { flex: 1; }
  .header-actions .btn { padding-inline: 12px; }
}

/* Final mobile + social refinements */
.mobile-cart-shortcut {
  display: none;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-link {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.social-link:hover { transform: translateY(-2px); }
.social-link svg { width: 22px; height: 22px; }
.social-link.whatsapp { color: #128c4a; }
.social-link.instagram { color: var(--pink-dark); }
.social-link.facebook { color: #1877f2; }

@media (max-width: 980px) {
  .shop-layout {
    display: flex;
    flex-direction: column;
  }
  .cart {
    order: -1;
    width: 100%;
    position: static;
    scroll-margin-top: 130px;
  }
  .products-grid { width: 100%; }
  .mobile-cart-shortcut {
    position: sticky;
    top: 74px;
    z-index: 24;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid #ffd5e1;
    border-radius: 16px;
    background: rgba(255,255,255,.96);
    color: var(--pink-dark);
    font-weight: 900;
    box-shadow: 0 8px 24px rgba(37,49,58,.08);
    backdrop-filter: blur(12px);
  }
  .mobile-cart-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
  }
}

@media (max-width: 620px) {
  .header-inner { gap: 8px; }
  .brand-mini { flex: 0 0 auto; }
  .brand-mini img { width: 42px; height: 42px; }
  .header-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .header-actions .btn {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .mobile-cart-shortcut { top: 66px; }
  .footer-inner { align-items: center; }
  .footer-socials { width: 100%; justify-content: center; padding-top: 4px; }
}

/* ===== Mobile cart drawer ===== */

.mobile-cart-close {
  display: none;
}

@media (max-width: 620px) {

  .mobile-cart-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    min-height: 44px;
    padding: 9px 12px;
    border-radius: 14px;
    font-weight: 700;
  }

  .mobile-cart-meta {
    font-size: 12px;
    color: var(--muted);
  }

  #cartPanel {
    position: fixed;
    z-index: 100;
    top: 78px;
    right: 10px;
    left: 10px;

    max-height: calc(100vh - 95px);
    overflow-y: auto;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    pointer-events: none;

    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s ease;

    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  }

  #cartPanel.mobile-cart-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .mobile-cart-close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    margin-right: auto;
    margin-bottom: 8px;

    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);

    font-size: 20px;
    font-weight: 700;
  }

  body.cart-open {
    overflow: hidden;
  }
}