* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --dark: #1a1a1a;
  --card: #242424;
  --accent: #FF3B7F;
  --bg: #141414;
  --white: #ffffff;
  --gray: #888;
  --border: #333;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--white);
  padding-bottom: 80px;
  font-size: 14px;
}

/* ХЕДЕР */
.header {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.header p {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.4;
  margin-top: 3px;
  text-transform: uppercase;
}

/* КАТАЛОГ */
#catalog-page { width: 100%; }

.catalog-grid {
  display: grid;
  grid-template-columns: calc(50% - 6px) calc(50% - 6px);
  gap: 8px;
  padding: 8px;
  width: 100%;
  align-items: start;
}

/* КАРТОЧКА */
.product-card {
  border: 1px solid #FF3B7F33;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.product-card .product-img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  display: block;
  background: #2a2a2a;
  padding: 4px;
}

.product-card .product-img-placeholder {
  width: 100%;
  height: 130px;
  background: linear-gradient(135deg, #2a2a2a 0%, #333 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.product-body {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--white);
  word-break: break-word;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ЦВЕТОВЫЕ КРУЖКИ */
.color-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}

.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.color-dot.black { background: #2a2a2a; border-color: #555; }
.color-dot.beige { background: #d4b896; }
.color-dot.selected {
  border-color: var(--accent);
  transform: scale(1.2);
}

/* РАЗМЕРЫ */
.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 8px;
}

.size-btn {
  padding: 4px 9px;
  border: none;
  border-radius: 20px;
  background: #2e2e2e;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  color: #aaa;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.15s;
}
.size-btn.selected {
  background: #229ED9;
  color: white;
}
.size-btn.out-of-stock { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

/* КНОПКА ДОБАВИТЬ */
.add-btn {
  width: 100%;
  padding: 8px 4px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.add-btn:active { opacity: 0.8; }
.add-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* СЧЁТЧИК */
.qty-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  border-radius: 8px;
  margin-top: auto;
}
.qty-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
}
.qty-num { color: white; font-size: 13px; font-weight: 700; }

/* КОРЗИНА */
.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--accent);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}
.cart-info { display: flex; flex-direction: column; }
.cart-info span:first-child { font-size: 10px; opacity: 0.8; font-weight: 600; }
.cart-info span:last-child { font-size: 18px; font-weight: 800; }
.cart-bar button {
  background: white;
  color: var(--accent);
  border: none;
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
}

/* ОФОРМЛЕНИЕ */
.checkout-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
}
.back-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
}
.checkout-header h2 {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.order-summary {
  background: var(--card);
  margin: 10px 12px;
  border-radius: 12px;
  padding: 12px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.summary-item:last-child { border-bottom: none; }
.summary-item-name { font-weight: 600; flex: 1; }
.summary-item-detail { color: var(--gray); font-size: 10px; margin-top: 2px; }
.summary-item-price { font-weight: 700; white-space: nowrap; margin-left: 8px; color: var(--accent); }
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--accent);
}
.summary-total span:first-child { font-weight: 700; font-size: 13px; }
.summary-total span:last-child { font-size: 20px; font-weight: 800; color: var(--accent); }

.form-card {
  background: var(--card);
  margin: 0 12px 12px;
  border-radius: 12px;
  padding: 12px;
}
.section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray);
  margin-bottom: 8px;
}

.delivery-options {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.delivery-btn {
  flex: 1;
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}
.delivery-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.form-card input,
.form-card textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 8px;
  outline: none;
  font-family: 'Montserrat', sans-serif;
  background: #1e1e1e;
  color: var(--white);
  -webkit-appearance: none;
  display: block;
}
.form-card input::placeholder,
.form-card textarea::placeholder { color: #555; }
.form-card input:focus,
.form-card textarea:focus { border-color: var(--accent); }
.form-card textarea { resize: none; }



/* TELEGRAM КНОПКА */
.tg-btn {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 46px;
  height: 46px;
  background: #229ED9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  z-index: 99;
  text-decoration: none;
}

/* УСПЕХ */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 40px 20px;
  text-align: center;
}
.success-icon {
  width: 72px; height: 72px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
}
.success h2 {
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.success p { font-size: 13px; color: var(--gray); }

/* КНОПКА ЗАКАЗА ВНУТРИ ФОРМЫ */
.order-btn-inline {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.order-btn-inline:disabled { opacity: 0.5; }

/* ОВЕРЛЕЙ ФОТО */
.img-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.img-overlay.active {
  display: flex;
}
.img-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}
