/**
 * GSK POS - Public Shopping Interface Styles
 * Mobile-first responsive design
 * Created: Dec 28, 2024
 */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #a78bfa;
  --secondary: #10b981;
  --secondary-dark: #059669;
  --accent: #f59e0b;
  --danger: #ef4444;
  --dark: #1e1b4b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
  --header-height: 140px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
  overflow: hidden;
}

/* Screens */
.screen {
  display: none;
  height: 100%;
  overflow: hidden;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== WELCOME SCREEN ===== */
.welcome-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(180deg, var(--primary) 0%, var(--dark) 100%);
  min-height: 100vh;
}

.welcome-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.welcome-logo {
  width: 80px;
  height: auto;
  margin-bottom: 1rem;
}

.welcome-header h1 {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.welcome-header p {
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
}

.welcome-form {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.form-group label i {
  color: var(--primary);
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.phone-input {
  display: flex;
  align-items: stretch;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-weight: 600;
  color: var(--gray-600);
}

.phone-input input {
  border-radius: 0 var(--radius) var(--radius) 0;
  flex: 1;
}

.input-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

.welcome-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.welcome-footer p {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.welcome-footer i {
  color: var(--secondary);
  margin-right: 0.25rem;
}

/* ===== LOCATION SCREEN ===== */
.location-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fff;
}

.location-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
}

.location-icon i {
  font-size: 2.5rem;
  color: #fff;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(124, 58, 237, 0); }
}

.location-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--dark);
}

.location-content > p {
  color: var(--gray-500);
  margin-bottom: 2rem;
  max-width: 300px;
}

.location-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--gray-500);
}

.location-status.error {
  color: var(--danger);
}

.location-status.success {
  color: var(--secondary);
}

/* Map Selection */
.map-selection-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-area-top) + 0.75rem) 1rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}

.map-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem;
}

.btn-text:disabled {
  color: var(--gray-400);
  cursor: not-allowed;
}

.map-search {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  margin: 0.75rem;
  border-radius: var(--radius);
  padding: 0 1rem;
}

.map-search i {
  color: var(--gray-400);
}

.map-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem;
  font-size: 0.95rem;
  outline: none;
}

.location-map {
  flex: 1;
  min-height: 300px;
  background: var(--gray-200);
}

.map-footer {
  padding: 1rem;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  text-align: center;
}

.map-footer p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.map-footer i {
  color: var(--primary);
}

.selected-location {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 0.75rem;
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

/* Area Selection in Header */
.location-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.9rem;
  max-width: 200px;
  overflow: hidden;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.location-display:hover {
  background: var(--gray-100);
}

/* Map Marker */
.map-center-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 10;
  pointer-events: none;
}

.map-center-marker i {
  font-size: 2.5rem;
  color: var(--primary);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-ghost:hover {
  color: var(--gray-700);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-whatsapp:hover {
  background: #128c7e;
}

/* ===== SHOPPING SCREEN ===== */
.shop-header {
  background: #fff;
  padding: calc(var(--safe-area-top) + 0.75rem) 1rem 0.75rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--gray-200);
}

.location-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.9rem;
  max-width: 200px;
  overflow: hidden;
}

.location-display i {
  color: var(--primary);
  flex-shrink: 0;
}

.location-display span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cart-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Search */
.search-container {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 0 1rem;
  margin-bottom: 0.75rem;
}

.search-container i {
  color: var(--gray-400);
}

.search-container input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem;
  font-size: 0.95rem;
  outline: none;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--gray-500);
  padding: 0.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.filter-btn:hover {
  color: var(--primary);
}

/* Category Pills */
.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  background: var(--gray-100);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill.active {
  background: var(--primary);
  color: #fff;
}

.pill:hover:not(.active) {
  background: var(--gray-200);
}

/* Content Area */
.shop-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(var(--safe-area-bottom) + 1rem);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

.section-header span {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* Shops Grid */
.shops-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.shop-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.shop-logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.shop-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-location {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.shop-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

.shop-distance {
  color: var(--secondary);
  font-weight: 600;
}

.shop-products {
  color: var(--gray-500);
}

/* Shop Banner */
.shop-banner {
  background: linear-gradient(135deg, var(--primary), var(--dark));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  color: #fff;
}

.shop-banner-content {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.shop-banner .shop-logo {
  width: 70px;
  height: 70px;
  background: rgba(255,255,255,0.2);
}

.shop-banner .shop-name {
  color: #fff;
  font-size: 1.25rem;
}

.shop-banner .shop-location {
  color: rgba(255,255,255,0.8);
}

.shop-banner-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.banner-btn:hover {
  background: rgba(255,255,255,0.3);
}

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

.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-image {
  aspect-ratio: 1;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.product-image i {
  font-size: 2rem;
  color: var(--gray-300);
}

.product-details {
  padding: 0.75rem;
}

.product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card.in-cart {
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(124, 58, 237, 0.1));
}

.product-card .cart-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
}

.product-card .quick-remove-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s;
}

.product-card.in-cart:hover .quick-remove-btn {
  opacity: 1;
  transform: scale(1);
}

.product-images-gallery {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.product-images-gallery .gallery-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.product-images-gallery .gallery-thumb:hover,
.product-images-gallery .gallery-thumb.active {
  border-color: var(--primary);
}

.modal-product-image {
  max-height: 250px;
  object-fit: contain;
  cursor: zoom-in;
}

/* Multi-Unit Selector */
.multi-unit-selector {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 12px;
}

.unit-selector-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.unit-selector-label i {
  color: var(--primary);
}

.unit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--gray-200);
}

.unit-row:last-of-type {
  margin-bottom: 0.75rem;
}

.unit-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.unit-name {
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  font-size: 0.9rem;
}

.unit-price {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.unit-qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.unit-qty-input {
  width: 50px;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}

.unit-total {
  text-align: right;
  font-size: 1rem;
  color: var(--dark);
  padding-top: 0.5rem;
  border-top: 1px solid var(--gray-200);
}

.unit-total strong {
  color: var(--primary);
  font-size: 1.1rem;
}

/* Single Unit Selector */
.single-unit-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.unit-label {
  font-size: 0.9rem;
  color: var(--gray-500);
}

/* Unit Badge in Cart */
.unit-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

.cart-item-unit {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.cart-item-line-total {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.product-unit {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 400;
}

/* ===== SLIDE PANEL (Cart) ===== */
.slide-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: #fff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -5px 0 30px rgba(0,0,0,0.2);
}

.slide-panel.open {
  right: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-area-top) + 1rem) 1rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.panel-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-header h2 i {
  color: var(--primary);
}

.close-panel {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  color: var(--gray-600);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.close-panel:hover {
  background: var(--gray-200);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.cart-item-image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-image i {
  color: var(--gray-400);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-200);
  border: none;
  color: var(--gray-700);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: var(--primary);
  color: #fff;
}

.cart-item-qty span {
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-400);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.empty-state span {
  font-size: 0.9rem;
}

.cart-footer {
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  background: #fff;
  padding-bottom: calc(var(--safe-area-bottom) + 1rem);
}

.cart-summary {
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--gray-600);
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  border-top: 1px solid var(--gray-200);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* ===== CHECKOUT SCREEN ===== */
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-area-top) + 1rem) 1rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}

.checkout-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.checkout-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.checkout-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.checkout-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkout-section h3 i {
  color: var(--primary);
}

/* Notes/Textarea Styling */
.checkout-section textarea,
#orderNotes {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.checkout-section textarea:focus,
#orderNotes:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1), inset 0 2px 4px rgba(0,0,0,0.02);
}

.checkout-section textarea::placeholder,
#orderNotes::placeholder {
  color: var(--gray-400);
  font-style: italic;
}

.delivery-input textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  resize: none;
  font-family: inherit;
}

.delivery-input textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Location Buttons */
.location-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.use-location-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.use-location-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.use-location-btn.secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.use-location-btn.secondary:hover {
  background: var(--gray-200);
}

/* Map Picker Modal */
.map-picker-content {
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Desktop: Full screen map modal */
@media (min-width: 768px) {
  .map-picker-content {
    max-width: 95vw !important;
    width: 95vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
    border-radius: var(--radius-lg);
  }
}

.map-picker-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow: hidden;
}

.map-container {
  width: 100%;
  height: 350px;
  min-height: 350px;
  flex: 1;
  border-radius: var(--radius);
  background: var(--gray-200);
  position: relative;
  overflow: hidden;
}

/* Desktop: Larger map */
@media (min-width: 768px) {
  .map-container {
    height: auto;
    min-height: 500px;
  }
}

.map-container::before {
  content: 'Loading map...';
  color: var(--gray-500);
  font-size: 0.9rem;
  position: absolute;
  z-index: 0;
}

/* When map is loaded, hide the loading text */
.map-container > * {
  position: relative;
  z-index: 1;
}

/* Map picker modal should be centered */
#mapPickerModal {
  align-items: center;
}

/* Google Places Autocomplete dropdown - MUST show above modal */
.pac-container {
  z-index: 999999 !important;
  background-color: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 30px rgba(0,0,0,0.3) !important;
  border: 2px solid var(--primary) !important;
  margin-top: 2px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  width: auto !important;
  min-width: 300px !important;
}

.pac-item {
  padding: 12px 15px !important;
  cursor: pointer !important;
  border-top: 1px solid var(--gray-100) !important;
  line-height: 1.4 !important;
}

.pac-item:first-child {
  border-top: none !important;
}

.pac-item:hover,
.pac-item-selected {
  background-color: var(--gray-100) !important;
}

.pac-icon {
  margin-right: 12px !important;
  margin-top: 2px !important;
}

.pac-item-query {
  font-weight: 600 !important;
  color: var(--dark) !important;
  font-size: 0.95rem !important;
}

.pac-matched {
  font-weight: 700 !important;
}

.map-search-box {
  position: relative;
  margin-bottom: 1rem;
  z-index: 10;
}

.map-search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  z-index: 2;
  pointer-events: none;
}

.map-search-box input {
  width: 100%;
  padding: 1rem 1rem 1rem 2.75rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.map-search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.selected-location-info {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

.selected-location-info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.map-picker-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  justify-content: flex-end;
}

.map-picker-actions .btn-ghost {
  padding: 0.75rem 1.5rem;
}

.map-picker-actions .btn-primary {
  padding: 0.75rem 1.5rem;
}

/* Delivery address readonly style */
#deliveryAddress[readonly] {
  background: var(--gray-50);
  cursor: pointer;
}

#deliveryAddress[readonly]:focus {
  border-color: var(--gray-300);
  box-shadow: none;
}

.delivery-instructions {
  margin-top: 0.75rem;
}

.delivery-instructions input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.checkout-item:last-child {
  border-bottom: none;
}

.checkout-item-name {
  font-size: 0.9rem;
  color: var(--gray-700);
}

.checkout-item-qty {
  color: var(--gray-500);
  font-size: 0.85rem;
}

.checkout-item-price {
  font-weight: 600;
  color: var(--dark);
}

.cost-breakdown {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--gray-600);
}

.cost-row.total {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  border-top: 2px solid var(--gray-200);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.checkout-footer {
  padding: 1rem;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  padding-bottom: calc(var(--safe-area-bottom) + 1rem);
}

.checkout-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.75rem;
}

.checkout-note i {
  color: var(--primary);
}

/* ===== SUCCESS SCREEN ===== */
.success-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.success-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  animation: scaleIn 0.5s ease;
}

.success-icon i {
  font-size: 3rem;
  color: var(--secondary);
}

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-content h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.order-number {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.success-message {
  color: var(--gray-500);
  margin-bottom: 2rem;
  max-width: 300px;
}

.order-details {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1rem;
  width: 100%;
  max-width: 300px;
  margin-bottom: 2rem;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.detail-row i {
  color: var(--primary);
  width: 20px;
  text-align: center;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 300px;
}

/* ===== MODALS ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 1100;
  padding: 0;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ===== ENHANCED PRODUCT MODAL ===== */
.product-modal-content {
  max-height: 95vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-detail-enhanced {
  display: flex;
  flex-direction: column;
}

/* Image Gallery */
.product-gallery {
  position: relative;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.main-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.main-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.main-image-container .image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 4rem;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
  z-index: 5;
}

.gallery-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

.image-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Thumbnail Strip */
.thumbnail-strip {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}

.thumbnail-strip:empty {
  display: none;
}

.thumbnail-item {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.thumbnail-item.active {
  border-color: var(--primary);
}

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

/* Product Info Section */
.product-info-section {
  padding: 1.25rem;
  padding-bottom: 100px;
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.product-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  flex: 1;
}

.product-badge {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.product-brand {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.product-brand:empty {
  display: none;
}

.product-info-section .product-description {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.7;
  max-height: 100px;
  overflow-y: auto;
}

.product-price-display {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1.25rem;
  text-align: center;
}

/* Service Product Selector */
.service-product-selector {
  text-align: center;
  padding: 1rem 0;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.service-badge i {
  font-size: 1rem;
}

.service-description {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.custom-price-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.custom-price-input .currency-label {
  font-weight: 700;
  color: var(--gray-600);
  font-size: 1.1rem;
}

.custom-price-input input {
  width: 150px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: #fff;
  color: var(--primary);
}

.custom-price-input input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.suggested-price {
  color: var(--gray-500);
  font-size: 0.85rem;
}

.service-price-label {
  font-size: 1.25rem;
  color: #10b981;
}

/* Product Card Service Badge */
.product-card .service-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
}

/* Quantity Selector Enhanced */
.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.quantity-selector input {
  width: 70px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: #fff;
}

.quantity-selector .qty-btn {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
}

.quantity-selector .qty-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Add to Cart Button */
.btn-add-to-cart {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
  transition: all 0.3s;
  z-index: 10;
}

.btn-add-to-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.btn-add-to-cart:disabled {
  background: var(--gray-300);
  box-shadow: none;
  cursor: not-allowed;
}

/* Legacy support */
.product-detail { position: relative; }
.product-image-large { display: none; }
.product-info { display: none; }

/* Desktop Styles */
@media (min-width: 768px) {
  .modal {
    align-items: center;
    padding: 2rem;
  }
  
  .product-modal-content {
    max-width: 950px;
    width: 95%;
    max-height: 90vh;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
  }
  
  .product-detail-enhanced {
    flex-direction: row;
    flex: 1;
    min-height: 500px;
    max-height: calc(90vh - 40px);
  }
  
  .product-gallery {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  }
  
  .main-image-container {
    flex: 1;
    max-height: none;
    min-height: 350px;
    aspect-ratio: auto;
  }
  
  .product-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: calc(90vh - 40px);
    overflow-y: auto;
    padding: 2rem;
    padding-bottom: 1.5rem;
  }
  
  .product-info-section .product-description {
    flex: 1;
    max-height: none;
    overflow-y: visible;
  }
  
  .quantity-selector {
    margin-top: auto;
    padding-top: 1rem;
  }
  
  .btn-add-to-cart {
    position: relative;
    margin-top: 1.5rem;
  }
  
  .product-header h2 {
    font-size: 1.75rem;
  }
  
  .product-price-display {
    font-size: 2.25rem;
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .product-modal-content {
    max-width: 1100px;
  }
  
  .product-detail-enhanced {
    min-height: 550px;
  }
  
  .main-image-container {
    min-height: 450px;
  }
}

/* Filter Modal */
.filter-content {
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.filter-options {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.filter-group {
  margin-bottom: 1.25rem;
}

.filter-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #fff;
}

.price-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-range input {
  flex: 1;
}

.price-range span {
  color: var(--gray-500);
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
}

.filter-actions .btn-ghost {
  flex: 1;
}

.filter-actions .btn-primary {
  flex: 2;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(var(--safe-area-bottom) + 80px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast i {
  color: var(--secondary);
}

/* ===== APP LOADER ===== */
.app-loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(124, 58, 237, 0.9), #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  visibility: visible;
  opacity: 1;
}

.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  color: #fff;
  animation: float 3s ease-in-out infinite;
}

.loader-logo {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loader-logo img {
  width: 45px;
  height: auto;
}

.loader-text {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.loader-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loader-hint {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

/* ===== LOADING ===== */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.loading-overlay.show {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 900;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .shops-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-content:not(.product-modal-content) {
    max-width: 500px;
    margin: auto;
    border-radius: var(--radius-lg);
  }
  
  .modal:not(:has(.product-modal-content)) {
    align-items: center;
  }
}

@media (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .shops-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== SKELETON LOADERS ===== */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

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

.skeleton-card {
  pointer-events: none;
}

.skeleton-logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.skeleton-image {
  aspect-ratio: 1;
  width: 100%;
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

/* ===== OUT OF STOCK ===== */
.product-card {
  position: relative;
}

.product-card.out-of-stock {
  opacity: 0.6;
}

.product-card.out-of-stock .product-image {
  filter: grayscale(50%);
}

.out-of-stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 5;
}

/* Search result shop name */
.shop-name-small {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ===== INFINITE SCROLL ===== */
.load-more-sentinel {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}

.load-more-spinner {
  font-size: 0.85rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
