/* ===================================================
   MotoDetalii — Telegram Mini App Premium Design System
   =================================================== */

:root {
  --bg-main: #0B0F19;
  --bg-card: #162035;
  --bg-card-hover: #1E2D4A;
  --bg-secondary: #0E1524;
  --bg-glass: rgba(18, 26, 44, 0.92);
  
  --border-color: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 96, 0, 0.6);
  
  --accent-primary: #FF6000;
  --accent-primary-hover: #FF751A;
  --accent-glow: rgba(255, 96, 0, 0.35);
  
  --accent-green: #10B981;
  --accent-green-bg: rgba(16, 185, 129, 0.15);
  
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(255, 96, 0, 0.35);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(85px + var(--safe-bottom));
}

/* ================= Header ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px 8px 16px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #FF6000 0%, #FF3D00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-emoji {
  font-size: 1.25rem;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFF;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: block;
}

.icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.icon-btn:active {
  transform: scale(0.92);
}

.nav-svg-icon {
  width: 20px;
  height: 20px;
}

.icon-btn .badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent-primary);
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-main);
}

/* Search Bar */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-container input {
  width: 100%;
  height: 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0 38px 0 42px;
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: var(--transition);
}

.search-container input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

/* Category Chips (Top Bar in Feed) */
.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.cat-chip.active {
  background: var(--accent-primary);
  color: #FFF;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* ================= VIEW 1: CATEGORIES HUB (Крупні яскраві картки) ================= */
.categories-hub-section {
  padding: 12px 16px 24px 16px;
  animation: fadeIn 0.25s ease-out;
}

.hub-hero-banner {
  background: linear-gradient(135deg, #1E293B 0%, #111C33 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.hub-hero-banner::after {
  content: "🏍️";
  position: absolute;
  right: 12px;
  bottom: -4px;
  font-size: 3.5rem;
  opacity: 0.18;
}

.hub-hero-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFF;
  margin-bottom: 4px;
}

.hub-hero-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Categories Large Grid */
.categories-large-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.cat-large-card {
  background: linear-gradient(145deg, #18233C 0%, #111A2E 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cat-large-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(255, 96, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cat-large-card:active {
  transform: scale(0.96);
  border-color: var(--accent-primary);
  background: linear-gradient(145deg, #212E4D 0%, #17233D 100%);
}

.cat-large-card.highlight-card {
  border-color: var(--accent-primary);
  background: linear-gradient(145deg, rgba(255, 96, 0, 0.18) 0%, #162035 100%);
}

.cat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cat-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.cat-card-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(255, 96, 0, 0.12);
  border: 1px solid rgba(255, 96, 0, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.cat-card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.cat-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  margin-bottom: 2px;
}

.cat-card-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
}

.cat-card-arrow {
  color: var(--accent-primary);
  font-size: 1.1rem;
  font-weight: 700;
  padding-left: 6px;
}

/* ================= VIEW 2: PRODUCTS FEED ================= */
.products-feed-section {
  padding: 12px 16px 24px 16px;
  animation: fadeIn 0.25s ease-out;
}

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

.back-to-cats-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #FFF;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.back-to-cats-btn:active {
  transform: scale(0.94);
  background: var(--bg-card-hover);
}

.catalog-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  flex: 1;
}

.catalog-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sort-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  outline: none;
  flex-shrink: 0;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.product-card:active {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0E1522;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .card-img {
  transform: scale(1.04);
}

.stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: var(--radius-full);
}

.stock-badge.in-stock {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.card-body {
  padding: 10px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  height: 2.3rem;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
}

.card-price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFF;
}

.add-cart-btn {
  background: var(--accent-primary);
  border: none;
  color: #FFF;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.add-cart-btn:active {
  transform: scale(0.88);
}

.card-qty-stepper {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  height: 34px;
  overflow: hidden;
}

.stepper-btn {
  background: transparent;
  border: none;
  color: #FFF;
  width: 26px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
}

.stepper-val {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 4px;
  color: var(--accent-primary);
}

/* Skeletons */
.skeleton-card {
  height: 250px;
  background: linear-gradient(90deg, #18233C 25%, #223052 50%, #18233C 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ================= Floating Cart Bar ================= */
.floating-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 16px calc(12px + var(--safe-bottom)) 16px;
  background: linear-gradient(180deg, rgba(11, 15, 25, 0) 0%, rgba(11, 15, 25, 0.95) 30%, #0B0F19 100%);
}

.cart-bar-inner {
  max-width: 580px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-full);
  padding: 8px 10px 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  backdrop-filter: blur(16px);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-bar-info {
  display: flex;
  flex-direction: column;
}

.cart-bar-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.cart-bar-price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFF;
}

.cart-bar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
}

/* ================= Buttons & Form Controls ================= */
.btn {
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, #FF6000 0%, #FF3D00 100%);
  color: #FFF;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 18px;
}

.btn-block {
  width: 100%;
}

/* ================= Modals & Drawers ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-sheet {
  background: var(--bg-card);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  color: #FFF;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.modal-content {
  overflow-y: auto;
  padding: 16px;
  flex: 1;
}

.gallery-main-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0E1522;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.gallery-main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.thumbnails-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.thumb-img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
}

.thumb-img.active {
  border-color: var(--accent-primary);
}

.product-cat-tag {
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 600;
  text-transform: uppercase;
}

.modal-product-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 4px 0 8px 0;
  line-height: 1.3;
}

.modal-sku-row {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sku-value {
  color: var(--text-secondary);
  font-family: monospace;
}

.modal-price-row {
  margin-bottom: 16px;
}

.modal-price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFF;
}

.product-description-wrap h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.product-description-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-footer {
  padding: 12px 16px calc(12px + var(--safe-bottom)) 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-qty-control {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
}

.qty-btn {
  background: transparent;
  border: none;
  color: #FFF;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
}

.qty-val {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0 10px;
}

.modal-buy-btn {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
}

/* ================= Checkout Sheet ================= */
.checkout-sheet {
  max-height: 94vh;
}

.sheet-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.checkout-scroll-content {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}

.checkout-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.checkout-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.items-count-badge {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

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

.checkout-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.checkout-item-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
}

.checkout-item-info {
  flex: 1;
}

.checkout-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}

.checkout-item-price {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.checkout-item-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 10px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 10px;
  font-size: 1rem;
}

.input-with-icon input {
  padding-left: 36px;
}

.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-prefix {
  padding: 0 10px;
  color: var(--text-muted);
  font-weight: 600;
}

.input-with-prefix input {
  border: none;
  padding-left: 0;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 60;
  box-shadow: var(--shadow-md);
  margin-top: 4px;
}

.autocomplete-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 0.85rem;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

/* Payment options */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.payment-card input {
  display: none;
}

.payment-card .pay-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.payment-card .pay-info {
  display: flex;
  flex-direction: column;
}

.pay-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.pay-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.payment-card.active {
  border-color: var(--accent-primary);
  background: rgba(255, 96, 0, 0.08);
}

.payment-card.active .pay-icon {
  background: var(--accent-primary);
}

/* Summary Box */
.order-summary-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.summary-val {
  color: var(--text-primary);
  font-weight: 600;
}

.summary-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}

.total-row {
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #FFF;
}

.summary-total-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: var(--accent-primary);
}

.checkout-footer {
  padding: 14px 20px calc(14px + var(--safe-bottom)) 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.submit-order-btn {
  padding: 14px;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
}

/* ================= Success Screen ================= */
.success-sheet {
  padding: 36px 20px calc(24px + var(--safe-bottom)) 20px;
  text-align: center;
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--accent-green-bg);
  border: 2px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.success-emoji {
  font-size: 2.2rem;
}

.success-sheet h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.success-order-num {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.success-order-num strong {
  color: var(--accent-primary);
}

.success-msg {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.55;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.success-actions-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}

.success-main-btn {
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-secondary);
  padding: 13px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary-outline:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ================= Dynamic Checkout IBAN & Receipt Uploader ================= */
.checkout-iban-box {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.25s ease-out;
}

.iban-card-details {
  background: linear-gradient(145deg, #1A263E 0%, #10192C 100%);
  border: 1px solid rgba(255, 96, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.iban-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.iban-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.iban-bank {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: #CBD5E1;
}

.iban-copy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.iban-copy-row:last-child {
  margin-bottom: 0;
}

.iban-copy-row:active {
  transform: scale(0.98);
  background: rgba(255, 96, 0, 0.12);
  border-color: var(--accent-primary);
}

.iban-copy-row.iban-highlight-row {
  border-color: rgba(255, 96, 0, 0.5);
  background: rgba(255, 96, 0, 0.06);
}

.iban-field-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.iban-field-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.iban-field-value {
  font-size: 0.86rem;
  color: #FFFFFF;
  font-weight: 700;
  word-break: break-all;
}

.iban-field-value.mono-val {
  font-family: monospace;
  font-size: 0.82rem;
  color: #FF944D;
  letter-spacing: 0.02em;
}

.copy-pill-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.copy-pill-btn:active {
  transform: scale(0.92);
}

.copy-pill-orange {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #FFF;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Receipt Upload Container */
.receipt-upload-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

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

.receipt-upload-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFF;
}

.required-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.receipt-dropzone {
  border: 2px dashed rgba(255, 96, 0, 0.4);
  background: rgba(255, 96, 0, 0.03);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.receipt-dropzone:hover,
.receipt-dropzone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(255, 96, 0, 0.1);
}

.receipt-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.receipt-empty-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.receipt-upload-icon {
  font-size: 2rem;
}

.receipt-upload-texts strong {
  display: block;
  font-size: 0.84rem;
  color: #FFF;
  margin-bottom: 2px;
}

.receipt-upload-texts span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.receipt-preview-view {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.receipt-thumb-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.receipt-pdf-icon {
  font-size: 0.85rem;
  font-weight: 700;
  color: #EF4444;
}

.receipt-info-wrap {
  flex: 1;
  min-width: 0;
}

.receipt-file-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-file-size {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.receipt-status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-green);
}

.remove-receipt-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: var(--transition);
}

.remove-receipt-btn:active {
  transform: scale(0.9);
}

.pulse-error {
  animation: pulseHighlight 0.8s ease-in-out;
}

@keyframes pulseHighlight {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { transform: scale(1.02); box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); border-color: #EF4444; }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
}

/* ================= Toast ================= */
.toast {
  position: fixed;
  bottom: calc(75px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #1E293B;
  border: 1px solid var(--border-active);
  color: #FFF;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  font-size: 0.85rem;
  font-weight: 500;
  animation: toastFadeIn 0.25s ease-out;
}

.toast-icon {
  font-weight: 800;
  color: var(--accent-primary);
}

/* Spinners */
.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  position: absolute;
  right: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden {
  display: none !important;
}
