* {
  box-sizing: border-box;
}

:root {
  --bg: #111820;
  --card: #1b2530;
  --card2: #222d39;
  --text: #f4f7fb;
  --muted: #aeb8c5;
  --accent: #2f80ed;
  --border: rgba(255,255,255,.11);
  --shadow: 0 14px 40px rgba(0,0,0,.35);
}

body {
  margin: 0;
  background: linear-gradient(180deg, #101820, #0b1118);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 12px 92px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--accent), #6da7ff);
  border-radius: 0 0 22px 22px;
  padding: 18px 14px;
  margin: -14px -12px 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 3;
}

.logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: grid;
  place-items: center;
  font-size: 30px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.35);
  flex: 0 0 auto;
}

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

.hero h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.hero p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.9);
  font-size: 13px;
}

.cart-btn {
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.22);
  color: white;
  font-size: 20px;
  position: relative;
}

.cart-btn span {
  position: absolute;
  right: -5px;
  top: -5px;
  background: #ff7b2f;
  color: white;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

select {
  width: 100%;
  border: 1px solid var(--border);
  background: #06090d;
  color: white;
  padding: 12px 9px;
  border-radius: 12px;
  outline: none;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-bottom: 20px;
}

.product-card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 25px rgba(0,0,0,.22);
  position: relative;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1.05 / .88;
  object-fit: cover;
  display: block;
}

.product-body {
  padding: 10px;
}

.product-card h3 {
  margin: 0 0 5px;
  font-size: 15px;
  color: #52a2ff;
}

.product-card p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  height: 33px;
  overflow: hidden;
}

.badge {
  position: absolute;
  right: 8px;
  top: 8px;
  background: var(--accent);
  color: white;
  padding: 6px 9px;
  font-size: 11px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,.28);
}

.details-btn, .primary {
  width: 100%;
  border: 0;
  background: linear-gradient(135deg, #7aa9ff, var(--accent));
  color: white;
  border-radius: 12px;
  padding: 10px 8px;
  font-weight: 800;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 78px;
  background: rgba(48, 44, 41, .96);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 10;
}

.bottom-nav button {
  border: 0;
  background: transparent;
  color: #c9c9c9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 22px;
}

.bottom-nav button span {
  font-size: 12px;
  font-weight: 700;
}

.bottom-nav button.active {
  color: white;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: white;
  font-size: 24px;
  z-index: 2;
}

.modal-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #0b1118;
}

.modal-content {
  padding: 16px;
}

.pill {
  display: inline-block;
  background: rgba(47,128,237,.18);
  color: #7bb2ff;
  border: 1px solid rgba(47,128,237,.35);
  padding: 6px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}

.modal h2 {
  margin: 12px 0 6px;
}

.price {
  color: #90ffb2;
  font-weight: 800;
}

textarea {
  width: 100%;
  margin: 12px 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0b1118;
  color: white;
  padding: 12px;
  resize: vertical;
  outline: none;
}

.toast {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: #17212b;
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 200;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  display: block;
}

.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 30px 10px;
}


.qty-box { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; margin: 14px 0; }
.qty-box button { border: 0; background: #2d3a49; color: white; border-radius: 12px; font-size: 24px; font-weight: 900; }
.qty-box input { text-align: center; border: 1px solid var(--border); background: #0b1118; color: white; border-radius: 12px; font-size: 18px; font-weight: 800; }
.secondary { width: 100%; border: 0; background: #2d3a49; color: white; border-radius: 12px; padding: 10px 8px; font-weight: 800; cursor: pointer; margin-top: 8px; }
.cart-card { max-height: 90vh; }
.cart-items { display: grid; gap: 10px; margin: 12px 0; }
.cart-item { background: #0b1118; border: 1px solid var(--border); border-radius: 14px; padding: 11px; display: grid; gap: 8px; }
.cart-item-head { display: flex; justify-content: space-between; gap: 10px; }
.cart-item-title { font-weight: 900; color: #7bb2ff; }
.cart-item-price { color: #90ffb2; font-weight: 900; white-space: nowrap; }
.cart-item-actions { display: grid; grid-template-columns: 36px 42px 36px 1fr; gap: 8px; align-items: center; }
.cart-item-actions button { border: 0; background: #2d3a49; color: white; border-radius: 10px; padding: 8px; font-weight: 900; }
.cart-item-actions .remove { background: #7b1d1d; }
.cart-total { margin: 14px 0; padding: 14px; background: linear-gradient(135deg, rgba(47,128,237,.28), rgba(47,128,237,.08)); border: 1px solid rgba(47,128,237,.35); border-radius: 16px; display: flex; justify-content: space-between; font-size: 18px; }
.cart-total b { color: #90ffb2; }
.product-footer { display: grid; gap: 7px; }
.product-price { color: #90ffb2; font-size: 12px; font-weight: 900; }


.checkout-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 12px 0;
}

.checkout-label select {
  width: 100%;
}


/* V4.4 UI polish */
.hero {
  border-radius: 0 0 28px 28px;
}

.product-card {
  transition: transform .15s ease, border-color .15s ease;
}

.product-card:active {
  transform: scale(.98);
}

.product-body h3 {
  font-size: 16px;
}

.product-price {
  background: rgba(144,255,178,.10);
  border: 1px solid rgba(144,255,178,.22);
  border-radius: 999px;
  padding: 7px 9px;
  width: fit-content;
}

.details-btn,
.primary {
  min-height: 43px;
  letter-spacing: .1px;
}

.checkout-help {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.checkout-box {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.checkout-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 10px;
  color: white;
}

.checkout-label {
  color: #d8e1ec;
}

.checkout-label textarea {
  margin-top: 0;
}

.cart-item {
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
}

.cart-item-title {
  font-size: 15px;
}

.cart-total {
  position: sticky;
  bottom: 0;
  backdrop-filter: blur(10px);
}

.modal-card {
  border-radius: 26px;
}


.postal-details {
  display: none;
  margin: 12px 0;
  padding: 13px;
  background: rgba(47,128,237,.08);
  border: 1px solid rgba(47,128,237,.26);
  border-radius: 16px;
}

.postal-details.show {
  display: block;
}

.checkout-subtitle {
  font-weight: 900;
  color: white;
  margin-bottom: 10px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkout-label input {
  width: 100%;
  border: 1px solid var(--border);
  background: #0b1118;
  color: white;
  border-radius: 12px;
  padding: 12px;
  outline: none;
}

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


.postal-details-warning {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 170, 0, .10);
  border: 1px solid rgba(255, 170, 0, .25);
  color: #ffd98a;
  font-size: 13px;
  line-height: 1.4;
  margin: 10px 0;
}

#postalModal .modal-card {
  max-height: 92vh;
}

#postalModal input,
#postalModal textarea,
#postalModal select {
  width: 100%;
  border: 1px solid var(--border);
  background: #0b1118;
  color: white;
  border-radius: 12px;
  padding: 12px;
  outline: none;
}

#postalModal .checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 390px) {
  #postalModal .checkout-grid {
    grid-template-columns: 1fr;
  }
}


.contact-card {
  max-width: 440px;
}

.contact-text {
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 14px;
}

.contact-box {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
}

.contact-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.contact-row b {
  color: white;
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}
