:root {
  --sand: #020102;
  --ink: #fdfbfa;
  --muted: #c0b4ac;
  --accent: #f13a3a;
  --border: rgba(255, 255, 255, 0.14);
  --overlay: rgba(0, 0, 0, 0.9);
  --panel: #120a0d;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.75);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', 'Noto Sans SC', system-ui, sans-serif;
  color: var(--ink);
  background: var(--sand);
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--sand);
  z-index: 5;
}

.brand .logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

.brand p {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.user-panel a,
.user-panel button {
  text-decoration: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.user-panel button:hover,
.user-panel a:hover {
  border-color: var(--accent);
  color: var(--accent);
}


.cart-wrapper {
  position: relative;
  text-align: right;
}

.cart-toggle {
  position: absolute;
  clip: rect(0 0 0 0);
}

.cart-label {
  cursor: pointer;
  font-weight: 600;
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--panel);
  display: inline-block;
}

.cart-details {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
  display: none;
  z-index: 10;
}

.cart-wrapper:hover .cart-details,
.cart-toggle:checked + .cart-label + .cart-details {
  display: block;
}

.cart-details ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-details li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.cart-details input {
  width: 4rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
}

.cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-item-info strong {
  display: block;
  font-size: 0.95rem;
}

.cart-item-info p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-item-controls button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.cart-item-controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cart-empty {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0 0.75rem;
  font-weight: 600;
}

.cart-summary strong {
  font-size: 1rem;
}

.checkout {
  width: 100%;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

main {
  padding: 2rem 3rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero h1 {
  margin: 0.5rem 0;
  font-size: 2.7rem;
}

.hero .hero-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.hero-card {
  border-radius: 20px;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 42, 68, 0.15), rgba(4, 4, 6, 0.95));
  box-shadow: var(--shadow);
}

.hero-card .price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
  color: var(--accent);
}

.content-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}

.categories {
  background: var(--panel);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.categories h2 {
  margin-top: 0;
}

.categories ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.categories a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.categories a.active {
  color: var(--accent);
}

.empty-state {
  margin-top: 1rem;
  text-align: center;
  color: var(--muted);
}

.products {
  background: var(--panel);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.breadcrumbs {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.breadcrumbs a {
  text-decoration: none;
  color: var(--muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem;
  background: #130d0e;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-card .thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.product-title {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.product-title:hover {
  color: var(--accent);
}

.product-card .price {
  font-weight: 700;
}

.add-btn {
  border: 1px solid var(--accent);
  background: rgba(255, 42, 68, 0.12);
  color: var(--accent);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 42, 68, 0.4);
}

.add-btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(255, 42, 68, 0);
}


.product-page {
  background: var(--panel);
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid var(--border);
}

.product-error {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(241, 58, 58, 0.1);
  border: 1px solid rgba(241, 58, 58, 0.3);
  color: #ffb7b7;
  margin-bottom: 1rem;
}

.product-page,
.product-page .product-copy,
.product-page .breadcrumbs,
.product-page .product-copy h1,
.product-page .product-copy p,
.product-page .product-copy li,
.product-page .detail-group h3,
.product-page .detail-group p,
.product-page .detail-group ul li {
  color: var(--ink);
}

.product-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-image img {
  width: 100%;
  border-radius: 18px;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
}

.gallery-thumbs img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

.product-copy h1 {
  margin-top: 0;
}

.price-large {
  font-size: 1.8rem;
  margin: 0.2rem 0;
  font-weight: 700;
  color: var(--accent);
}

.product-copy .lead {
  color: #050505;
  line-height: 1.6;
}

.detail-group {
  margin-top: 1.5rem;
}

.detail-group h3 {
  margin-bottom: 0.5rem;
}

.detail-group ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #050505;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
}

.site-footer a {
  text-decoration: none;
  color: var(--muted);
  margin-left: 1.2rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .user-panel {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }

  .categories,
  .products,
  .product-page {
    padding: 1.25rem;
  }

  .cart-label {
    font-size: 0.85rem;
  }
}

.auth-page {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 20%, rgba(241, 58, 58, 0.16), transparent 36%), var(--sand);
}

.auth-shell {
  width: min(92vw, 460px);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auth-card input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: #050505;
  color: var(--ink);
}

.auth-card button {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

#auth-message {
  min-height: 1.2rem;
  color: #ffb6b6;
}
