:root {
  --bg: #fff7f3;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #fffdfb;
  --ink: #2a1d24;
  --muted: #735d66;
  --accent: #b21f45;
  --accent-strong: #7b1730;
  --rose-soft: #f7d7dc;
  --champagne: #f3c978;
  --sage: #597467;
  --line: rgba(88, 45, 59, 0.14);
  --shadow: 0 22px 58px rgba(74, 29, 44, 0.15);
  --radius-lg: 22px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(255, 247, 243, 0.94), rgba(247, 215, 220, 0.7)),
    url("https://images.unsplash.com/photo-1515372039744-b8f02a3ae446?auto=format&fit=crop&w=1600&q=80") center top / cover fixed;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
img { max-width: 100%; }

.page-shell { width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 56px; }
.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand strong, .hero h1, .section-heading h2, .modal-header h2, .auth-card h1, h3, .product-detail-content h2 {
  font-family: "Cormorant Garamond", serif;
}
.brand strong { display: block; font-size: 1.35rem; line-height: 1; }
.brand small, .hero-text, .product-description, .admin-item p, .error-text, .section-note { color: var(--muted); }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(178, 31, 69, 0.28);
}
.brand-mark-image {
  overflow: hidden;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
}
.brand-mark-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}
.topbar-actions, .hero-actions, .inline-actions, .admin-item-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-section-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 4px;
}
.admin-kpi-grid, .admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.admin-kpi-card, .admin-quick-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(88, 45, 59, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(74, 29, 44, 0.06);
}
.admin-kpi-card strong {
  display: block;
  font-size: 2rem;
  margin: 6px 0 8px;
}
.admin-kpi-card p, .admin-quick-card p { margin: 0; color: var(--muted); }
.admin-quick-card strong { display: block; margin-bottom: 8px; }
.single-layout { grid-template-columns: 1fr; }
.table-shell {
  overflow: auto;
  border: 1px solid rgba(88, 45, 59, 0.08);
  border-radius: 18px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}
.admin-table th, .admin-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(88, 45, 59, 0.08);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
}
.admin-table td p, .table-muted {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}
.admin-table-thumb {
  width: 78px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(88, 45, 59, 0.1);
  display: block;
}
.admin-table-thumb-empty {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-size: 0.8rem;
}
.table-search {
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(88, 45, 59, 0.14);
  background: rgba(255,255,255,0.82);
}
.admin-modal-card {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: var(--radius-lg);
}
.admin-cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.admin-cover-option {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(88, 45, 59, 0.12);
  background: rgba(255,255,255,0.82);
}
.admin-cover-option input {
  width: auto;
  margin: 0;
}
.admin-photo-choice {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(88, 45, 59, 0.1);
  background: rgba(255,255,255,0.62);
}
.pagination-wrap {
  margin-top: 22px;
}

.ghost-button, .secondary-button, .primary-button, .cart-button, .text-button, .icon-button, .small-button {
  border-radius: 999px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.ghost-button, .secondary-button, .text-button {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--ink);
}
.primary-button, .cart-button {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 14px 26px rgba(178, 31, 69, 0.26);
}
.ghost-button, .secondary-button, .primary-button, .cart-button, .text-button { padding: 11px 16px; }
.small-button { padding: 8px 12px; background: rgba(178, 31, 69, 0.1); color: var(--accent-strong); }
.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.25rem;
}
.primary-button:hover, .cart-button:hover, .ghost-button:hover, .secondary-button:hover, .text-button:hover, .small-button:hover {
  transform: translateY(-1px);
}
.full-width { width: 100%; justify-content: center; text-align: center; display: inline-flex; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(300px, 0.98fr);
  gap: 24px;
  padding: 34px 0 26px;
  align-items: stretch;
}
.hero-copy, .catalog-section, .auth-card {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-copy {
  display: grid;
  align-content: center;
  min-height: 520px;
  padding: clamp(24px, 5vw, 54px);
}
.hero-photo {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(42, 29, 36, 0.06), rgba(42, 29, 36, 0.26));
}
.hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.92;
}
.hero-text {
  max-width: 680px;
  margin: 18px 0 24px;
  font-size: 1.03rem;
}
.catalog-section {
  padding: clamp(20px, 4vw, 34px);
  margin-top: 18px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}
.section-heading h2, .modal-header h2 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 3.35rem);
  line-height: 0.96;
}
.section-note { max-width: 300px; text-align: right; font-size: 0.94rem; }

.category-filter {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 10px;
  overflow: auto;
  padding-bottom: 6px;
  margin-bottom: 20px;
}
.filter-chip {
  padding: 11px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  color: var(--ink);
}
.filter-chip.active {
  color: #fff;
  background: linear-gradient(140deg, var(--sage), #314c41);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.product-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: 0 14px 32px rgba(74, 29, 44, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.product-card:hover, .product-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(74, 29, 44, 0.16);
  outline: none;
}
.product-image {
  position: relative;
  aspect-ratio: 4 / 4.7;
  background: linear-gradient(180deg, var(--rose-soft), #fff7f3);
}
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.93);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}
.product-content { padding: 16px; }
.product-content h3 { margin: 0 0 8px; font-size: 1.55rem; line-height: 1; }
.product-description {
  min-height: 48px;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta, .cart-item-header, .cart-total-row, .admin-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.product-meta .primary-button { flex: 0 0 auto; }
.price { color: var(--accent-strong); font-size: 1.18rem; font-weight: 900; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  background: rgba(42, 29, 36, 0.5);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease;
}
.modal.visible { opacity: 1; pointer-events: auto; }
.modal-card, .drawer {
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  background: rgba(255, 253, 251, 0.98);
}
.product-detail-card {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.product-detail-media {
  position: relative;
  min-height: 620px;
  background: #2a1d24;
}
.product-detail-media img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  display: block;
  object-fit: cover;
}
.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 54px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.86);
  color: var(--accent-strong);
  font-size: 2rem;
}
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.product-detail-content {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(24px, 4vw, 42px);
}
.product-detail-content h2 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 0.93; }
.product-detail-content p { margin: 0; color: var(--muted); }
.detail-price { color: var(--accent-strong); font-size: 1.8rem; }
.carousel-dots { display: flex; flex-wrap: wrap; gap: 8px; }
.carousel-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  background: rgba(123, 23, 48, 0.24);
}
.carousel-dots button.active { width: 28px; background: var(--accent-strong); }

.drawer {
  position: fixed;
  inset: 16px 16px 16px auto;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.drawer.visible { opacity: 1; pointer-events: auto; transform: translateX(0); }
.drawer-header, .drawer-footer, .modal-header {
  padding: 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.drawer-footer { border-top: 1px solid var(--line); border-bottom: 0; }
.drawer-body { overflow: auto; padding: 0 22px 22px; }
.cart-item, .checkout-item, .admin-item {
  display: grid;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(88, 45, 59, 0.09);
}
.cart-item-actions { display: flex; gap: 10px; align-items: center; }

.admin-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.admin-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}
.stack-form, .checkout-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full-span { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 0.94rem; }
input, select, textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(88, 45, 59, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}
.checkbox-label {
  align-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(88, 45, 59, 0.16);
  background: rgba(255, 255, 255, 0.92);
}
.checkbox-label input { width: auto; }
.payment-box, .empty-state, .flash-message {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(88, 45, 59, 0.12);
}
.admin-photo-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.admin-photo-thumb {
  width: 88px;
  height: 108px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(88, 45, 59, 0.14);
  background: rgba(255, 255, 255, 0.82);
}
.order-items-summary {
  display: grid;
  gap: 8px;
  margin: 6px 0 2px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(88, 45, 59, 0.1);
}
.order-item-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.storefront-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.storefront-preview-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(88, 45, 59, 0.1);
}
.storefront-preview-logo {
  width: 96px;
  height: 96px;
  object-fit: fill;
  border-radius: 18px;
  border: 1px solid rgba(88, 45, 59, 0.14);
  background: rgba(255, 255, 255, 0.92);
}
.storefront-preview-hero {
  width: 100%;
  height: 220px;
  object-fit: fill;
  border-radius: 18px;
  border: 1px solid rgba(88, 45, 59, 0.14);
  background: rgba(255, 255, 255, 0.92);
}
.storefront-preview-fallback {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
}

.auth-shell { display: grid; place-items: center; min-height: 100vh; }
.auth-card { width: min(460px, 100%); padding: 30px; }
.error-text { margin: 0; color: #a32a4e; }
.flash-message {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 100;
  max-width: min(92vw, 720px);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  background: rgba(42, 29, 36, 0.94);
  transform: translateX(-50%);
}
.flash-error { background: rgba(163, 42, 78, 0.96); }
.flash-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
}
.hidden-by-filter { display: none; }

@media (max-width: 980px) {
  .hero, .admin-layout, .product-detail-card { grid-template-columns: 1fr; }
  .admin-kpi-grid, .admin-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-copy { min-height: 420px; }
  .hero-photo { min-height: 420px; }
  .product-detail-media, .product-detail-media img { min-height: 480px; }
}
@media (max-width: 720px) {
  .page-shell { width: min(100% - 20px, 100%); padding-top: 10px; }
  .topbar, .section-heading { display: grid; border-radius: var(--radius-lg); }
  .topbar-actions { width: 100%; }
  .topbar-actions > * { flex: 1 1 auto; text-align: center; }
  .admin-kpi-grid, .admin-quick-grid { grid-template-columns: 1fr; }
  .table-search { min-width: 100%; }
  .hero { padding-top: 18px; }
  .hero-copy { min-height: auto; }
  .hero-photo { min-height: 360px; }
  .section-note { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .storefront-preview-grid { grid-template-columns: 1fr; }
  .product-detail-card { max-height: calc(100vh - 20px); overflow: auto; }
  .product-detail-media, .product-detail-media img { min-height: 360px; }
  .modal { padding: 10px; }
  .drawer { inset: auto 10px 10px 10px; width: auto; max-height: calc(100vh - 20px); }
  .flash-message { width: calc(100vw - 20px); }
}
