:root {
  --bg: #f6efe3;
  --page: #efe3cf;
  --ink: #17130f;
  --muted: #71685d;
  --line: #e7dece;
  --gold: #b8862b;
  --gold-dark: #7a5214;
  --gold-gradient: linear-gradient(135deg, #f2d58a 0%, #b8862b 45%, #7a5214 100%);
  --panel: #fffdf8;
  --shadow: 0 24px 70px rgba(22, 16, 10, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% -8%, rgba(242, 213, 138, 0.42), transparent 34%),
    radial-gradient(circle at 100% 18%, rgba(95, 66, 28, 0.16), transparent 30%),
    linear-gradient(180deg, #f8f1e6 0%, var(--page) 48%, #f4ead9 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 12px;
  z-index: -1;
  border: 1px solid rgba(184, 134, 43, 0.22);
  pointer-events: none;
}

button, select, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(231, 222, 206, 0.82);
  background: rgba(248, 241, 230, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  display: block;
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.cart-pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: #fff;
  cursor: pointer;
}

.cart-pill svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-pill b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--gold-gradient);
  font-size: 12px;
}

.label {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.cart-bottom button, dialog button[type="submit"], .product-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: #fff;
  background: var(--gold-gradient);
  font-weight: 800;
  cursor: pointer;
}

.intro, .shop {
  padding: 62px clamp(18px, 5vw, 64px);
}

.shop-first {
  margin: 18px clamp(10px, 3vw, 34px) 0;
  padding-top: 34px;
  border: 1px solid rgba(184, 134, 43, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.86), rgba(246, 239, 227, 0.94)),
    radial-gradient(circle at 88% 0%, rgba(184, 134, 43, 0.18), transparent 32%);
  box-shadow: 0 24px 70px rgba(73, 48, 20, 0.1);
  position: relative;
}

.shop-first::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(184, 134, 43, 0.13);
  border-radius: 6px;
  pointer-events: none;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.intro h2, .shop h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.shop-subtitle {
  display: block;
  max-width: 560px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.intro-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.intro-points span, .chips button {
  border: 1px solid rgba(184, 134, 43, 0.25);
  border-radius: 999px;
  padding: 10px 14px;
  color: #7b5619;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  font-size: 13px;
}

.shop-head {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select, input {
  min-width: 170px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.order-shipping {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid rgba(184, 134, 43, 0.26);
  border-radius: 999px;
  padding: 9px 13px;
  color: #7a5214;
  background: rgba(255, 253, 248, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.order-shipping svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chips button {
  cursor: pointer;
}

.chips button.active, .chips button:hover {
  color: #fff;
  background: var(--gold-gradient);
  border-color: transparent;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 12px 34px rgba(22, 16, 10, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-image {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  background: #eee1cd;
}

.product-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/jewelry-hero.png");
  background-image: var(--img, url("assets/jewelry-hero.png"));
  background-size: 220%;
  background-position: var(--pos);
  transform: scale(1.04);
}

.product-image span {
  position: absolute;
  left: 14px;
  top: 14px;
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  background: var(--gold-gradient);
  font-size: 12px;
  font-weight: 800;
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.product-title {
  display: grid;
  gap: 8px;
}

.product-title h3 {
  margin: 0;
  font-size: 17px;
}

.product-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.product-price {
  display: block;
  margin-top: auto;
  color: #8b641f;
  font-weight: 800;
}

.product-card button {
  position: relative;
  width: 100%;
}

.product-card button::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -13px;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

.product-image,
.product-title h3 {
  cursor: pointer;
}

.cart {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  justify-content: end;
  background: rgba(20, 15, 10, 0.42);
}

.cart.open { display: flex; }

.cart-panel {
  width: min(430px, 100%);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #f8f1e6;
  box-shadow: var(--shadow);
}

.cart-top, .cart-bottom {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.cart-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-top h2 { margin: 0; }
.cart-top button, .dialog-top button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
}

.cart-lines { overflow: auto; padding: 8px 18px; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line h3 { margin: 0 0 5px; font-size: 15px; }
.cart-line p { margin: 0; color: var(--muted); font-size: 13px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.cart-bottom { border-top: 1px solid var(--line); border-bottom: 0; }
.cart-bottom div { display: flex; justify-content: space-between; margin-bottom: 14px; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }

dialog {
  width: min(480px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(20, 15, 10, 0.48); }
dialog form, .product-modal { display: grid; gap: 12px; padding: 20px; background: #f8f1e6; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; }
.dialog-top h2 { margin: 0; }
dialog input, dialog select {
  border-radius: 8px;
  width: 100%;
}

.modal-gallery {
  display: grid;
  gap: 10px;
}

.modal-cover {
  min-height: 310px;
  border-radius: 8px;
  background-image: url("assets/jewelry-hero.png");
  background-image: var(--img, url("assets/jewelry-hero.png"));
  background-size: 210%;
  background-position: var(--pos, 64% 42%);
  border: 1px solid var(--line);
}

.modal-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.modal-thumb {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-image: url("assets/jewelry-hero.png");
  background-image: var(--img, url("assets/jewelry-hero.png"));
  background-size: 220%;
  background-position: var(--pos);
  cursor: pointer;
}

.modal-thumb.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(184, 134, 43, 0.18);
}

.modal-details {
  display: grid;
  gap: 12px;
}

.modal-details strong {
  color: #8b641f;
  font-size: 22px;
}

.modal-details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-details button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--gold-gradient);
  font-weight: 800;
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: 330px;
  transform: translateY(16px);
  opacity: 0;
  border-radius: 999px;
  padding: 13px 16px;
  color: #fff;
  background: #17130f;
  transition: 180ms ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(184, 134, 43, 0.18);
  background: rgba(248, 241, 230, 0.92);
  backdrop-filter: blur(18px);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-header strong {
  color: #7a5214;
  font-size: 14px;
}

.admin-header-actions button,
.admin-login-card button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff;
  background: var(--gold-gradient);
  font-weight: 800;
  cursor: pointer;
}

.admin-login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(242, 213, 138, 0.28), transparent 34%),
    linear-gradient(180deg, #f8f1e6, #efe3cf);
}

.admin-login-screen.active {
  display: grid;
}

.admin-login-card {
  display: grid;
  width: min(390px, 100%);
  gap: 12px;
  border: 1px solid rgba(184, 134, 43, 0.24);
  border-radius: 8px;
  padding: 26px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 24px 70px rgba(73, 48, 20, 0.16);
}

.admin-login-card img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.admin-login-card h1 {
  margin: 0;
  font-size: 30px;
}

.admin-login-card p {
  margin: 0 0 6px;
  color: var(--muted);
}

.admin-login-card span {
  min-height: 18px;
  color: #9b2f23;
  font-size: 13px;
  font-weight: 800;
}

body.admin-locked .admin-header,
body.admin-locked .admin-page {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.admin-page {
  padding: 18px clamp(10px, 3vw, 34px) 34px;
}

.admin-shell {
  border: 1px solid rgba(184, 134, 43, 0.22);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 34px);
  background: rgba(255, 252, 246, 0.86);
  box-shadow: 0 24px 70px rgba(73, 48, 20, 0.1);
}

.admin-title,
.admin-card-head,
.admin-stats,
.admin-product,
.order-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-title h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
}

.admin-link,
.small-button,
.admin-product button {
  border: 1px solid rgba(184, 134, 43, 0.28);
  border-radius: 999px;
  padding: 10px 13px;
  color: #7a5214;
  background: #fffdf8;
  font-weight: 800;
  cursor: pointer;
}

.admin-stats {
  margin: 22px 0;
}

.admin-stats div {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 253, 248, 0.9);
}

.admin-stats span,
.admin-product span,
.order-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.admin-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.hidden {
  display: none !important;
}

.admin-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.admin-menu button {
  border: 1px solid rgba(184, 134, 43, 0.28);
  border-radius: 999px;
  padding: 10px 14px;
  color: #7a5214;
  background: #fffdf8;
  font-weight: 800;
  cursor: pointer;
}

.admin-menu button.active {
  color: #fff;
  background: var(--gold-gradient);
  border-color: transparent;
}

.admin-grid {
  display: block;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.94);
}

.admin-card h2 {
  margin: 0;
}

.admin-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
  font: inherit;
}

.file-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.file-field input {
  border-radius: 8px;
}

.admin-form button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--gold-gradient);
  font-weight: 800;
  cursor: pointer;
}

.orders-list,
.admin-products {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.order-card,
.admin-product {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.admin-product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.admin-product-actions button {
  border: 1px solid rgba(184, 134, 43, 0.28);
  border-radius: 999px;
  padding: 9px 12px;
  color: #7a5214;
  background: #fffdf8;
  font-weight: 800;
  cursor: pointer;
}

.admin-product-actions [data-delete] {
  color: #9b2f23;
}

.order-card p {
  margin: 10px 0;
  color: var(--muted);
}

.order-card ul {
  margin: 0;
  padding-left: 18px;
}

.order-card footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.products-head {
  margin-top: 22px;
}

@media (max-width: 780px) {
  .intro, .shop-head {
    display: grid;
    grid-template-columns: 1fr;
  }
  .intro-points { justify-content: start; }
  .admin-grid,
  .admin-stats,
  .admin-title {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header { padding: 14px 16px; gap: 12px; }
  .brand img {
    width: 58px;
    height: 58px;
  }
  body::before {
    inset: 7px;
  }
  .intro, .shop { padding: 34px 12px; }
  .shop {
    display: flex;
    flex-direction: column;
  }
  .shop-first {
    margin: 12px 8px 0;
  }
  .shop-head {
    display: contents;
  }
  .filters {
    display: block;
    order: 3;
    width: 100%;
    margin-top: 2px;
    margin-bottom: 18px;
  }
  .filters label, select { width: 100%; }
  .chips {
    order: 2;
    margin-bottom: 14px;
  }
  .product-grid {
    order: 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .product-image {
    min-height: 165px;
  }
  .product-info {
    padding: 12px;
    gap: 9px;
  }
  .product-title {
    display: grid;
    gap: 5px;
  }
  .product-title h3 {
    font-size: 14px;
    line-height: 1.25;
  }
  .product-title strong {
    font-size: 14px;
  }
  .product-info p {
    display: none;
  }
  .product-price {
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 14px;
  }
  .product-card button {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }
  .product-card button::before {
    display: none;
  }
  .product-image span {
    left: 9px;
    top: 9px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .modal-cover {
    min-height: 250px;
  }
}
