*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --accent: #3B7DDD;
  --accent-rgb: 59, 125, 221;
  --accent-600: #6FA4DB;
  --accent-600-rgb: 111, 164, 219;
  --accent-300: #86B6ED;
  --accent-300-rgb: 134, 182, 237;
  --accent-200: #b9d8f3;
  --accent-200-rgb: 185, 216, 243;
  --accent-100: #dcf0f9;
  --accent-100-rgb: 220, 240, 249;
  --accent-border: #95c0ef;
  --accent-border-rgb: 149, 192, 239;
  --accent-soft-border: #e7f3fc;
  --accent-soft-border-rgb: 231, 243, 252;
  --accent-dot: #c4dff5;
  --accent-dot-rgb: 196, 223, 245;
  --bg-grad-from: #dcf0f9;
  --bg-grad-to: #89b8ee;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg-grad-from), var(--bg-grad-to));
  color: #000000;
  overflow-x: hidden;
}

/* Lock background scroll when modal is open */
html.modal-open,
body.modal-open {
  overflow: hidden;
  height: 100%;
}

#app {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 0 32px;
  width: 100%;
}

.app-header {
  margin-bottom: 10px;
}

.app-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 15px 15px;
  background: rgba(var(--accent-300-rgb), 0.2);
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: auto;
}

/* Header icon pills (like reference) */
.btn-icon {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(var(--accent-soft-border-rgb), 0.9);
  color: #000000;
}
.btn-icon .icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon svg {
  width: 22px;
  height: 22px;
}
.btn-icon:active {
  transform: scale(0.98);
}

.btn-cart-icon {
  background: #ffffff;
  border-color: rgba(var(--accent-soft-border-rgb), 0.9);
  color: #000000;
}

.btn-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #22c55e;
  color: #ffffff;
  border: 2px solid rgba(var(--accent-100-rgb), 1);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.app-logo-wrap {
  display: flex;
  align-items: center;
  min-height: 40px;
  min-width: 0;
}

.app-logo {
  height: 40px;
  width: auto;
  max-width: min(220px, 60vw);
  object-fit: contain;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 15px 15px 0;
  text-align: center;
}

/* По запросу: скрыть заголовок "Меню товаров" */
#catalog-view .section-title {
  display: none;
}

.products-section {
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  margin-top: -12px;
  padding: 12px 15px 18px;
  overflow: visible;
}

.top-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  height: 40px;
  margin: 4px 0 0;
  padding: 4px;
  background: var(--accent-200);
  border-radius: 40px;
}

.top-tab {
  flex: 1 1 0;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 37px;
  font-family: Ubuntu, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  cursor: pointer;
}

.top-tab--active {
  background: #ffffff;
}

.categories-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 8px;
  margin-bottom: 0;
  cursor: grab;
}

.categories-strip.categories-dragging {
  cursor: grabbing;
}

.categories-strip--secondary {
  margin-top: 4px;
}

.category-chip {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: #ffffff;
  color: #000000;
  border: 1px solid var(--accent-soft-border);
  box-shadow: none;
  white-space: nowrap;
}

.category-chip--active {
  background: #ffffff;
  color: #000000;
  border-color: var(--accent-border);
  box-shadow: none;
}


.banners-wrap {
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid var(--accent-soft-border);
}

.banners-track {
  display: flex;
  transition: transform 0.3s ease;
  touch-action: pan-y pinch-zoom;
  width: 100%;
  overflow: visible;
}

.banners-track .banner-slide {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  cursor: pointer;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
}

.banners-track .banner-slide img {
  width: 100%;
  display: block;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 12px;
}

.banners-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 6px;
  margin-top: 0;
}

.banners-dots .dot {
  width: 20px;
  height: 6px;
  border-radius: 3px;
  background: transparent;
  border: 1px solid var(--accent-dot);
  padding: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.banners-dots .dot.active {
  background: var(--accent-dot);
  border: 1px solid var(--accent-dot);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.products-grid--promotions {
  margin-top: 10px;
}

.product-card {
  background: #ffffff;
  max-width: 220px;
  width: 100%;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: none;
  border: 1px solid #E5E7EB;
  justify-self: center;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.product-image {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f6;
  display: block;
  margin-bottom: 8px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  min-height: calc(1.3em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 6px;
}

.product-modal-props {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.product-card-badges {
  min-height: 20px;
}

.product-modal-props .product-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #EEF2FF;
  color: var(--accent);
}

.product-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
  min-width: 0;
}

.product-price {
  font-size: 16px;
  opacity: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  flex-wrap: nowrap;
}

.product-price-old {
  font-size: 13px;
  color: #9CA3AF;
  text-decoration: line-through;
  opacity: 1;
}

.product-price-new {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

/* Product-card buttons only (do not affect other app buttons) */
.product-card .btn {
  height: 36px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  padding: 0 12px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.product-order-btn.btn.btn-primary {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
  background: var(--accent-600);
  border: 1px solid var(--accent-600);
  color: #ffffff;
}

.product-fav-icon-btn.btn.btn-small.btn-fav {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  margin-top: 0;
  background: transparent;
  border: 1px solid var(--accent-600);
  color: var(--accent-600);
}

.product-fav-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.product-fav-icon-btn svg path {
  fill: none;
  stroke: currentColor;
}

.product-fav-icon-btn.is-active {
  background: #fee2e2;
  color: #ef4444;
  border-color: #ef4444;
}

.product-fav-icon-btn.is-active svg path {
  fill: #ef4444;
  stroke: #ef4444;
}

/* Promotion cards buttons: show 2 buttons side-by-side without overflow. */
.promotion-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.promotion-actions .btn {
  width: auto !important;
  flex: 0 0 auto;
  margin-top: 0 !important;
  width: 100% !important;
}

.promotion-actions .btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.promo-preview-description {
  min-height: calc(1.3em * 4);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid var(--accent-border);
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  background: #ffffff;
  color: #000000;
  transition: transform 0.08s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent-300);
  border-color: var(--accent-300);
  color: #ffffff;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-cart {
  padding-inline: 10px;
  font-size: 12px;
}

.btn-small {
  padding: 14px 16px;
  font-size: 18px;
  background: #ffffff;
  color: #000000;
  border: 2px solid var(--accent-border);
}

.products-empty,
.products-error {
  margin-top: 16px;
  font-size: 14px;
  opacity: 0.85;
}

.products-error {
  color: #dc2626;
}

.hidden {
  display: none !important;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.35);
}

.modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 16px 16px;
  max-width: 520px;
  width: min(520px, calc(100% - 32px));
  box-shadow: 0 12px 30px rgba(15,23,42,0.12);
  border: 1px solid #E5E7EB;
  /* Allow scrolling inside modal on long content (mobile) */
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-title {
  margin: 0 0 6px;
  font-size: 16px;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #111827;
  border: 1px solid #E5E7EB;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.modal-product {
  font-size: 14px;
  margin-bottom: 12px;
  opacity: 0.9;
}

/* Cart items list should scroll inside modal */
#cart-items {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  max-height: 30dvh;
}

/* --- Responsive --- */

/* Extra small phones */
@media (max-width: 360px) {
  #app {
    padding: 12px 10px 24px;
  }
  .app-header-top {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .app-header-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .app-logo {
    max-width: min(180px, 70vw);
  }
  .products-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .btn {
    padding: 7px 12px;
  }
  .btn-cart {
    padding-inline: 10px;
  }
}

/* Phones */
@media (max-width: 480px) {
  #app {
    max-width: 100%;
  }
  .app-header-top {
    justify-content: flex-start;
  }
  .app-header-actions {
    width: 100%;
  }

  /* Fullscreen modal on phone */
  .modal {
    align-items: stretch;
    justify-content: stretch;
  }
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 18px 18px 0 0;
    margin-top: auto;
    padding: 16px 14px 14px;
  }
  #cart-items {
    max-height: 35dvh;
  }
}

/* Tablets / wide */
@media (min-width: 700px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .app-logo {
    max-width: 260px;
  }
}

.cart-total {
  margin-top: 8px;
  font-weight: 600;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

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

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.cart-item-price {
  opacity: 0.85;
}

.cart-item-qty {
  opacity: 0.85;
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 13px;
  opacity: 0.9;
}

input[type="tel"] {
  border-radius: 999px;
  border: 1px solid #E5E7EB;
  background: #ffffff;
  color: #111827;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
}

input[type="tel"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

.form-helper {
  margin: 4px 0 0;
  font-size: 11px;
  opacity: 0.7;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn-secondary {
  background: #ffffff;
  color: #000000;
  border: 1px solid var(--accent-border);
}

.btn-fav {
  background: #ffffff;
  color: #000000;
  border: 2px solid var(--accent-300);
}

.view {
  width: 100%;
}

/* --- Cabinet (match reference style) --- */
#cabinet-view .app-header {
  margin-bottom: 12px;
  padding: 15px 15px 0;
}

#favorites-view .app-header {
  margin-bottom: 12px;
  padding: 15px 15px 0;
}

#cabinet-view .cabinet-header,
#favorites-view .cabinet-header {
  margin: 0 0 12px;
  align-items: center;
}

#cabinet-view .cabinet-title,
#favorites-view .cabinet-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#cabinet-view #cabinet-back.btn.btn-small,
#favorites-view #favorites-back.btn.btn-small {
  height: 38px;
  width: auto;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(149, 192, 239, 0.55);
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 13px;
}

#cabinet-view .order-card-actions .btn.btn-small {
  width: auto;
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(149, 192, 239, 0.55);
  background: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

#cabinet-view .order-card-actions {
  flex-wrap: wrap;
}

#cabinet-view .tab-btn:focus,
#cabinet-view .tab-btn:focus-visible,
#cabinet-view .btn:focus,
#cabinet-view .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(134, 182, 237, 0.35);
}

#cabinet-view .profile-card {
  border-radius: 18px;
  border: 1px solid rgba(229, 231, 235, 1);
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#cabinet-view main {
  padding: 0 15px 18px;
}

#favorites-view main {
  padding: 0 15px 18px;
}

#favorites-view .products-section {
  margin-top: 0;
  border-radius: 20px;
}

#cabinet-view .cabinet-section {
  margin-top: 12px;
}

#cabinet-view .orders-list,
#cabinet-view .addresses-list {
  padding-bottom: 6px;
}

#cabinet-view .orders-list {
  max-height: none;
  overflow-y: visible;
}

#cabinet-view .addresses-list {
  gap: 6px;
}

#cabinet-view .profile-row {
  grid-template-columns: 72px 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

#cabinet-view .profile-label {
  font-size: 13px;
  opacity: 0.85;
}

#cabinet-view .profile-value {
  font-size: 13px;
}

#cabinet-view .profile-value input,
#cabinet-view .profile-value .input-select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-border-rgb), 0.55);
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 12px;
  font-size: 14px;
}

#cabinet-view .profile-actions {
  justify-content: stretch;
}

#cabinet-view .profile-actions .btn {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent-300);
  border: 1px solid var(--accent-300);
  color: #ffffff;
}

#cabinet-view .cabinet-tabs {
  background: rgba(var(--accent-300-rgb), 0.45);
  border-radius: 999px;
  padding: 6px;
  gap: 6px;
  overflow: hidden;
}

#cabinet-view .tab-btn {
  flex: 1 1 0;
  border-radius: 999px;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
}

#cabinet-view .tab-btn--active {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.9);
  color: #111827;
}

#cabinet-view .orders-empty,
#cabinet-view .orders-error {
  text-align: center;
  padding: 14px 10px;
}

#cabinet-view .form-card {
  border-radius: 18px;
  border: 1px solid rgba(229, 231, 235, 1);
  background: #ffffff;
  padding: 14px;
}

#cabinet-view .form-card .btn.btn-primary {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent-300);
  border: 1px solid var(--accent-300);
  color: #ffffff;
}

#cabinet-view .address-card {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 1);
  border-radius: 18px;
  padding: 14px;
  font-size: 14px;
}

#cabinet-view .address-card-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

#cabinet-view .address-card-actions .btn {
  flex: 1 1 140px;
  height: 40px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  padding: 0 14px;
}

#cabinet-view .address-card-actions .btn.btn-small {
  background: var(--accent-300);
  border: 1px solid var(--accent-300);
  color: #ffffff;
}

#cabinet-view .address-card--active .address-card-actions .btn.btn-small {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#cabinet-view .address-card-actions .btn.btn-secondary {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(var(--accent-border-rgb), 0.65);
  color: #111827;
}

#cabinet-view #address-add-form textarea {
  min-height: 92px;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-border-rgb), 0.55);
  background: rgba(255, 255, 255, 0.95);
  font-family: inherit;
  font-size: 14px;
}

#cabinet-view #address-add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#cabinet-view #address-add-form .form-label {
  display: none;
}

#cabinet-view .address-card--active {
  border-color: rgba(var(--accent-300-rgb), 0.9);
  box-shadow: 0 0 0 2px rgba(var(--accent-300-rgb), 0.22);
}

.cabinet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cabinet-title {
  font-size: 16px;
  font-weight: 600;
}

.cabinet-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.tab-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: #ffffff;
  color: #111827;
  border: 1px solid #E5E7EB;
  white-space: nowrap;
}

.tab-btn--active {
  background: #EEF2FF;
  color: var(--accent);
  border-color: #C7D2FE;
}

.cabinet-section {
  margin-top: 8px;
}

.addresses-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.address-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
}

.address-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.order-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.profile-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.profile-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.profile-label {
  font-size: 12px;
  opacity: 0.8;
}

.profile-value {
  font-size: 13px;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-status-success {
  color: #111827;
  font-weight: 700;
  text-align: center;
  margin-top: 10px;
}

.profile-status-error {
  color: #dc2626;
  font-weight: 700;
  text-align: center;
  margin-top: 10px;
}

.input-select {
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  background: #ffffff;
  color: #111827;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  margin-top: 6px;
}

.comment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 6px;
}

.chip {
  border-radius: 999px;
  border: 1px solid #E5E7EB;
  background: #ffffff;
  color: #111827;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.chip:active {
  transform: scale(0.98);
}

.delivery-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
}

.delivery-type-chip--active {
  border-color: #C7D2FE;
  background: #EEF2FF;
  color: var(--accent);
}

.order-delivery-time-message {
  margin: 6px 0 10px;
  font-size: 13px;
  color: #9ca3af;
}

textarea {
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  background: #ffffff;
  color: #111827;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

.order-result {
  margin-top: 10px;
  font-size: 14px;
}

.order-result--success {
  color: #7bff9b;
}

.order-result--error {
  color: #ff7070;
}

.order-form-wrap {
  margin-top: 12px;
}

.order-success-block {
  margin-top: 16px;
  text-align: center;
}

.order-success-text {
  margin: 0 0 14px;
  font-size: 15px;
  color: #16a34a;
}

#order-modal .order-success-block {
  margin-top: 8px;
  padding: 18px 14px 12px;
  border: 1px solid rgba(149, 192, 239, 0.45);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

#order-modal .order-success-text {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  color: #111827;
}

#order-modal #order-success-close.btn.btn-primary {
  min-width: 140px;
  height: 44px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
}

/* My orders list */

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.order-card {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.order-card-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #F3F4F6;
  color: #111827;
}

.order-card-status--new {
  background: #DBEAFE;
  color: #1D4ED8;
}

.order-card-status--in_progress {
  background: #FEF3C7;
  color: #92400E;
}

.order-card-status--done {
  background: #48A74D;
  color: #FFFFFF;
}

.order-card-status--cancelled {
  background: #FFEDD5;
  color: #C2410C;
}

.order-card-products {
  margin: 6px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: pre-wrap;
}

.order-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-item-thumb {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  flex: 0 0 28px;
  border: 1px solid rgba(149, 192, 239, 0.45);
  background: #ffffff;
}

.order-item-text {
  min-width: 0;
  word-break: break-word;
}

.order-card-meta {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.orders-empty,
.orders-error {
  margin-top: 8px;
  font-size: 13px;
}

.orders-error {
  color: #dc2626;
}

/* Product details modal */

.product-modal-gallery {
  position: relative;
  margin-bottom: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: #F3F4F6;
}

.product-modal-track {
  display: flex;
  transition: transform 0.25s ease;
  touch-action: pan-y pinch-zoom;
}

.product-modal-track .product-modal-slide {
  flex: 0 0 100%;
  width: 100%;
}

.product-modal-track .product-modal-slide img {
  width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  max-height: 220px;
}

.product-modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  color: #111827;
  border: 1px solid #E5E7EB;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.product-modal-arrow:hover {
  background: #ffffff;
}

.product-modal-prev {
  left: 8px;
}

.product-modal-next {
  right: 8px;
}

#product-modal .modal-content {
  padding-top: 46px;
}

#product-modal .modal-close {
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  font-size: 22px;
  z-index: 6;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(149, 192, 239, 0.75);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.modal-description {
  font-size: 13px;
  opacity: 0.85;
  margin: 4px 0 8px;
}

.modal-product-price {
  font-weight: 600;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.product-modal-add-wrap {
  flex: 1;
  min-width: 0;
}

.product-modal-add-wrap .product-modal-add-btn {
  width: 100%;
}

/* Степпер количества внутри бывшей кнопки «В корзину» (как в маркетплейсах) */
.product-modal-inline-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #6fa4db;
  color: #fff;
  box-sizing: border-box;
}

.product-modal-inline-qty button {
  flex: 0 0 40px;
  width: 40px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #6fa4db;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-inline-qty button:active {
  opacity: 0.9;
}

.product-modal-inline-qty .product-modal-inline-qty-value {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  user-select: none;
  min-width: 28px;
}

.promotion-modal-section {
  margin-top: 10px;
}

.promotion-modal-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 6px;
}

.promotion-modal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.promotion-modal-item--gift .promotion-modal-item-text {
  color: #0f766e;
  font-weight: 600;
}

.promotion-modal-item-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 32px;
  border: 1px solid rgba(149, 192, 239, 0.45);
  background: #ffffff;
}

.promotion-modal-item-text {
  font-size: 14px;
  line-height: 1.3;
  color: #111827;
  word-break: break-word;
}

#promotion-modal .modal-description {
  margin: 2px 0 0;
  opacity: 1;
}

#service-modal .modal-content {
  border-radius: 20px;
  padding: 16px 14px 14px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#service-modal .modal-title {
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 800;
}

#service-modal .modal-close {
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

#service-modal .order-form {
  gap: 10px;
}

#service-modal .form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

#service-modal .order-form input[type="tel"],
#service-modal .order-form input[type="text"],
#service-modal .order-form input[type="date"],
#service-modal .order-form select,
#service-modal .order-form textarea {
  width: 100%;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(149, 192, 239, 0.55);
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.2;
  font-family: inherit;
}

#service-modal .order-form textarea {
  min-height: 72px;
  height: auto;
  resize: vertical;
}

#service-specialist-info {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #1f2937;
}

.debug-info {
  margin-top: 16px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #E5E7EB;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  opacity: 0.8;
}

/* --- Cart modal alignment (same principle as cabinet) --- */
#order-modal .modal-content {
  border-radius: 20px;
  padding: 16px 14px 14px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

#order-modal .modal-title {
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 800;
}

#order-modal .modal-close {
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 12px;
}

#order-modal #cart-items {
  max-height: 22dvh;
  padding-right: 2px;
}

#order-modal .cart-item {
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

#order-modal .cart-item-thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 34px;
  border: 1px solid rgba(149, 192, 239, 0.45);
  background: #ffffff;
}

#order-modal .cart-item-title {
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  min-width: 0;
  word-break: break-word;
}

#order-modal .cart-item-controls {
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  flex: 0 0 auto;
}

#order-modal .cart-item-price,
#order-modal .cart-item-qty {
  font-size: 14px;
  color: #374151;
}

#order-modal .cart-item-controls .btn.btn-small {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 999px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

#order-modal .cart-total {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: #6b7280;
}

#order-modal #delivery-summary,
#order-modal #promo-summary {
  margin-top: 6px;
  font-size: 10px !important;
  line-height: 1.35;
  color: #6b7280;
}

#order-modal #delivery-summary .delivery-summary-highlight {
  color: #3b7ddd;
  font-weight: 600;
}

#order-modal .order-form {
  gap: 10px;
}

#order-modal .form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  opacity: 1;
}

#order-modal .order-form input[type="tel"],
#order-modal .order-form input[type="text"],
#order-modal .order-form select,
#order-modal .order-form textarea {
  width: 100%;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(149, 192, 239, 0.55);
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.2;
  font-family: inherit;
  box-sizing: border-box;
}

#order-modal .order-form textarea {
  height: auto;
  min-height: 72px;
  resize: vertical;
}

#order-modal #order-address {
  margin-top: 8px;
}

#order-modal .delivery-type-chips {
  display: flex;
  gap: 8px;
}

#order-modal .delivery-type-chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

#order-modal .order-delivery-time-message {
  margin: 2px 0 0;
  font-size: 13px;
  color: #9ca3af;
}

#order-modal .payment-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#order-modal .payment-actions .btn {
  width: 100%;
  height: 44px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
}

#order-modal .payment-actions .btn.btn-primary {
  background: var(--accent-300);
  border: 1px solid var(--accent-300);
  color: #ffffff;
}

#order-modal .payment-actions .btn.btn-secondary {
  background: #ffffff;
  border: 1px solid rgba(var(--accent-border-rgb), 0.65);
  color: #111827;
}

#order-modal .form-helper {
  margin-top: 6px;
  text-align: left;
  font-size: 12px;
}

#order-modal .comment-chips {
  margin: 4px 0 6px;
}

#order-modal .comment-chips .chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
}

#order-modal .promo-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

#order-modal .promo-code-row #order-promo-code {
  flex: 1 1 auto;
}

#order-modal .promo-code-row #order-promo-apply {
  flex: 0 0 auto;
  min-width: 130px;
  height: 40px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  padding: 0 14px;
}

