:root {
  --blue: #006be8;
  --blue-700: #0054c8;
  --ink: #101827;
  --muted: #637083;
  --line: #e6ebf2;
  --soft: #f6f8fb;
  --white: #ffffff;
  --green: #0a8f62;
  --red: #c83349;
  --shadow: 0 18px 50px rgba(16, 24, 39, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto minmax(220px, 360px) auto;
  align-items: center;
  gap: 28px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(230, 235, 242, 0.8);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 178px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

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

.nav-link {
  border: 0;
  background: transparent;
  color: #1f2937;
  padding: 10px 12px;
  border-radius: var(--radius);
}

.nav-link.active,
.nav-link:hover {
  color: var(--blue);
  background: #edf5ff;
}

.search-box {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #d5dce7;
  border-radius: 999px;
  background: #fff;
}

.search-box svg {
  width: 20px;
  color: #586174;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.app-shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 260px;
  margin: 26px 0 30px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #eaf3fb;
}

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

.hero h1,
.page-title h1 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p,
.page-title p {
  margin: 0;
  color: #3f4a5d;
  line-height: 1.55;
}

.hero-media {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  min-height: 100%;
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(0, 107, 232, 0.22);
}

.primary-button:hover {
  background: var(--blue-700);
}

.secondary-button {
  color: var(--blue);
  background: #eef6ff;
  border-color: #cbe2ff;
}

.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger-button {
  color: var(--red);
  background: #fff4f5;
  border-color: #ffd4da;
}

.full {
  width: 100%;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 16px;
  margin-bottom: 34px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
}

.category-card.active,
.category-card:hover {
  color: var(--blue);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(0, 107, 232, 0.24);
}

.category-card svg {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
}

.section-toolbar,
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 28px;
}

.section-title span {
  color: var(--blue);
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
}

select,
input,
textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  outline: none;
  background: #fff;
}

textarea {
  min-height: 94px;
  padding-top: 10px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 107, 232, 0.12);
}

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

.product-row {
  display: grid;
  grid-template-columns: minmax(220px, 350px) 1fr auto;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.product-row:hover {
  border-color: #c9d4e4;
  box-shadow: 0 16px 38px rgba(16, 24, 39, 0.08);
}

.product-media {
  position: relative;
  min-height: 100%;
  background: var(--soft);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--soft);
}

.image-discount {
  position: absolute;
  left: 12px;
  bottom: 12px;
  box-shadow: 0 8px 18px rgba(16, 24, 39, 0.12);
}

.product-info {
  padding: 28px 32px;
}

.product-info h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.product-info p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.pill-row,
.swatch-row,
.spec-row,
.option-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.spec-row {
  gap: 8px;
}

.spec-label {
  color: #303b4d;
  font-size: 14px;
  font-weight: 850;
  padding-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--blue);
  background: #edf5ff;
  font-size: 13px;
  font-weight: 700;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--blue);
  background: #edf5ff;
  font-family: "Lato", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.option-chip:hover,
.option-chip.selected {
  border-color: var(--blue);
  background: #fff;
}

.color-option {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
}

.color-option:hover,
.color-option.selected {
  border-color: var(--blue);
  background: #edf5ff;
}

.swatch {
  width: 20px;
  height: 20px;
  border: 1px solid #d9dfeb;
  border-radius: 999px;
  background: var(--swatch);
}

.product-buy {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) 172px;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  min-width: 360px;
  padding: 24px 32px;
}

.price-block {
  min-width: 0;
}

.price {
  color: #111827;
  font-family: "Lato", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.08;
}

.old-price {
  color: #8a94a6;
  text-decoration: line-through;
  font-weight: 700;
}

.stock {
  color: var(--muted);
  font-size: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green);
  background: #eaf8f1;
  font-size: 12px;
  font-weight: 850;
}

.status.inactive {
  color: #8a4b0b;
  background: #fff3df;
}

.buy-actions {
  display: grid;
  grid-template-columns: 88px 34px;
  gap: 8px;
  width: auto;
  justify-content: end;
}

.add-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--blue);
  background: #eaf4ff;
  border-color: #9dccff;
  box-shadow: none;
}

.add-button:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.quantity-stepper button {
  height: 100%;
  border: 0;
  background: #fff;
  color: var(--muted);
}

.quantity-stepper output {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.promo-card,
.admin-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.promo-card {
  overflow: hidden;
}

.promo-card img {
  width: 100%;
  aspect-ratio: 1.3 / 1;
  object-fit: cover;
}

.promo-card-content {
  padding: 18px;
}

.promo-card h3 {
  margin: 0 0 8px;
}

.promo-card p,
.empty-state p {
  color: var(--muted);
  line-height: 1.45;
}

.discount-tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green);
  background: #eaf8f1;
  font-size: 13px;
  font-weight: 850;
}

.page-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 34px 0 24px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) 1fr;
  gap: 18px;
  align-items: start;
}

.admin-panel {
  padding: 20px;
}

.admin-panel h2,
.drawer-header h2 {
  margin: 0;
}

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

.admin-form label,
.customer-form label {
  display: grid;
  gap: 6px;
  color: #303b4d;
  font-size: 14px;
  font-weight: 700;
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}

.checkbox-line input {
  min-height: auto;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.admin-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  font-weight: 800;
}

.admin-tab.active {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 4px 12px rgba(16, 24, 39, 0.08);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: #516073;
  font-size: 13px;
  text-transform: uppercase;
}

.data-table img {
  width: 54px;
  height: 54px;
  border-radius: 7px;
  object-fit: cover;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.cart-drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 39, 0.42);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(460px, 100vw);
  height: 100%;
  padding: 24px;
  overflow: auto;
  background: #fff;
  box-shadow: var(--shadow);
}

.drawer-header,
.cart-line,
.cart-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-line {
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cart-line img {
  width: 76px;
  height: 76px;
  border-radius: 7px;
  object-fit: cover;
}

.cart-line h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.cart-line p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cart-summary {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.customer-form {
  display: grid;
  gap: 12px;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.product-modal {
  width: min(940px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.product-modal::backdrop {
  background: rgba(16, 24, 39, 0.45);
}

.modal-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
}

.modal-grid img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.modal-info {
  padding: 28px;
}

.modal-info h2 {
  margin: 6px 0 12px;
  font-size: 32px;
}

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

.modal-options {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.modal-actions {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  margin-top: 22px;
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
}

.empty-state {
  padding: 36px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%) translateY(30px);
  min-width: 260px;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  border-radius: var(--radius);
  color: #fff;
  background: #101827;
  opacity: 0;
  transition: 0.2s ease;
  pointer-events: none;
  text-align: center;
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav,
  .header-actions {
    display: none;
  }

  .search-box {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .hero,
  .modal-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 220px;
  }

  .hero-media img {
    min-height: 220px;
  }

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

  .product-buy {
    grid-column: 1 / -1;
    align-items: stretch;
    padding-top: 0;
  }

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

@media (max-width: 720px) {
  body {
    padding-bottom: 72px;
  }

  .site-header {
    padding: 16px;
  }

  .brand-logo {
    width: 146px;
    max-height: 40px;
  }

  .app-shell {
    width: min(100% - 24px, 1240px);
    margin-bottom: 100px;
  }

  .hero {
    margin-top: 16px;
  }

  .category-strip {
    grid-template-columns: repeat(7, 132px);
  }

  .section-toolbar,
  .page-title {
    align-items: start;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions select,
  .toolbar-actions button {
    flex: 1;
  }

  .product-row {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 0;
    align-items: stretch;
  }

  .product-image {
    height: 100%;
    min-height: 148px;
    object-position: center top;
  }

  .image-discount {
    left: 8px;
    bottom: 8px;
    min-height: 22px;
    padding: 0 8px;
    font-size: 11px;
  }

  .product-info {
    min-width: 0;
    padding: 14px 14px 10px;
  }

  .product-info h3 {
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.25;
  }

  .product-info p {
    display: -webkit-box;
    margin-bottom: 10px;
    overflow: hidden;
    color: #4d5a70;
    font-size: 13px;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .pill-row,
  .swatch-row,
  .spec-row,
  .option-group {
    gap: 6px;
    margin-top: 8px;
  }

  .pill {
    min-height: 24px;
    padding: 0 8px;
    font-size: 12px;
  }

  .spec-label,
  .option-chip {
    font-size: 12px;
  }

  .option-chip {
    min-height: 24px;
    padding: 0 8px;
  }

  .color-option {
    width: 25px;
    height: 25px;
  }

  .swatch {
    width: 17px;
    height: 17px;
  }

  .product-buy {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0 14px 14px;
  }

  .product-buy > div {
    min-width: 0;
  }

  .product-buy .price {
    font-size: 18px;
  }

  .product-buy .status {
    font-size: 12px;
  }

  .product-buy .discount-tag {
    min-height: 24px;
    font-size: 12px;
  }

  .product-buy .buy-actions {
    grid-template-columns: 82px 34px;
    width: auto;
  }

  .product-buy .add-button {
    width: 34px;
    min-width: 34px;
  }

  .modal-actions,
  .field-grid {
    grid-template-columns: 1fr;
  }

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

  .data-table {
    display: block;
    overflow-x: auto;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-link {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 64px;
    border: 0;
    color: #4c596c;
    background: transparent;
    font-size: 12px;
  }

  .mobile-link.active {
    color: var(--blue);
  }
}
