:root {
  --accent: #1d523c;
  --accent-dark: #133b2a;
  --accent-soft: #e7efec;
  --link: #2563eb;
  --link-dark: #1d4ed8;
  --link-soft: #eaf0fe;
  --text: #1c1f1e;
  --text-muted: #6b7570;
  --border: #e3e6e4;
  --bg: #ffffff;
  --bg-subtle: #f7f8f7;
  --max-width: 1230px;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg-subtle);
  background-image: linear-gradient(180deg, #eef0f2 0%, #ffffff 100%);
  background-attachment: fixed;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 36px;
  display: block;
}

.search-form {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-subtle);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--link-soft);
  color: var(--link);
  flex-shrink: 0;
}

.user-avatar svg {
  width: 17px;
  height: 17px;
}

.user-welcome {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.user-welcome strong {
  color: var(--text);
  font-weight: 600;
}

.btn-logout {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-logout:hover {
  border-color: var(--link);
  color: var(--link);
}

.fav-header-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-muted);
  flex-shrink: 0;
}

.fav-header-btn:hover {
  background: var(--bg-subtle);
  color: #e0245e;
}

.fav-header-icon {
  width: 19px;
  height: 19px;
}

.fav-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: #e0245e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.fav-badge[hidden] {
  display: none;
}

.search-input:focus {
  border-color: var(--link);
  background: var(--bg);
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  border-color: var(--link);
  color: var(--link);
}

.mobile-menu-toggle .hamburger-icon {
  width: 20px;
  height: 20px;
}

/* ---------- Subheader (hero features strip) ---------- */

.site-subheader {
  background: var(--accent);
  width: 100%;
  position: fixed;
  top: var(--header-height, 60px);
  left: 0;
  right: 0;
  z-index: 40;
}

.site-subheader .container {
  padding: 4px 24px;
}

.category-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.category-nav a {
  font-size: 13px;
  font-weight: 600;
  color: #eef3f0;
  opacity: 0.8;
  padding: 5px 0;
  white-space: nowrap;
}

.category-nav a:hover {
  opacity: 1;
}

.category-nav a.active {
  opacity: 1;
  box-shadow: inset 0 -2px 0 #fff;
}

/* ---------- Mobile menu panel (search/categories/sidebar/user, <=640px) ---------- */

.mobile-menu-panel {
  position: fixed;
  top: var(--header-height, 60px);
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - var(--header-height, 60px));
  overflow-y: auto;
  padding: 16px 20px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

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

.mobile-menu-panel .search-form {
  max-width: none;
  flex: none;
}

.mobile-cat-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-cat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mobile-cat-toggle:hover {
  border-color: var(--link);
  color: var(--link);
}

.mobile-cat-toggle .chevron-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.mobile-cat-toggle[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

.mobile-menu-panel .category-nav {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
}

.mobile-menu-panel .category-nav a {
  display: block;
  width: 100%;
  color: var(--text);
  opacity: 1;
  padding: 10px 12px;
  border-radius: 6px;
}

.mobile-menu-panel .category-nav a:hover {
  background: var(--bg-subtle);
}

.mobile-menu-panel .category-nav a.active {
  color: var(--link);
  background: var(--link-soft);
  box-shadow: none;
}

.mobile-menu-panel .sidebar-column {
  /* Collapsed by default (closed dropdown); .open (toggled by the
     "Categories" button, see js/mobile-menu.js) reveals it via the existing
     .sidebar-column.open{display:flex} rule below the 900px breakpoint. */
  position: static;
  top: auto;
}

.mobile-menu-panel .user-block {
  margin-left: 0;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.mobile-menu-panel .user-welcome {
  display: inline;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--accent);
  color: #eef3f0;
  width: 100%;
  margin-top: 64px;
}

.site-footer .container {
  padding: 4px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
}

.site-footer .footer-sep {
  opacity: 0.5;
}

.site-footer a {
  opacity: 0.85;
}

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

/* ---------- Layout: sidebar + grid ---------- */

.page-main {
  /* header + subheader are position:fixed (out of flow), so content needs
     enough top padding to clear them instead of relying on normal flow.
     --content-offset (header + subheader height + a bit of breathing room)
     is computed in js/sticky-header.js. */
  padding: var(--content-offset, 116px) 0 32px;
  flex: 1 0 auto;
}

.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 20px;
  align-items: start;
}

.sidebar-toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-toggle:hover {
  border-color: var(--link);
  color: var(--link);
}

.sidebar-toggle .hamburger-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-toggle span {
  flex: 1;
  text-align: left;
}

.sidebar-toggle .chevron-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.sidebar-toggle[aria-expanded='true'] .chevron-icon {
  transform: rotate(180deg);
}

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: var(--content-offset, 116px);
}

.sidebar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--link);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-secondary:hover {
  background: var(--link-dark);
}

.btn-postit {
  background: #fff3b7;
  color: #7a5c00;
}

.btn-postit:hover {
  background: #f9e995;
}

.btn-secondary:active {
  transform: translateY(1px);
}

.btn-secondary .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.category-group {
  margin-bottom: 20px;
}

.category-group:last-child {
  margin-bottom: 0;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.category-heading:hover,
.category-heading.active {
  background: var(--link-soft);
  color: var(--link-dark);
}

.category-heading .count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12px;
}

.category-heading.active .count {
  color: var(--link-dark);
}

.product-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 6px;
}

.product-list li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.product-list li a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.product-list .stock-count {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.view-all-link {
  display: inline-block;
  margin: 4px 0 0 8px;
  font-size: 12.5px;
  color: var(--link);
  font-weight: 600;
}

.view-all-link:hover {
  color: var(--link-dark);
  text-decoration: underline;
}

.sidebar-reset {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--link);
  font-weight: 600;
  cursor: pointer;
}

.sidebar-reset:hover {
  color: var(--link-dark);
  text-decoration: underline;
}

/* ---------- Product grid ---------- */

.grid-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.grid-header h1 {
  font-size: 20px;
  margin: 0;
}

.grid-header h1 .count-badge {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.sort-control select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  outline: none;
}

.sort-control select:focus {
  border-color: var(--link);
}

.btn-clear {
  padding: 7px 14px;
  border: 1px solid var(--link);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--link);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-clear:hover {
  background: var(--link);
  color: #fff;
}

.btn-clear.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.product-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
  border-color: var(--link);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.fav-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: color 0.15s ease, transform 0.1s ease;
}

.fav-btn:hover {
  color: #e0245e;
  transform: scale(1.08);
}

.fav-btn .fav-icon {
  width: 16px;
  height: 16px;
}

.fav-btn.active {
  color: #e0245e;
}

.fav-btn.active .fav-icon {
  fill: currentColor;
}

.product-card .thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-subtle);
  display: block;
  width: 100%;
}

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

.thumb-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(28, 31, 30, 0.78);
  color: #fff;
}

.product-card.is-out-of-stock .thumb img {
  opacity: 0.55;
}

.product-card.is-out-of-stock .price,
.product-card.is-out-of-stock h3 {
  color: var(--text-muted);
}

.product-card .card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-card .card-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.product-card h3 {
  font-size: 15px;
  margin: 0;
}

.product-card .card-model {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.product-card .card-footer {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price {
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 15px;
}

.price-vat {
  font-size: 11px;
  color: var(--text-muted);
}

.empty-state {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

/* ---------- Breadcrumb ---------- */

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-back svg {
  width: 15px;
  height: 15px;
}

.btn-back:hover {
  color: var(--link);
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb a:hover {
  color: var(--link);
}

/* ---------- Product detail ---------- */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}

.fav-btn-detail {
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
}

.fav-btn-detail .fav-icon {
  width: 19px;
  height: 19px;
}

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

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.gallery-thumbs button {
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bg-subtle);
  cursor: pointer;
}

.gallery-thumbs button.active {
  border-color: var(--link);
}

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

.detail-category {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 600;
}

.detail-title {
  font-size: 26px;
  margin: 6px 0 2px;
}

.detail-model {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 14px;
}

.detail-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.detail-stock {
  font-size: 13px;
  margin-bottom: 18px;
}

.detail-stock.in-stock {
  color: var(--accent-dark);
}

.detail-stock.out-of-stock {
  color: #a05a4a;
}

.btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  margin-bottom: 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--link);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-buy svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-buy:hover {
  background: var(--link-dark);
}

.btn-buy:active {
  transform: translateY(1px);
}

.btn-buy:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.detail-description {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 22px;
}

.featured-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.featured-box .feature-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
  opacity: 0.75;
  margin-bottom: 4px;
}

.featured-box .feature-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-dark);
}

.specs-box h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.specs-table tr {
  border-top: 1px solid var(--border);
}

.specs-table tr:first-child {
  border-top: none;
}

.specs-table td {
  padding: 9px 4px;
}

.specs-table td:first-child {
  color: var(--text-muted);
  width: 45%;
}

.specs-table td:last-child {
  font-weight: 500;
}

.state-message {
  padding: 60px 0;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Info pages (rules, contact) ---------- */

.info-page {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
}

.info-page h1 {
  font-size: 22px;
  margin: 0 0 18px;
}

.info-page p {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 18px;
}

.rules-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}

.login-wrap {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(29, 82, 60, 0.1);
}

.login-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.login-card h1 {
  margin-bottom: 6px;
}

.login-card p {
  margin-bottom: 22px;
}

.login-card form {
  text-align: left;
}

.login-card .btn-submit {
  margin-top: 6px;
}

.rules-list li {
  margin-bottom: 10px;
}

.contact-block {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.contact-block:first-of-type {
  padding-top: 0;
  border-top: none;
}

.contact-block h2 {
  font-size: 15px;
  margin: 0 0 6px;
}

.contact-block p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.contact-email {
  display: inline-block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}

.contact-email:hover {
  color: var(--link-dark);
  text-decoration: underline;
}

/* ---------- Purchase modal ---------- */

.modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 22, 0.55);
  z-index: 100;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-summary {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.modal-eyebrow {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--link);
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-summary h2 {
  font-size: 19px;
  margin: 0 0 8px;
  padding-right: 20px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-meta strong {
  color: var(--text);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.form-row input,
.form-row select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--link);
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  border: none;
  border-radius: var(--radius);
  background: var(--link);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-submit:hover {
  background: var(--link-dark);
}

.btn-submit:disabled {
  cursor: default;
  opacity: 0.85;
}

/* Shown only while a purchase request (including the Dyflexis
   eligibility check) is in flight — see purchase-submit-btn in product.js. */
.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spinner-spin 0.6s linear infinite;
}

.btn-submit.is-loading .btn-spinner {
  display: inline-block;
}

@keyframes btn-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-success {
  text-align: center;
  padding: 12px 0 4px;
}

.success-icon {
  width: 44px;
  height: 44px;
  color: var(--accent);
  margin-bottom: 14px;
}

.modal-success p {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 20px;
}

.modal-form-errors {
  background: #fdecea;
  border: 1px solid #f3c2bd;
  color: #8f2a22;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

.modal-form-errors ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.modal-rules-link {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.modal-rules-link:hover {
  color: var(--link);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-column {
    position: static;
    display: none;
  }

  .sidebar-column.open {
    display: flex;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .user-welcome {
    display: none;
  }

  .featured-box {
    grid-template-columns: 1fr;
  }

  /* Header collapses to logo + hamburger; search and user-block move into
     the mobile menu panel (see js/mobile-menu.js) instead of showing here. */
  .site-header .search-form,
  .site-header .user-block {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* The tablet-range sidebar toggle/dropdown is superseded by the header
     hamburger + mobile menu panel below this breakpoint. */
  .sidebar-toggle {
    display: none;
  }

  .site-subheader {
    display: none;
  }
}
