/* ===== OK MART - COMMON.CSS ===== */
/* Global styles - FIXED FOR SCROLLING */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --primary-light: #e8f8ef;
  --bg-light: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #1a1e2b;
  --text-muted: #6b7280;
  --border-light: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
  --radius-card: 14px;
  --radius-btn: 30px;
}

html {
  width: 100%;
  height: 100%;
}

/* CRITICAL: Body must allow scrolling */
body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-light);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Allow scrolling */
  overflow-y: visible !important;
  overflow-x: hidden !important;
  position: relative;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
}

input:focus, textarea:focus, select:focus {
  outline: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.loading-state p {
  margin-top: 12px;
  font-size: 0.9rem;
}

.skeleton-card {
  width: 140px;
  height: 180px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-card);
  flex-shrink: 0;
}

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

.loading-placeholder {
  display: flex;
  gap: 12px;
  padding: 10px 0;
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.empty-state p {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.toast-message {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

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

.toast-message.success {
  background: var(--primary-dark);
}

.sticky-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  padding: 12px 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.3s;
  border-top: 2px solid var(--primary);
  max-width: 480px;
  margin: 0 auto;
}

.sticky-cart-bar.visible {
  transform: translateY(0);
}

.sticky-cart-bar .cart-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sticky-cart-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cart-item-count-small {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 600;
}

.cart-total-small {
  font-weight: 700;
  font-size: 1.1rem;
}

.view-cart-btn {
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.95rem;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border-light);
  padding: 8px 16px;
  display: flex;
  justify-content: space-around;
  z-index: 90;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 40px;
}

.nav-icon {
  font-size: 1.2rem;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.fab-whatsapp {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 52px;
  height: 52px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
  z-index: 150;
  text-decoration: none;
}

.fab-whatsapp span {
  font-size: 26px;
}

.fab-call {
  position: fixed;
  bottom: 155px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 150;
  text-decoration: none;
  border: 1px solid var(--border-light);
}

.fab-call span {
  font-size: 20px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  position: relative;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #f1f5f9;
}

.product-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.current-price {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-dark);
}

.mrp-price {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.discount-badge {
  margin-left: auto;
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 20px;
}

.add-btn, .add-to-cart-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-btn);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  cursor: pointer;
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary-dark);
  color: white;
  padding: 4px 10px;
  border-radius: 40px;
  font-size: 0.65rem;
  font-weight: 600;
  z-index: 2;
}

.offer-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef4444;
  color: white;
  padding: 4px 10px;
  border-radius: 40px;
  font-size: 0.65rem;
  font-weight: 600;
  z-index: 2;
}

.hidden {
  display: none !important;
}

@media (min-width: 500px) {
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .bottom-nav,
  .sticky-cart-bar {
    width: 480px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  
  .sticky-cart-bar.visible {
    transform: translateX(-50%) translateY(0);
  }
}



.wishlist-header-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.wishlist-header-btn:active {
  background: #fee2e2;
  transform: scale(0.92);
}
