:root {
  --brand-red: #b3372c;
  --brand-brown: #4a352a;
  --brand-bg: #faf7f4;
  --brand-accent-1: #e2822f;
  --brand-accent-2: #9c4a1e;
  --brand-cream: #fbf3e7;
  --text-muted: #8a7a6f;
  --border-soft: #eee2d8;
  --shadow-card: 0 2px 10px rgba(74, 53, 42, 0.06);
  --shadow-card-hover: 0 10px 24px rgba(74, 53, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--brand-bg);
  color: var(--brand-brown);
  line-height: 1.5;
  font-size: 15px;
}

a {
  color: inherit;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 20px;
  background: rgba(255, 252, 247, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand svg {
  height: 50px;
  width: auto;
  display: block;
}

.site-brand-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-accent-1), var(--brand-accent-2));
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

nav.site-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

nav.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  color: var(--brand-brown);
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

nav.site-nav a:hover {
  background: var(--brand-cream);
}

nav.site-nav a.cart-link {
  background: var(--brand-red);
  color: #fff;
}

nav.site-nav a.cart-link:hover {
  background: var(--brand-accent-2);
}

.nav-phone {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 6px;
  white-space: nowrap;
}

.nav-phone:hover {
  color: var(--brand-red);
}

@media (max-width: 680px) {
  .nav-phone {
    display: none;
  }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  padding: 24px 0;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.product-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
  border-color: transparent;
}

.product-card .product-thumb {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  background: var(--brand-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card .product-thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.product-card .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.product-card h3 {
  font-size: 15px;
  line-height: 1.35;
  margin: 12px 0 6px;
  min-height: 2.7em;
}

.product-card h3 a {
  text-decoration: none;
}

.product-card h3 a:hover {
  color: var(--brand-red);
}

.product-card .price {
  font-weight: 700;
  font-size: 17px;
  color: var(--brand-red);
  margin-top: auto;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stock-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9c9c9c;
}

.stock-badge.in-stock {
  color: #3e7a4a;
}

.stock-badge.in-stock::before {
  background: #4caf50;
}

.btn {
  display: inline-block;
  background: var(--brand-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--brand-accent-2);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--brand-red);
  border: 1.5px solid var(--brand-red);
  border-radius: 6px;
  padding: 9px 17px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.btn-outline:hover {
  background: var(--brand-cream);
}

.site-footer {
  margin-top: 40px;
  background: var(--brand-brown);
  color: var(--brand-cream);
}

.site-footer .footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
}

.site-footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}

.site-footer .footer-brand svg {
  height: 35px;
  width: auto;
}

.site-footer a {
  color: var(--brand-cream);
  text-decoration: none;
  opacity: 0.85;
}

.site-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

.site-footer .footer-meta {
  font-size: 13px;
  opacity: 0.7;
  text-align: right;
}

.footer-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.footer-contacts .footer-messengers {
  display: flex;
  gap: 12px;
}

h1 {
  font-size: 32px;
  line-height: 1.25;
  margin: 0 0 12px;
}

h2 {
  font-size: 22px;
  margin: 0 0 16px;
}

.hero {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 28px;
}

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 620px;
  margin: 0 0 20px;
}

.cat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 24px;
}

.cat-chip {
  display: inline-block;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border-soft);
  color: var(--brand-brown);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cat-chip:hover {
  border-color: var(--brand-red);
}

.cat-chip.active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.catalog-layout {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding-bottom: 30px;
}

.catalog-sidebar {
  width: 230px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 78px;
}

.catalog-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 6px;
  padding: 0 12px;
}

.cat-link {
  display: block;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--brand-brown);
  transition: background 0.15s ease, color 0.15s ease;
}

.cat-link:hover {
  background: var(--brand-cream);
}

.cat-link.active {
  background: var(--brand-red);
  color: #fff;
}

.catalog-main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 780px) {
  .catalog-layout {
    flex-direction: column;
  }
  .catalog-sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .catalog-sidebar-title {
    display: none;
  }
  .cat-link {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-soft);
  }
}

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

table.admin-table th,
table.admin-table td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  text-align: left;
  font-size: 14px;
}

input,
textarea,
select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

form.stacked {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}

.admin-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-nav nav {
  display: flex;
  gap: 16px;
}

.image-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-row {
  position: relative;
  width: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
}

.image-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 4px;
  background: #f0ece8;
}

.image-thumb.broken {
  opacity: 0.25;
}

.image-row .image-url-value {
  font-size: 10px;
  padding: 3px;
  width: 96px;
}

.image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--brand-red);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 1;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  z-index: 1;
}

.image-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.image-add-row input {
  flex: 1;
  max-width: 320px;
}

.doc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.doc-row .doc-title-value {
  flex: 1;
  max-width: 220px;
}

.doc-row .doc-url-value {
  flex: 2;
}

.doc-remove {
  background: var(--brand-red);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  flex-shrink: 0;
}

.doc-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.doc-add-row input {
  flex: 1;
  max-width: 220px;
}

.doc-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-red);
  text-decoration: none;
  font-size: 14px;
}

.doc-link:hover {
  text-decoration: underline;
}

/* ---------- сторінка товару ---------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 16px 0 20px;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--brand-red);
  text-decoration: underline;
}

.breadcrumbs .sep {
  opacity: 0.5;
}

.breadcrumbs .current {
  color: var(--brand-brown);
  font-weight: 600;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-gallery-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--brand-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}

.product-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-gallery-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 2px solid var(--border-soft);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  padding: 4px;
}

.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery-thumb.active {
  border-color: var(--brand-red);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--brand-cream);
  border-radius: 10px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-brown);
  white-space: nowrap;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}

.specs-table tr:nth-child(even) {
  background: var(--brand-bg);
}

.specs-table td {
  padding: 10px 14px;
  vertical-align: top;
}

.specs-table td:first-child {
  color: var(--text-muted);
  font-weight: 600;
  width: 40%;
  white-space: nowrap;
}

.specs-table td:last-child {
  font-weight: 600;
  color: var(--brand-brown);
}

@media (max-width: 680px) {
  .specs-table td:first-child {
    white-space: normal;
  }
}

/* ---------- мобільна адаптивність ---------- */

table.admin-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 680px) {
  header.site-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  nav.site-nav {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .site-brand svg {
    height: 40px;
  }

  .hero {
    padding: 26px 0 18px;
  }

  h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 14px;
  }

  .site-footer .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .site-footer .footer-meta {
    text-align: left;
  }

  .container {
    padding: 0 16px;
  }
}

@media (max-width: 420px) {
  .site-brand-badge {
    display: none;
  }

  .site-brand svg {
    height: 34px;
  }
}
