/* ===== Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a120a;
  --bg-alt: #0f1a0f;
  --surface: #162016;
  --surface-2: #1c2a1c;
  --text: #f0f4f0;
  --text-muted: #9caf9c;
  --gold: #c9a227;
  --gold-light: #e0c15a;
  --gold-dark: #9a7b1a;
  --green: #1a3a1a;
  --border: #2a3f2a;
  --danger: #e74c3c;
  --radius: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --transition: 0.22s ease;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Oswald', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

/* ===== Layout ===== */
.container {
  width: min(1200px, 92%);
  margin-inline: auto;
}

.container.narrow {
  width: min(680px, 92%);
}

.page {
  display: none;
  padding-bottom: 4rem;
  min-height: 70vh;
}

.page.active {
  display: block;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 18, 10, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: min(1200px, 92%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.logo-text small {
  font-size: 0.65em;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 0.25rem;
}

.nav-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all var(--transition);
}

.nav-btn:hover,
.nav-btn.active {
  color: var(--gold);
  background: rgba(201, 162, 39, 0.1);
}

.cart-btn {
  position: relative;
  color: var(--text);
  padding: 0.5rem;
  border-radius: 8px;
  transition: color var(--transition);
}

.cart-btn:hover {
  color: var(--gold);
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--gold);
  color: #0a120a;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Hero ===== */
.hero-banner {
  background:
    linear-gradient(180deg, rgba(10, 18, 10, 0.3) 0%, var(--bg) 100%),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201, 162, 39, 0.18), transparent);
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 420px;
  margin-inline: auto;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 2rem 0 1.75rem;
}

.filter-btn {
  padding: 0.5rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gold);
  color: #0a120a;
  border-color: var(--gold);
}

/* ===== Products ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(201, 162, 39, 0.35);
}

.product-image {
  height: 220px;
  background: linear-gradient(145deg, var(--surface-2), var(--green));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-image .emoji {
  font-size: 4rem;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--gold);
  color: #0a120a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-info {
  padding: 1.15rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-light);
}

.add-btn {
  background: var(--gold);
  color: #0a120a;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  transition: background var(--transition), transform var(--transition);
}

.add-btn:hover {
  background: var(--gold-light);
  transform: scale(1.03);
}

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

/* ===== About & Contact ===== */
.page-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  text-align: center;
  margin: 3rem 0 1.75rem;
  letter-spacing: 0.03em;
}

.about-content p {
  color: var(--text-muted);
  margin-bottom: 1.15rem;
  font-size: 1.05rem;
}

.about-content .tagline {
  color: var(--gold);
  font-weight: 600;
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

.contact-intro {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select,
#checkout-form input,
#checkout-form select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus,
#checkout-form input:focus,
#checkout-form select:focus {
  outline: none;
  border-color: var(--gold);
}

.contact-note {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-note a {
  color: var(--gold);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--gold);
  color: #0a120a;
}

.btn-primary:hover {
  background: var(--gold-light);
}

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

.btn-block {
  width: 100%;
}

/* ===== Cart Sidebar ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 200;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition);
}

.cart-sidebar.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.35rem;
  border-bottom: 1px solid var(--border);
}

.cart-header h3 {
  font-size: 1.15rem;
}

.close-cart {
  font-size: 1.75rem;
  color: var(--text-muted);
  line-height: 1;
}

.close-cart:hover {
  color: var(--text);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.35rem;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-img {
  width: 64px;
  height: 64px;
  background: var(--surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.cart-item-price {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.qty-value {
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.remove-btn {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.remove-btn:hover {
  color: var(--danger);
}

.cart-footer {
  padding: 1.25rem 1.35rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.cart-total strong {
  color: var(--gold-light);
  font-size: 1.25rem;
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  padding: 1rem;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.15rem;
  font-size: 1.6rem;
  color: var(--text-muted);
}

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

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.form-row {
  margin-bottom: 0.85rem;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.order-summary {
  background: var(--surface);
  border-radius: 8px;
  padding: 1rem;
  margin: 1.25rem 0 1rem;
}

.order-summary h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-weight: 700;
}

.summary-total strong {
  color: var(--gold-light);
}

.payment-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.success-modal {
  text-align: center;
  padding: 2.5rem 1.75rem;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--gold);
  color: #0a120a;
  font-size: 2rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.order-id {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 1rem 0 1.5rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-2);
  color: var(--text);
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 400;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-note {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner {
    height: 64px;
  }

  .logo-img {
    height: 40px;
  }

  .logo-text {
    font-size: 0.95rem;
  }

  .nav {
    display: none;
  }

  .hero-banner {
    padding: 3rem 1rem 2.5rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .product-image {
    height: 160px;
  }

  .product-image .emoji {
    font-size: 2.8rem;
  }

  .product-info {
    padding: 0.9rem;
  }

  .product-name {
    font-size: 0.95rem;
  }

  .product-desc {
    display: none;
  }

  .form-row.two-col {
    grid-template-columns: 1fr;
  }
}

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

/* ===== Header Right ===== */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.staff-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all var(--transition);
}

.staff-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.logout-btn {
  border-color: rgba(231, 76, 60, 0.4);
  color: #e74c3c;
}

.logout-btn:hover {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border-color: #e74c3c;
}

.footer-login {
  background: none;
  border: none;
  color: var(--gold);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* ===== Product Image (real images) ===== */
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.product-sizes span {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}

/* ===== Login Modal ===== */
.login-modal {
  max-width: 380px;
}

.login-note {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.login-error {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.demo-creds {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.demo-creds code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--gold);
}

/* ===== Product Form ===== */
.product-modal {
  max-width: 520px;
}

.product-modal label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.form-actions .btn {
  flex: 1;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
}

/* ===== Admin ===== */
.admin-header {
  text-align: center;
  margin-bottom: 2rem;
}

.admin-sub {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  background: var(--surface);
  text-align: left;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(201, 162, 39, 0.04);
}

.admin-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  overflow: hidden;
}

.admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-actions button {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.admin-actions .edit-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.admin-actions .delete-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

.admin-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .staff-btn {
    display: none;
  }
  
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3),
  .admin-table th:nth-child(5),
  .admin-table td:nth-child(5) {
    display: none;
  }
}
