/* ============================================================
   DIRTERA MARKET — Liquid Glass Design System
   Replaces flat design. Same class names, upgraded look.
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --primary: #ea580c;
  --primary-dark: #c2410c;
  --primary-light: #f97316;
  --accent: #f59e0b;
  --text: #1f2937;
  --text-muted: #6b7280;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --glass-blur: blur(14px) saturate(1.4);
}

/* ---------- Global background: animated orange gradient ---------- */
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  line-height: 1.5;
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 35%, #fbbf24 70%, #f59e0b 100%);
  background-size: 300% 300%;
  animation: bgShift 25s ease infinite;
  background-attachment: fixed;
  position: relative;
}

@keyframes bgShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Subtle glow overlays */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.25) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

.main-content { padding: 32px 16px 64px; }

/* ---------- Header — frosted glass ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.brand span { color: var(--text); }

.search-bar { display: flex; flex: 1; min-width: 200px; }
.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.search-bar input:focus {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}
.search-bar button {
  padding: 10px 20px;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.search-bar button:hover { background: var(--primary-dark); }

.header-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.header-nav a {
  color: var(--text);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.header-nav a:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--primary);
  text-decoration: none;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-block;
  padding: 11px 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff !important;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.4);
  text-decoration: none;
}
.btn-primary:active { transform: translateY(0); }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: inherit;
  font-family: inherit;
}
.btn-link:hover { color: var(--primary-dark); }

/* ---------- Messages ---------- */
.messages { margin-bottom: 20px; }
.msg {
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid;
  font-weight: 500;
}
.msg-success { background: rgba(220, 252, 231, 0.75); color: #166534; border-color: rgba(22, 101, 52, 0.2); }
.msg-error   { background: rgba(254, 226, 226, 0.75); color: #991b1b; border-color: rgba(153, 27, 27, 0.2); }
.msg-info    { background: rgba(219, 234, 254, 0.75); color: #1e40af; border-color: rgba(30, 64, 175, 0.2); }
.msg-warning { background: rgba(254, 243, 199, 0.75); color: #92400e; border-color: rgba(146, 64, 14, 0.2); }

/* ---------- Hero ---------- */
.hero {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 56px 40px;
  border-radius: 24px;
  margin-bottom: 28px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(234, 88, 12, 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  position: relative;
}
.hero p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  position: relative;
}

/* ---------- Chips (categories / filters) ---------- */
.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.chip {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 100px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.chip:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}
.chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.3);
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  box-shadow: var(--glass-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}
.product-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
.product-placeholder {
  height: 190px;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.25), rgba(245, 158, 11, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  color: var(--primary);
  font-weight: 800;
  backdrop-filter: blur(4px);
}
.product-placeholder.large { height: 400px; }
.product-info { padding: 14px 16px; }
.product-info h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.price { font-weight: 800; color: var(--primary); margin: 0; font-size: 1.05rem; }
.price-large {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 8px 0 12px;
}
.meta { color: var(--text-muted); font-size: 0.85rem; margin: 4px 0; }
.meta.small { font-size: 0.78rem; }

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
  align-items: start;
}
.product-image img {
  width: 100%;
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
}
.add-form {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: end;
  background: var(--glass-bg);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
}
.add-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 4px;
}
.add-form input {
  width: 90px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-size: 1rem;
}

/* ---------- Forms ---------- */
.form-card {
  max-width: 560px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 32px;
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
}
.form-card h1 { margin-top: 0; font-weight: 800; }

.form-card label,
form label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}
.form-card input,
.form-card textarea,
.form-card select,
form input,
form textarea,
form select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  margin-top: 6px;
  font-family: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus,
form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.12);
}

.form-card p { color: var(--text-muted); }
.form-card p a { font-weight: 600; }

/* ---------- Tables ---------- */
.table {
  width: 100%;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: var(--glass-shadow);
}
.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.table th {
  background: rgba(255, 255, 255, 0.4);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.25); }
.table tfoot th {
  background: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-weight: 800;
}

/* ---------- Checkout ---------- */
.checkout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
.order-summary {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 24px;
  border-radius: 20px;
  height: fit-content;
  box-shadow: var(--glass-shadow);
}
.order-summary h2 { margin-top: 0; }

/* ---------- Payment options ---------- */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}
.payment-option {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.payment-option:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}
.payment-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(255, 247, 237, 0.85);
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.15);
}
.payment-option span { display: flex; flex-direction: column; gap: 2px; }
.payment-option span small { color: var(--text-muted); font-size: 0.82rem; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.pagination a {
  padding: 8px 16px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  transition: all 0.2s;
}
.pagination a:hover {
  background: #fff;
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}
.pagination span { color: var(--text-muted); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer {
  background: rgba(31, 41, 55, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  padding: 40px 16px;
  text-align: center;
  margin-top: 80px;
  position: relative;
  z-index: 1;
}
.site-footer p { margin: 6px 0; font-size: 0.9rem; }

/* ---------- Utilities ---------- */
.out-of-stock { color: #991b1b; font-weight: 700; padding: 10px 0; }
hr {
  border: none;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 16px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .product-detail,
  .checkout-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 10px; padding: 10px 12px; }
  .header-nav { font-size: 0.88rem; gap: 4px; }
  .header-nav a { padding: 5px 8px; }
  .hero { padding: 36px 24px; border-radius: 20px; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 0.95rem; }
  .form-card { padding: 24px; border-radius: 16px; }
  .price-large { font-size: 1.6rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .product-card, .btn-primary, .chip, .payment-option { transition: none; }
}