:root {
  color-scheme: light;
  --paper: #fbf8f2;
  --paper-strong: #fffdf8;
  --ink: #1d2522;
  --muted: #5e6863;
  --line: #ded7cd;
  --pine: #245247;
  --pine-dark: #183d35;
  --saffron: #bd8740;
  --rose: #a84e61;
  --plum: #57425e;
  --sky: #d9e7ec;
  --danger: #9d2f2f;
  --shadow: 0 20px 60px rgba(31, 37, 34, 0.14);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

body::selection {
  background: var(--pine);
  color: #fff;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(251, 248, 242, 0.92);
  border-bottom: 1px solid rgba(222, 215, 205, 0.86);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--pine);
  color: #fff;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.topnav {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.topnav a,
.plain-nav-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

.topnav a:hover,
.plain-nav-button:hover {
  color: var(--pine);
}

.hero {
  position: relative;
  display: grid;
  min-height: min(620px, calc(100svh - 128px));
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(29, 37, 34, 0.86) 0%, rgba(29, 37, 34, 0.72) 44%, rgba(29, 37, 34, 0.16) 100%),
    #2d443e;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(251, 248, 242, 0), var(--paper));
  z-index: -1;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: grid;
  place-items: center end;
  opacity: 0.96;
}

.hero-art img {
  width: min(68vw, 860px);
  min-width: 480px;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  filter: saturate(1.04);
}

.hero-copy {
  align-self: center;
  width: min(680px, 92vw);
  padding: 74px clamp(22px, 6vw, 76px) 112px;
  color: #fffdf8;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--saffron);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.catalog-heading h2,
.admin-heading h1,
.login-panel h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.hero h1 {
  max-width: 100%;
  font-size: clamp(2.8rem, 6vw, 4.3rem);
  line-height: 1;
}

.hero-text {
  max-width: 440px;
  margin: 24px 0 30px;
  color: rgba(255, 253, 248, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.34rem);
  line-height: 1.55;
}

.primary-link,
.primary-button,
.secondary-button,
.whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 820;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.primary-link,
.primary-button,
.whatsapp-link {
  background: var(--pine);
  color: #fff;
}

.primary-link {
  background: #fffdf8;
  color: var(--pine-dark);
}

.secondary-button {
  background: var(--paper-strong);
  color: var(--pine-dark);
  border-color: var(--line);
}

.primary-link:hover,
.primary-button:hover,
.secondary-button:hover,
.whatsapp-link:hover {
  transform: translateY(-1px);
}

.primary-button:hover,
.whatsapp-link:hover {
  background: var(--pine-dark);
}

.catalog-band {
  padding: 42px clamp(18px, 4vw, 56px) 74px;
}

.catalog-heading,
.admin-heading,
.manager-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto 22px;
}

.catalog-heading h2,
.admin-heading h1,
.login-panel h1 {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.catalog-count,
#admin-count,
.manager-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 720;
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px) minmax(150px, 210px);
  gap: 14px;
  align-items: end;
  max-width: 1220px;
  margin: 0 auto 26px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.upload-zone span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(36, 82, 71, 0.13);
}

.collection-tabs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  background: var(--paper-strong);
  color: var(--muted);
  cursor: pointer;
  font-weight: 760;
}

.chip.is-active {
  background: var(--plum);
  border-color: var(--plum);
  color: #fff;
}

.status-message {
  max-width: 1220px;
  min-height: 26px;
  margin: 0 auto 12px;
  color: var(--danger);
  font-weight: 720;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto;
}

.product-card {
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid rgba(222, 215, 205, 0.88);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(31, 37, 34, 0.08);
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--sky);
}

.product-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.product-meta {
  margin: 0;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.product-card h3 {
  min-height: 3.2rem;
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.28;
}

.product-description {
  min-height: 4.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.product-price {
  margin: 0;
  color: var(--pine-dark);
  font-size: 1.14rem;
  font-weight: 880;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
}

.details-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--pine-dark);
  cursor: pointer;
  font-weight: 820;
}

.card-actions .whatsapp-link {
  min-height: 42px;
  padding-inline: 10px;
  font-size: 0.92rem;
}

.is-disabled {
  opacity: 0.54;
  pointer-events: none;
}

.product-dialog {
  width: min(940px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(29, 37, 34, 0.62);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.dialog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(260px, 1.05fr);
  gap: 0;
}

.dialog-layout img {
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
  background: var(--sky);
}

.dialog-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vw, 52px);
}

.dialog-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.05;
}

.dialog-description {
  color: var(--muted);
  line-height: 1.65;
}

.dialog-price {
  color: var(--pine-dark);
  font-size: 1.4rem;
  font-weight: 880;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.admin-shell {
  padding: 42px clamp(18px, 4vw, 56px) 72px;
}

.login-panel {
  width: min(460px, 100%);
  margin: 8vh auto 0;
  padding: 28px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 42px rgba(31, 37, 34, 0.09);
}

.login-form,
.product-form {
  display: grid;
  gap: 15px;
}

.admin-workspace {
  max-width: 1220px;
  margin: 0 auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

.product-form,
.product-manager {
  padding: 20px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(31, 37, 34, 0.07);
}

.product-form h2,
.product-manager h2 {
  margin: 0;
  font-size: 1.3rem;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 44px;
  color: var(--muted);
  font-weight: 780;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--pine);
}

.upload-zone {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px dashed var(--saffron);
  border-radius: var(--radius);
  background: #fffaf0;
  cursor: pointer;
}

.upload-zone input {
  padding: 0;
  border: 0;
  min-height: auto;
  background: transparent;
}

.image-preview {
  width: 100%;
  max-height: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  object-fit: cover;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-weight: 740;
}

.form-message.is-success {
  color: var(--pine);
}

.admin-product-list {
  display: grid;
  gap: 12px;
}

.admin-product {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.admin-product img {
  width: 86px;
  height: 98px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--sky);
}

.admin-product h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.admin-product p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-actions {
  display: grid;
  gap: 8px;
}

.small-button,
.danger-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--pine-dark);
  cursor: pointer;
  font-weight: 780;
}

.danger-button {
  color: var(--danger);
}

@media (max-width: 820px) {
  .topbar,
  .site-footer,
  .catalog-heading,
  .admin-heading,
  .manager-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 10px;
  }

  .hero-art {
    place-items: end center;
    opacity: 0.46;
  }

  .hero-art img {
    width: 130vw;
    min-width: 540px;
    object-position: center bottom;
  }

  .hero-copy {
    padding-top: 58px;
    padding-bottom: 88px;
  }

  .catalog-controls,
  .admin-layout,
  .dialog-layout {
    grid-template-columns: 1fr;
  }

  .dialog-layout img {
    min-height: 310px;
    max-height: 54vh;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .admin-product {
    grid-template-columns: 74px 1fr;
  }

  .admin-product img {
    width: 74px;
    height: 86px;
  }

  .admin-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 11.5vw, 3.2rem);
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}
