:root {
  --paper: #f7f5ef;
  --surface: #ffffff;
  --ink: #1f211f;
  --muted: #686861;
  --line: #dfd8cd;
  --navy: #073a5c;
  --navy-deep: #052f4d;
  --olive: #6b7455;
  --wine: #7a3e46;
  --sand: #d9c6a8;
  --shadow: 0 22px 60px rgba(19, 24, 28, 0.14);
  --page-max: 1160px;
  --gutter: clamp(16px, 4vw, 48px);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2 {
  margin: 0;
  font-weight: 780;
  line-height: 1.04;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(36px, 10.8vw, 46px);
}

h2 {
  font-size: clamp(28px, 8vw, 46px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 216, 205, 0.92);
  background: rgba(247, 245, 239, 0.96);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  position: relative;
  width: min(var(--page-max), calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  width: 148px;
  min-width: 128px;
}

.brand img {
  display: block;
  width: 100%;
  height: 50px;
  object-fit: cover;
  background: var(--navy);
}

.main-nav {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.main-nav a {
  padding: 10px 2px;
  color: #474843;
  font-size: 14px;
  font-weight: 700;
}

.main-nav a:hover {
  color: var(--navy);
}

.header-actions,
.head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.menu-button {
  width: 44px;
  height: 42px;
  display: inline-grid;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.menu-button span {
  width: 18px;
  height: 2px;
  display: block;
  background: var(--ink);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(330px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel a,
.menu-panel button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 760;
  text-align: left;
}

.menu-panel a:hover,
.menu-panel button:hover {
  background: #f0eee8;
}

.ghost-link,
.ghost-button,
.icon-text-button,
.primary-link,
.oauth-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  text-align: center;
  white-space: nowrap;
}

.primary-link {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--surface);
}

.primary-link:hover {
  border-color: var(--navy-deep);
  background: var(--navy-deep);
}

.ghost-button,
.icon-text-button {
  background: transparent;
}

.catalog-head {
  border-bottom: 1px solid var(--line);
}

.catalog-head__inner {
  width: min(var(--page-max), calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  gap: 24px;
  align-items: center;
  padding: clamp(34px, 9vw, 78px) 0 clamp(34px, 7vw, 64px);
}

.catalog-head__copy {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--navy);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.wordmark {
  color: var(--navy);
  font-weight: 840;
  white-space: nowrap;
}

.lead {
  max-width: 610px;
  margin: 0;
  color: #4c4d47;
  font-size: clamp(17px, 4.7vw, 21px);
  min-width: 0;
}

.head-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 4px;
}

.brand-panel {
  display: grid;
  min-height: 300px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(7, 58, 92, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy), #274b5e);
  color: var(--surface);
}

.brand-panel__summary {
  display: grid;
  align-content: end;
  gap: 14px;
  min-width: 0;
  padding: clamp(22px, 6vw, 36px);
}

.brand-panel__summary p {
  margin: 0;
  color: var(--sand);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-panel__summary strong {
  display: block;
  width: 100%;
  max-width: 520px;
  min-width: 0;
  font-size: clamp(28px, 7.8vw, 34px);
  line-height: 1.06;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.brand-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.brand-panel span {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--surface);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.brand-panel span:nth-child(odd) {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.section {
  padding: clamp(40px, 8vw, 78px) 0;
  border-bottom: 1px solid var(--line);
}

section[id] {
  scroll-margin-top: 94px;
}

.section-inner {
  width: min(var(--page-max), calc(100% - 32px));
  margin: 0 auto;
}

.section--tight {
  padding-top: clamp(34px, 7vw, 60px);
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(7, 58, 92, 0.12);
}

.product-grid {
  display: grid;
  gap: 14px;
}

.product-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-photo {
  position: relative;
  min-height: 230px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #ebe5dc;
}

.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-photo--placeholder::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 42% 42% 10% 10%;
  border: 1px solid rgba(29, 29, 27, 0.11);
  background: rgba(255, 255, 255, 0.55);
}

.product-photo--placeholder::after {
  content: attr(data-initials);
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: rgba(29, 29, 27, 0.52);
  font-size: 42px;
  font-weight: 820;
  letter-spacing: 0;
}

.tone-navy {
  background: #dfe8ec;
}

.tone-olive {
  background: #e2e5d7;
}

.tone-wine {
  background: #eadde0;
}

.tone-sand {
  background: #eee4d1;
}

.tone-charcoal {
  background: #dededb;
}

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

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.status {
  color: var(--olive);
}

.product-body h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.22;
  letter-spacing: 0;
}

.product-price {
  margin: 0;
  font-size: 16px;
  font-weight: 780;
}

.size-row {
  min-height: 30px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.size-row span {
  min-width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #343530;
  font-size: 12px;
  font-weight: 780;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.card-actions .primary-link,
.card-actions .ghost-link {
  min-height: 42px;
  padding: 9px 10px;
  font-size: 13px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.brand-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.brand-list span {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  font-weight: 820;
}

.brand-list span:nth-child(2n) {
  border-right: 0;
}

.brand-list span:last-child {
  grid-column: 1 / -1;
  border-right: 0;
}

.cart-section {
  background: #f0eee8;
}

.cart-layout {
  display: grid;
  gap: 14px;
  align-items: start;
}

.cart-list {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  gap: 12px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.cart-item h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.cart-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cart-item button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  padding: 8px 12px;
  font-weight: 760;
}

.checkout-form {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.checkout-form h3 {
  margin: 0;
  font-size: 22px;
}

.checkout-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-submit {
  width: 100%;
}

.contacts-section {
  background: var(--navy);
  color: var(--surface);
}

.contacts-section .eyebrow,
.contacts-section .section-note {
  color: var(--sand);
}

.contact-grid {
  display: grid;
  gap: 10px;
}

.contact-grid a {
  min-height: 106px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
}

.contact-grid a:hover {
  border-color: var(--sand);
}

.contact-grid span {
  color: var(--sand);
  font-size: 13px;
  font-weight: 780;
}

.contact-grid strong {
  font-size: clamp(19px, 5vw, 26px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 0;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 29, 27, 0.5);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-height: min(780px, 94vh);
  overflow: auto;
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  padding: 24px var(--gutter) 28px;
  box-shadow: var(--shadow);
}

.modal__panel h2 {
  margin: 8px 44px 18px 0;
  font-size: clamp(24px, 6.8vw, 34px);
  line-height: 1.1;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: var(--gutter);
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.auth-options {
  display: grid;
  gap: 10px;
}

.oauth-button {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
  min-height: 50px;
  background: var(--surface);
}

.oauth-button span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: var(--surface);
  font-weight: 820;
}

.oauth-button--disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form__actions {
  display: grid;
  gap: 10px;
}

.auth-message {
  display: none;
  margin: 0;
  border: 1px solid rgba(7, 58, 92, 0.22);
  border-radius: 6px;
  background: rgba(7, 58, 92, 0.07);
  color: var(--navy);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.auth-message:not(:empty) {
  display: block;
}

.back-to-top {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 18;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: var(--navy);
  color: var(--surface);
  box-shadow: 0 12px 28px rgba(7, 58, 92, 0.28);
  font-size: 22px;
  font-weight: 820;
  line-height: 1;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top:hover {
  background: var(--navy-deep);
}

.admin-page {
  background: #f6f3ec;
}

.admin-hero {
  padding: clamp(34px, 7vw, 70px) 0 clamp(22px, 5vw, 42px);
  border-bottom: 1px solid var(--line);
}

.admin-hero h1 {
  max-width: 760px;
  margin-top: 8px;
  color: var(--navy);
}

.admin-section {
  padding-top: clamp(28px, 6vw, 58px);
}

.admin-gate {
  display: grid;
  gap: 18px;
  align-items: start;
}

.admin-login,
.admin-product-form,
.admin-products {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.admin-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

.admin-form-head,
.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-form-head h3,
.admin-list-head h3 {
  margin: 0;
  font-size: 22px;
}

.admin-price-box {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-price-box legend {
  color: var(--navy);
  font-size: 13px;
  font-weight: 820;
}

.inline-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.inline-option input {
  width: auto;
  min-height: auto;
}

.admin-image-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eee8dc;
}

.admin-image-preview img {
  width: 100%;
  max-height: 280px;
  display: block;
  object-fit: cover;
}

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

.admin-product-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf7;
}

.admin-product-thumb {
  width: 74px;
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #e6e0d6;
  color: rgba(31, 33, 31, 0.56);
  font-size: 28px;
  font-weight: 820;
}

.admin-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-product-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-product-info p,
.admin-product-info span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.admin-product-info h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.admin-product-info strong {
  color: var(--navy);
  font-size: 14px;
}

.admin-product-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-product-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.admin-product-actions button:hover {
  border-color: var(--navy);
  color: var(--navy);
}

@media (min-width: 520px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .modal {
    place-items: center;
    padding: 20px;
  }

  .modal__panel {
    width: min(500px, 100%);
    border-radius: 10px;
    padding: 28px;
  }

  .modal__close {
    right: 18px;
  }

  .admin-gate {
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.7fr);
  }
}

@media (min-width: 720px) {
  h1 {
    font-size: clamp(58px, 8vw, 88px);
  }

  .site-header__inner {
    min-height: 78px;
  }

  .main-nav {
    display: flex;
  }

  .catalog-head__inner {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.86fr);
  }

  .brand-panel {
    min-height: 420px;
  }

  .brand-panel__summary strong {
    font-size: clamp(36px, 4.5vw, 48px);
  }

  .section-heading {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .brand-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .brand-list span,
  .brand-list span:nth-child(2n),
  .brand-list span:last-child {
    grid-column: auto;
    border-right: 1px solid var(--line);
  }

  .brand-list span:nth-child(4n),
  .brand-list span:last-child {
    border-right: 0;
  }

  .cart-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 18px;
  }

  .cart-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .auth-form__actions {
    grid-template-columns: 1fr 1fr;
  }

  .admin-layout {
    grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1fr);
  }

  .admin-product-card {
    grid-template-columns: 86px minmax(0, 1fr) auto;
  }

  .admin-product-thumb {
    width: 86px;
    height: 106px;
  }

  .admin-product-actions {
    grid-column: auto;
    grid-template-columns: 1fr;
    min-width: 112px;
  }
}

@media (min-width: 960px) {
  .catalog-head__inner {
    grid-template-columns: minmax(0, 0.96fr) minmax(430px, 0.82fr);
    min-height: calc(100vh - 78px);
  }

  .filters {
    grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(140px, 0.75fr));
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .brand-list {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .brand-list span,
  .brand-list span:nth-child(4n) {
    min-height: 92px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .brand-list span:last-child {
    border-right: 0;
  }
}

@media (max-width: 420px) {
  .site-header__inner {
    width: calc(100% - 24px);
  }

  .brand {
    width: 136px;
    min-width: 118px;
  }

  .brand img {
    height: 46px;
  }

  .site-header .icon-text-button {
    display: none;
  }

  .brand-panel__summary strong {
    font-size: 25px;
    line-height: 1.14;
  }

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

  .head-actions .primary-link,
  .head-actions .ghost-button,
  .card-actions {
    width: 100%;
  }

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

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-photo {
    min-height: 176px;
  }

  .product-body {
    padding: 12px;
  }

  .product-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
  }

  .product-body h3 {
    font-size: 15px;
  }

  .product-price {
    font-size: 14px;
  }

  .size-row span {
    min-width: 30px;
    height: 28px;
  }

  .back-to-top {
    left: -4px;
    bottom: 14px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
}
