:root {
  --color-accent: #fdc300;
  --color-dark: #22252b;
  --color-dark-soft: #3a3d44;
  --color-text: #333333;
  --color-muted: #767676;
  --color-border: #e6e6e6;
  --color-bg: #f4f5f7;
  --color-sale: #e2231a;
  --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --container-width: 1200px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-text);
  background: #ffffff;
  font-size: 14px;
  line-height: 1.5;
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

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

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  border-radius: 3px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 14px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  background: #e6b300;
}

.btn-dark {
  background: var(--color-dark);
  color: #fff;
}

@media only screen and (max-width: 700px) {
  .topbar {
    background: var(--color-dark);
    color: #cfd2d8;
    font-size: 12px;
  }

  .topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
  }

  .topbar .container span:first-child {
    display: none;
  }

}

@media only screen and (min-width: 701px) {
  /* Top utility bar */
  .topbar {
    background: var(--color-dark);
    color: #cfd2d8;
    font-size: 12px;
  }

  .topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 34px;
  }

  .topbar-links {
    display: flex;
    gap: 20px;
  }
}

/* Site header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 18px 0;
}

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

.site-logo img {
  height: 28px;
}

.site-search {
  flex: 1;
  display: flex;
  border: 2px solid var(--color-dark);
  border-radius: 3px;
  overflow: hidden;
}

.site-search select {
  border: none;
  background: #f0f0f0;
  padding: 0 10px;
  font-size: 13px;
  border-right: 1px solid var(--color-border);
}

.site-search input[type="search"] {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}

.site-search button {
  background: var(--color-accent);
  border: none;
  padding: 0 20px;
  font-weight: 700;
}

.header-icons {
  display: flex;
  gap: 18px;
  align-items: center;
  white-space: nowrap;
}

.header-icons a {
  color: inherit;
  text-decoration: none;
}

.header-icons .cart-total {
  font-weight: 700;
}

/* Category nav bar (used on category/product pages) */
.category-nav {
  background: var(--color-dark);
}

.category-nav .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 44px;
}

.category-nav a {
  color: #cfd2d8;
  font-size: 13px;
}

.category-nav a:hover {
  color: var(--color-accent);
}

/* Department sidebar list, reused on home + category pages */
.department-list {
  border: 1px solid var(--color-border);
}

.department-list li a {
  display: block;
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
}

.department-list li:last-child a {
  border-bottom: none;
}

.department-list li a:hover,
.department-list li a.active {
  background: var(--color-bg);
  color: var(--color-accent);
}

/* Section headings */
.section-title {
  font-size: 20px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border);
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 60px;
  height: 2px;
  background: var(--color-accent);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.tab {
  background: none;
  border: none;
  padding: 8px 2px 12px;
  font-size: 14px;
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

/* Product grid + card (shared across home/category/product pages) */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.product-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 14px;
  position: relative;
  background: #fff;
  transition: box-shadow 0.15s ease;
}

.product-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.product-card__category {
  display: block;
  font-size: 11px;
  color: var(--color-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.product-card__link {
  display: block;
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin-bottom: 10px;
  background: var(--color-bg);
  border-radius: 4px;
}

.product-card__title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #2f5ea8;
  min-height: 34px;
}

.product-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.product-card__price {
  font-size: 15px;
  font-weight: 700;
}

.product-card__price--sale {
  color: var(--color-sale);
}

.product-card__original-price {
  font-size: 12px;
  color: var(--color-muted);
  text-decoration: line-through;
}

.product-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
}

.product-card__rating {
  color: var(--color-accent);
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.product-card__add-to-cart {
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  position: absolute;
  bottom: 14px;
  right: 14px;
  font-weight: 700;
}

.product-card__add-to-cart:hover {
  background: #e6b300;
}

.product-card__customize-link {
  background: var(--color-accent);
  border: none;
  border-radius: 14px;
  padding: 6px 12px;
  position: absolute;
  bottom: 14px;
  right: 14px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--color-dark);
  text-decoration: none;
  white-space: nowrap;
}

.product-card__customize-link:hover {
  background: #e6b300;
}

/* Newsletter */
.newsletter {
  background: var(--color-accent);
  padding: 20px 0;
  margin-top: 40px;
}

.newsletter .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.newsletter form {
  display: flex;
  gap: 10px;
}

.newsletter input[type="email"] {
  border: none;
  border-radius: 3px;
  padding: 10px 14px;
  min-width: 260px;
}

/* Footer */
.site-footer {
  background: #f7f7f8;
  border-top: 1px solid var(--color-border);
  padding: 40px 0 20px;
  font-size: 13px;
  color: var(--color-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-grid h4 {
  color: var(--color-text);
  font-size: 14px;
  margin: 0 0 14px;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  text-align: center;
}

/* Generic empty / loading state */
.state-message {
  padding: 30px 0;
  color: var(--color-muted);
  text-align: center;
}

/* Auth modal (login/register), injected at runtime by header.js */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 37, 43, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.auth-modal-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 32px;
  width: 340px;
  max-width: calc(100vw - 32px);
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--color-muted);
}

.auth-modal-title {
  font-size: 18px;
  margin: 0 0 16px;
}

.auth-modal-tabs {
  margin-bottom: 16px;
}

.auth-modal-error {
  background: #fdeaea;
  color: var(--color-sale);
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-modal-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--color-muted);
}

.auth-modal-form input[type="email"],
.auth-modal-form input[type="password"],
.auth-modal-form input[type="text"],
.auth-modal-form input[type="tel"] {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: 14px;
  font-family: inherit;
}

.auth-modal-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.auth-modal-form button[type="submit"] {
  margin-top: 4px;
}
