:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-hover: #243044;
  --border: #2d3a4f;
  --text: #e8edf4;
  --text-muted: #8b9cb3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --card-img: 220px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: linear-gradient(160deg, #0a0e14 0%, #151c28 50%, #0f1419 100%);
  color: var(--text);
  line-height: 1.5;
}

body.page-login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.page-catalog {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.page-login .login-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.login-brand h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.login-brand p {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.login-form label {
  display: block;
  margin-bottom: 1rem;
}

.login-form label span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-form input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.login-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.login-error {
  margin: 0 0 1rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-search {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 260px;
  margin: 0;
}

.header-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

.header-search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.header-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-summary {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.product-path {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.header-cart.is-active {
  border-color: var(--accent);
  color: var(--text);
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.header-inner h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb span {
  color: var(--text-muted);
}

.breadcrumb strong {
  color: var(--text);
  font-weight: 500;
}

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  flex: 1;
  width: 100%;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.category-card,
.subcategory-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.category-card:hover,
.subcategory-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.category-card .meta,
.subcategory-card .meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-image-wrap {
  width: 100%;
  height: var(--card-img);
  background: #0a0e14;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.product-image-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
}

.product-image-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: rgba(15, 20, 25, 0.75);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: var(--surface-hover);
}

.lightbox-image-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #0a0e14;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: min(72vh, 640px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  margin: 0;
  padding: 0.85rem 1.25rem 1rem;
  font-size: 0.95rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.product-info {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.product-code {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-price {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #7dd3fc;
}

.product-price.missing {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.btn-add-cart {
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.45rem;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1.25rem;
  line-height: 1;
}

.btn-add-cart:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cart-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  z-index: 200;
  padding: 0.65rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.cart-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cart-page {
  max-width: 640px;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.cart-empty-link {
  display: inline-flex;
  width: auto;
  margin-top: 1rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cart-item-thumb {
  width: 72px;
  height: 72px;
  background: #0a0e14;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-item-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-item-code {
  margin: 0 0 0.15rem;
  font-weight: 600;
}

.cart-item-price {
  margin: 0;
  font-size: 0.9rem;
  color: #7dd3fc;
}

.cart-item-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  justify-content: flex-end;
}

.cart-item-qty-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-remove {
  margin-left: 0.25rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-qty {
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1.1rem;
}

.cart-item-qty {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.cart-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.cart-summary {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.cart-customer-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.cart-customer-input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.cart-customer-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn-order {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: #16a34a;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-order:hover:not(:disabled) {
  background: #15803d;
}

.btn-order:disabled {
  background: #4b5563;
  color: #9ca3af;
  opacity: 1;
  cursor: not-allowed;
}

.order-status {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  text-align: center;
}

.order-status--ok {
  color: #4ade80;
}

.order-status--err {
  color: var(--danger);
}

.load-error {
  text-align: center;
  color: var(--danger);
  padding: 2rem;
}

@media (max-width: 480px) {
  :root {
    --card-img: 180px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .cart-item {
    grid-template-columns: 56px 1fr;
  }

  .cart-item-controls {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.95);
  padding: 2rem 1.25rem 1.5rem;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  text-align: left;
}

.site-footer-brand {
  width: 100%;
}

.site-footer-contact {
  width: 100%;
  max-width: 36rem;
}

.site-footer-contact p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  column-gap: 0.5rem;
  align-items: start;
  justify-items: start;
  text-align: left;
}

.site-footer-contact p:last-child {
  margin-bottom: 0;
}

.site-footer-label {
  display: block;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

.site-footer-company {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
}

.site-footer-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: left;
}

.site-footer a {
  color: #7dd3fc;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer-legal {
  max-width: 1200px;
  margin: 0 auto 0.75rem;
  text-align: left;
}

.site-footer-text-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: #7dd3fc;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer-text-link:hover {
  color: #bae6fd;
}

.site-footer-legal-sep {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

.about-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.about-modal.is-open {
  display: flex;
}

.about-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.about-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 94vw);
  min-height: min(620px, 88vh);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  background: #fff;
  color: #1e293b;
  padding: 2rem 2.25rem 1.75rem;
}

.about-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.about-close:hover {
  background: #e2e8f0;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 46%);
  grid-template-rows: 1fr auto;
  gap: 1.5rem 1.5rem;
  min-height: min(520px, calc(88vh - 4rem));
  align-items: start;
}

.about-text-col {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding-right: 0.5rem;
  max-width: 100%;
}

.about-text-col h2 {
  margin: 0 0 1.25rem;
  padding-right: 2.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  text-align: left;
}

.about-body {
  padding: 0;
  overflow-y: visible;
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
  text-align: left;
}

.about-body p {
  margin: 0 0 1rem;
}

.about-body p:last-child {
  margin-bottom: 0;
}

.about-art {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  max-width: 100%;
  width: min(420px, 100%);
  height: auto;
  max-height: min(420px, 48vh);
  object-fit: contain;
  object-position: bottom right;
}

.about-loading {
  color: #64748b;
}

@media (max-width: 720px) {
  .about-panel {
    padding: 1.5rem 1.25rem 1.25rem;
    min-height: auto;
  }

  .about-layout {
    display: flex;
    flex-direction: column;
    min-height: auto;
    gap: 1.25rem;
  }

  .about-text-col {
    padding-right: 0;
  }

  .about-art {
    align-self: center;
    width: min(420px, 100%);
    max-height: 320px;
  }
}

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.privacy-modal.is-open {
  display: flex;
}

.privacy-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.privacy-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.privacy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.privacy-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.privacy-close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: rgba(15, 20, 25, 0.75);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.privacy-close:hover {
  background: var(--surface-hover);
}

.privacy-body {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.privacy-body p {
  margin: 0 0 0.85rem;
  line-height: 1.65;
}

.privacy-body p:last-child {
  margin-bottom: 0;
}

.privacy-loading {
  color: var(--text-muted);
}

.site-footer-copy {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 640px) {
  .site-footer-contact p {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }
}
