/* DUKAAN — storefront styles */

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.site-header .ribbon { display: none; }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: color-mix(in srgb, var(--paper) 80%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}
.brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; margin-inline-end: auto; }
.site-header .bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  max-width: 1080px;
  margin: 0 auto;
}
.brand { min-width: 0; }
.brand .name { font-size: 21px; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ur .brand .name { font-size: 24px; }
.brand .tagline { font-size: 12.5px; color: var(--muted); margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--glass-edge);
  color: var(--inverse-fg);
  background:
    radial-gradient(130% 70% at 50% 0%, rgba(255, 255, 255, .14), transparent 62%),
    var(--inverse-bg);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  min-height: 42px;
  transition: transform .12s ease, filter .15s ease;
}
.cart-btn:hover { filter: brightness(1.08); }
.cart-btn:active { transform: scale(.97); }
.cart-btn svg { width: 19px; height: 19px; }
.cart-count {
  position: absolute;
  top: -7px;
  inset-inline-end: -7px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  min-width: 21px;
  height: 21px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  padding: 0 5px;
  border: 2px solid var(--paper);
}
.cart-count.show { display: inline-flex; }

/* ---------- toolbar: search + categories ---------- */
.toolbar { max-width: 1080px; margin: 0 auto; padding: 14px 16px 4px; }
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap svg {
  position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.search-wrap input {
  width: 100%;
  border: 1.5px solid transparent;
  border-radius: 999px;
  min-height: 48px;
  padding: 10px 16px;
  padding-inline-start: 42px;
  background: var(--field-bg);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.search-wrap input:focus { border-color: var(--accent); background: var(--card); outline: none; box-shadow: 0 0 0 4px var(--accent-tint); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
/* (moved to base.css: shared component) */

/* ---------- product grid ---------- */
.grid-wrap { max-width: 1080px; margin: 0 auto; padding: 6px 16px 80px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

.product-card {
  content-visibility: auto;
  contain-intrinsic-size: 230px 300px;
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  text-align: start;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, transform .18s ease;
}
.product-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.product-card .photo img { transition: transform .35s ease; }
.product-card:hover .photo img { transform: scale(1.04); }
.product-card .photo {
  aspect-ratio: 1;
  background: var(--photo-bg);
  position: relative;
}
.product-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.product-card .photo .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.product-card .photo.dim img { opacity: .45; filter: grayscale(.4); }
.product-card .info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.product-card .p-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
body.ur .product-card .p-name { font-size: 16px; line-height: 1.9; }
.product-card .p-price { margin-top: auto; padding-top: 6px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-now { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 13.5px; }

/* ---------- product sheet ---------- */
.sheet {
  position: fixed;
  z-index: 120;
  inset-inline: 0;
  bottom: 0;
  max-height: 88vh;
  max-height: 88dvh;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.32,.72,.25,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.sheet.open { transform: translateY(0); }
@media (min-width: 760px) {
  .sheet {
    inset: 0; margin: auto;
    max-width: 780px; max-height: min(620px, 92vh);
    max-height: min(620px, 92dvh);
    border-radius: 20px;
    transform: translateY(24px);
    opacity: 0; pointer-events: none;
  }
  .sheet.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
}
.sheet-close {
  position: absolute; top: 12px; inset-inline-end: 12px;
  z-index: 2;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
}
.sheet-body { overflow-y: auto; }
@media (min-width: 760px) {
  .sheet-body { display: grid; grid-template-columns: 1fr 1fr; }
}
.sheet .photo { background: var(--photo-bg); aspect-ratio: 1; }
.sheet .photo img { width: 100%; height: 100%; object-fit: cover; }
.sheet .details { padding: 20px 20px 24px; }
.sheet .details h2 { margin: 0 0 4px; font-size: 24px; }
body.ur .sheet .details h2 { line-height: 1.8; }
.sheet .details .p-price { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 14px; }
.sheet .details .price-now { font-size: 24px; }
.sheet .details .desc { color: var(--ink-soft); white-space: pre-line; }
.sheet .details .actions { margin-top: 20px; }

/* ---------- cart drawer ---------- */
.drawer {
  position: fixed;
  z-index: 130;
  top: 0; bottom: 0;
  inset-inline-end: 0;
  width: min(430px, 100vw);
  background: var(--paper);
  transform: translateX(105%);
  transition: transform .28s cubic-bezier(.32,.72,.25,1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lift);
}
[dir="rtl"] .drawer { transform: translateX(-105%); }
.drawer.open { transform: translateX(0) !important; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.drawer-foot { background: var(--card); border-top: 1px solid var(--line); padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
}
.cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--photo-bg); }
.cart-line .n { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
body.ur .cart-line .n { line-height: 1.9; }
.cart-line .p { color: var(--ink); font-weight: 700; font-size: 14px; margin-top: 2px; }
.qty-ctl { display: flex; align-items: center; gap: 2px; }
.qty-ctl button {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 0;
  background: var(--field-bg);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  transition: background .12s ease;
}
.qty-ctl button:hover { background: var(--field-hover); }
.qty-ctl .q { min-width: 26px; text-align: center; font-weight: 700; }

.totals { margin: 4px 0 12px; }
.totals .row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-soft); }
.totals .row.grand { border-top: 1.5px dashed var(--line-strong); margin-top: 6px; padding-top: 9px; color: var(--ink); font-weight: 800; font-size: 18px; }

/* checkout panel inside drawer */
/* (moved to base.css: shared component) */

/* (moved to base.css: shared component) */

/* ---------- success ---------- */
.success { text-align: center; padding: 34px 20px 20px; }
.success .tick {
  width: 74px; height: 74px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 14px;
  animation: pop .4s cubic-bezier(.3,1.6,.5,1);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success h2 { margin: 0 0 4px; font-size: 26px; }
.success .code {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: .12em;
  color: var(--accent-deep);
  background: var(--accent-tint);
  display: inline-block;
  border-radius: 10px;
  padding: 5px 16px;
  margin: 10px 0;
}
.success .ribbon { margin: 20px -20px; }
.success .actions { display: grid; gap: 10px; margin-top: 8px; }

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 13.5px;
  padding: 26px 16px 34px;
}
.site-footer .display { color: var(--ink-soft); font-size: 15px; }

/* skeletons */
.skel { background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 45%, var(--skel-a) 65%); background-size: 200% 100%; animation: shimmer 1.1s infinite linear; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { height: 240px; }

.site-footer .admin-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px dotted var(--line-strong);
}
.site-footer .admin-link:hover { color: var(--accent); border-color: var(--accent); }

html[data-theme="dark"] .product-card,
html[data-theme="dark"] .cart-line { border: 1px solid var(--line); }
