:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #f59e0b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

button { font: inherit; cursor: pointer; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }

.icon-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
}
.icon-btn:hover { color: var(--text); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logo { font-size: 1.35rem; font-weight: 800; color: var(--primary); }

.main-nav { display: flex; gap: 1.2rem; font-weight: 500; }
.main-nav a:hover { color: var(--primary); }

.header-actions { margin-left: auto; display: flex; gap: 0.7rem; align-items: center; }

#searchInput {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  min-width: 220px;
  font: inherit;
}
#searchInput:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.cart-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cart-btn:hover { background: var(--primary-dark); }

.badge {
  background: var(--accent);
  color: #1f2937;
  border-radius: 999px;
  min-width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero {
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 60%, #1e293b 100%);
  color: #fff;
  padding: 4.5rem 1.2rem;
  text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 0.8rem; }
.hero p { max-width: 620px; margin: 0 auto 1.6rem; color: #ccfbf1; }

.categories { max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.2rem 0; }

.chips { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.products-section { max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.2rem 3rem; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 1.6rem; }

#sortSelect {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  background: var(--card);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.4rem;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); }

.product-visual {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(160deg, #ecfeff, #d1fae5);
  position: relative;
}

.product-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #1f2937;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.product-info { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }

.product-name { font-weight: 700; font-size: 1.02rem; }

.product-rating { color: var(--accent); font-size: 0.9rem; }
.product-rating span { color: var(--muted); font-size: 0.8rem; }

.product-price { display: flex; align-items: baseline; gap: 0.55rem; margin-top: auto; }
.price { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 0.9rem; }

.add-btn {
  margin-top: 0.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.6rem;
  font-weight: 600;
  width: 100%;
}
.add-btn:hover { background: var(--primary-dark); }

.no-results { text-align: center; color: var(--muted); padding: 3rem 0; }

.contact {
  background: var(--card);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 3rem 1.2rem;
}
.contact h2 { margin-bottom: 0.8rem; }
.contact p { color: var(--muted); margin: 0.3rem 0; }

.site-footer {
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 1.4rem;
  font-size: 0.9rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 90;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--card);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.2);
  animation: slideIn 0.2s ease;
}

@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

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

.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.3rem; display: flex; flex-direction: column; gap: 1rem; }

.cart-item { display: flex; gap: 0.9rem; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.cart-item .emoji { font-size: 2rem; }
.cart-item .item-info { flex: 1; }
.cart-item .item-name { font-weight: 600; font-size: 0.95rem; }
.cart-item .item-price { color: var(--primary); font-weight: 700; }

.qty-controls { display: flex; align-items: center; gap: 0.45rem; }
.qty-controls button {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 700;
}
.qty-controls button:hover { border-color: var(--primary); color: var(--primary); }

.remove-btn { background: none; border: none; color: var(--muted); font-size: 0.85rem; }
.remove-btn:hover { color: #dc2626; }

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

.cart-foot { border-top: 1px solid var(--border); padding: 1.1rem 1.3rem; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; margin-bottom: 0.9rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.8rem;
  position: relative;
  animation: slideIn 0.2s ease;
}

.modal-close { position: absolute; top: 0.6rem; right: 0.6rem; }

.modal-product { display: flex; flex-direction: column; gap: 1rem; }
.modal-visual {
  height: 180px;
  border-radius: 12px;
  background: linear-gradient(160deg, #ecfeff, #d1fae5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}
.modal-product h3 { font-size: 1.4rem; }
.modal-product .desc { color: var(--muted); }
.spec-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.spec-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.modal-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.modal-actions .price { font-size: 1.6rem; }

.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font: inherit;
}
.form-group input:focus, .form-group select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.order-summary { background: var(--bg); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.order-summary .line { display: flex; justify-content: space-between; padding: 0.25rem 0; font-size: 0.95rem; }
.order-summary .line.total { border-top: 1px solid var(--border); margin-top: 0.5rem; padding-top: 0.6rem; font-weight: 800; }

.success-box { text-align: center; padding: 1.5rem 0; }
.success-box .big { font-size: 3.5rem; }
.success-box h3 { margin: 0.6rem 0 0.3rem; }
.success-box p { color: var(--muted); }
.order-number { font-weight: 800; color: var(--primary); }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  z-index: 200;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  #searchInput { min-width: 0; flex: 1; }
  .header-inner { gap: 0.8rem; }
}
