/* ==========================================================
 * DDE Modern — storefront.css v4.0  (2026-05-16)
 * Full store frontend layout — Indigo / Gold palette
 * ========================================================== */

/* ── Reset ── */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  font-family: 'Cairo','IBM Plex Sans Arabic',Tajawal,sans-serif;
  display: flex; flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { font-weight: 700; line-height: 1.35; margin: 0 0 8px; }
input,select,textarea,button { font-family: inherit; }

/* ── Dark Theme Variables ── */
:root[data-theme='dark'],
:root:not([data-theme='light']) {
  --sf-bg:        #09091f;
  --sf-bg2:       #0b0b26;
  --sf-surface:   #0f1030;
  --sf-surface2:  #141540;
  --sf-border:    rgba(99,102,241,.20);
  --sf-text:      #e2e8f0;
  --sf-text2:     #94a3b8;
  --sf-primary:   #6366f1;
  --sf-primary-l: #818cf8;
  --sf-gold:      #f59e0b;
  --sf-gold-l:    #fbbf24;
  --sf-shadow:    0 4px 20px rgba(0,0,0,.40);
  --sf-header-bg: rgba(9,9,31,.82);
}

/* ── Light Theme Variables ── */
:root[data-theme='light'] {
  --sf-bg:        #f5f5ff;
  --sf-bg2:       #eeeeff;
  --sf-surface:   #ffffff;
  --sf-surface2:  #f0f0ff;
  --sf-border:    rgba(99,102,241,.18);
  --sf-text:      #1e1b4b;
  --sf-text2:     #4338ca;
  --sf-primary:   #4f46e5;
  --sf-primary-l: #6366f1;
  --sf-gold:      #d97706;
  --sf-gold-l:    #f59e0b;
  --sf-shadow:    0 4px 20px rgba(99,102,241,.12);
  --sf-header-bg: rgba(245,245,255,.92);
}

/* ── Page background ── */
body {
  background:
    radial-gradient(900px 400px at 100% 0%, rgba(99,102,241,.10), transparent 55%),
    radial-gradient(700px 300px at 0% 100%, rgba(245,158,11,.07), transparent 50%),
    var(--sf-bg);
  color: var(--sf-text);
}

/* ── Container ── */
.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

/* ════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--sf-header-bg);
  border-bottom: 1px solid var(--sf-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: var(--sf-shadow);
}

/* ── Top row (logo + buttons + search) ── */
.top {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 8px;
  padding: 10px 0;
  min-height: 60px;
}

/* ── Logo ── */
.logo {
  display: flex; align-items: center;
  gap: 10px; flex-shrink: 0;
  color: var(--sf-text); text-decoration: none;
}
.logo img {
  height: 44px; width: auto; max-width: 120px;
  object-fit: contain; border-radius: 8px;
  display: block;
}
.logo span {
  font-size: 16px; font-weight: 800;
  color: var(--sf-text); white-space: nowrap;
}

/* ── Auth / action buttons ── */
.btn-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--sf-border);
  background: transparent; color: var(--sf-text2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .18s, border-color .18s, color .18s;
}
.btn-chip:hover {
  background: rgba(99,102,241,.12);
  border-color: var(--sf-primary);
  color: var(--sf-primary-l);
}

/* ── Search form ── */
.search {
  display: flex; gap: 6px;
  flex: 1; max-width: 300px;
}
.search input[type="text"] {
  flex: 1; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--sf-border);
  background: var(--sf-surface); color: var(--sf-text);
  font-size: 13px; outline: none;
  transition: border-color .18s;
}
.search input[type="text"]:focus {
  border-color: var(--sf-primary);
}
.search button {
  padding: 7px 16px; border-radius: 999px;
  border: none; cursor: pointer;
  background: var(--sf-primary); color: #fff;
  font-size: 13px; font-weight: 700;
  transition: opacity .18s;
}
.search button:hover { opacity: .85; }

/* ── Navbar links ── */
.nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 0;
  border-top: 1px solid var(--sf-border);
}
.nav a {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid transparent;
  color: var(--sf-text2); font-size: 13px; font-weight: 600;
  white-space: nowrap;
  transition: all .18s ease;
}
.nav a:hover, .nav a.active {
  background: rgba(99,102,241,.12);
  border-color: rgba(99,102,241,.25);
  color: var(--sf-primary-l);
}

/* ════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════ */
main { flex: 1; padding: 20px 0 40px; }

/* ── Filter bar ── */
form[method="get"] label {
  display: flex; flex-direction: column;
  gap: 4px; font-size: 12px; color: var(--sf-text2);
  font-weight: 600;
}
form[method="get"] input[type="number"],
form[method="get"] select {
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--sf-border);
  background: var(--sf-surface); color: var(--sf-text);
  font-size: 13px;
}
form[method="get"] input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--sf-primary);
}
.btn,
form[method="get"] button[type="submit"] {
  padding: 8px 18px; border-radius: 999px;
  border: none; cursor: pointer;
  background: var(--sf-primary); color: #fff;
  font-size: 13px; font-weight: 700; font-family: inherit;
  transition: opacity .18s;
}
.btn:hover,
form[method="get"] button[type="submit"]:hover { opacity: .85; }

/* ── Product grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

/* ── Product card ── */
.card {
  background: var(--sf-surface);
  border: 1px solid var(--sf-border);
  border-radius: 16px; overflow: hidden;
  box-shadow: var(--sf-shadow);
  position: relative;
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(99,102,241,.22);
  border-color: rgba(99,102,241,.35);
}

/* Product image — fixed height, covers area */
.card > a > img,
.card > a img {
  width: 100% !important;
  height: 180px !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 0 !important;
  display: block;
  transition: transform .3s ease;
}
.card:hover > a > img,
.card:hover > a img {
  transform: scale(1.04);
}

/* Product info block */
.p {
  padding: 10px 12px 12px;
}
.p > div:first-child {
  font-size: 13px; font-weight: 700;
  color: var(--sf-text);
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.price { display: flex; align-items: baseline; gap: 6px; }
.amount {
  font-size: 15px; font-weight: 800;
  color: var(--sf-gold-l);
}

/* ── Cart overlay buttons ── */
.cart-btn, .inline-remove {
  position: absolute; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  backdrop-filter: blur(6px);
  transition: transform .15s;
}
.cart-btn {
  bottom: 48px; left: 10px;
  background: rgba(99,102,241,.75);
  color: #fff;
}
[dir="rtl"] .cart-btn { bottom: 48px; left: auto; right: 10px; }
.inline-remove {
  top: 8px; right: 8px;
  background: rgba(239,68,68,.75);
  color: #fff;
}
[dir="rtl"] .inline-remove { top: 8px; right: auto; left: 8px; }
.cart-btn:hover, .inline-remove:hover { transform: scale(1.12); }

/* ── Outer card wrapper (storefront.php old style) ── */
.row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px; margin-top: 14px;
}
.col { display: flex; flex-direction: column; }

/* Fix inline-style images from old storefront.php */
.card img[style*="max-width:100%"],
.card img[style*="max-width: 100%"] {
  width: 100% !important;
  height: 180px !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}

/* ── General form inputs ── */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
select, textarea {
  background: var(--sf-surface);
  color: var(--sf-text);
  border: 1px solid var(--sf-border);
  border-radius: 8px; padding: 7px 12px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sf-primary);
}

/* ════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════ */
.footer {
  background: var(--sf-surface);
  border-top: 1px solid var(--sf-border);
  padding: 24px 0;
  font-size: 13px; color: var(--sf-text2);
  text-align: center;
}
.footer .lines { line-height: 2; }
.footer a { color: var(--sf-primary-l); }
.footer a:hover { color: var(--sf-gold-l); }

/* ════════════════════════════════════════════
   LOGO BADGE — fix SVG display
   ════════════════════════════════════════════ */
.logo-badge, .logo-dde, .logo-diamond {
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
  border: none !important;
}
.logo-diamond::after { display: none !important; }

/* ════════════════════════════════════════════
   LIGHT MODE OVERRIDES
   ════════════════════════════════════════════ */
:root[data-theme='light'] .card {
  background: #fff;
  border-color: rgba(99,102,241,.15);
  box-shadow: 0 2px 12px rgba(99,102,241,.08);
}
:root[data-theme='light'] .nav a:hover,
:root[data-theme='light'] .nav a.active {
  background: rgba(79,70,229,.10);
}
:root[data-theme='light'] .btn-chip:hover {
  background: rgba(79,70,229,.10);
}
:root[data-theme='light'] input[type="text"],
:root[data-theme='light'] input[type="number"],
:root[data-theme='light'] select {
  background: #fff;
  border-color: rgba(99,102,241,.25);
  color: #1e1b4b;
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 600px) {
  .top { gap: 6px; }
  .search { max-width: 100%; flex: 1 1 100%; order: 3; }
  .grid, .row {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .card > a > img,
  .card img[style*="max-width:100%"] {
    height: 140px !important;
  }
  .nav { gap: 2px; }
  .nav a { padding: 5px 10px; font-size: 12px; }
}

/* ════════════════════════════════════════════
   FLOATING CART BUTTON
   ════════════════════════════════════════════ */
.cart-floating {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--brand-primary, #065f46);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,.28);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  user-select: none;
  transition: transform .15s, box-shadow .15s;
}
.cart-floating:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.cart-floating .badge {
  background: #fff;
  color: var(--brand-primary, #065f46);
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

