/* ===== OK MART - CATEGORY PAGE STYLES ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --primary-light: #e8f8ef;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1a1e2b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.06);
  --radius: 16px;
  --transition: all .2s cubic-bezier(.4,0,.2,1);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app-container { max-width: 480px; margin: 0 auto; position: relative; min-height: 100vh; }

/* ===== HEADER ===== */
.category-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 10px; }

.back-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.3rem; font-weight: 600;
  color: var(--text); transition: var(--transition);
}
.back-btn:active { background: var(--border); transform: scale(.92); }

.category-title { font-size: 1.2rem; font-weight: 700; }

.header-right { display: flex; align-items: center; gap: 8px; }

.search-btn, .cart-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.1rem; transition: var(--transition);
  position: relative;
}

.cart-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--primary); color: white; font-size: .55rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

/* ===== CATEGORY HERO ===== */
.category-hero {
  background: linear-gradient(135deg, var(--primary-light), #d4fcdf);
  margin: 12px 14px; padding: 20px 18px; border-radius: 20px;
}

.hero-content { display: flex; align-items: center; gap: 14px; }
.hero-icon { font-size: 3rem; }
.hero-text h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.hero-text p { color: var(--muted); font-size: .85rem; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; position: relative;
}
.filter-info { display: flex; align-items: center; gap: 8px; }
.product-count { font-size: .85rem; color: var(--muted); font-weight: 500; }

.sort-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: var(--card); border: 1.5px solid var(--border);
  border-radius: 30px; font-size: .8rem; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.sort-btn:active { background: var(--bg); }

.sort-dropdown {
  position: absolute; top: 100%; right: 14px;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-md);
  border: 1px solid var(--border); min-width: 180px; z-index: 50;
  display: none; overflow: hidden;
}
.sort-dropdown.show { display: block; }
.sort-option {
  padding: 12px 16px; cursor: pointer; font-size: .85rem; font-weight: 500;
  border-bottom: 1px solid var(--border); transition: background .15s;
}
.sort-option:last-child { border-bottom: none; }
.sort-option:hover { background: var(--bg); }
.sort-option.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* ===== MAIN CONTENT ===== */
.category-main { padding: 0 14px 100px; }

/* ===== LOADING GRID ===== */
.loading-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.skeleton-card {
  height: 240px; background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: var(--card); border-radius: var(--radius); padding: 10px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  position: relative; cursor: pointer; transition: var(--transition);
  animation: fadeInUp .3s ease forwards; opacity: 0;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.product-card:nth-child(1) { animation-delay: .02s; }
.product-card:nth-child(2) { animation-delay: .04s; }
.product-card:nth-child(3) { animation-delay: .06s; }
.product-card:nth-child(4) { animation-delay: .08s; }
.product-card:nth-child(n+5) { animation-delay: .1s; }

.product-card:active { transform: scale(.98); }
.product-image {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 12px; margin-bottom: 8px; background: #f1f5f9;
}
.product-name { font-weight: 700; font-size: .85rem; line-height: 1.3; margin-bottom: 2px; }
.product-unit { font-size: .65rem; color: var(--muted); display: block; margin-bottom: 6px; }
.price-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.current-price { font-weight: 800; font-size: .9rem; }
.mrp-price { font-size: .65rem; color: var(--muted); text-decoration: line-through; }
.discount-badge { margin-left: auto; background: #fee2e2; color: #dc2626; font-size: .6rem; font-weight: 700; padding: 2px 6px; border-radius: 20px; }
.add-btn {
  width: 100%; padding: 8px; background: var(--primary-light);
  border: 1.5px solid var(--primary); border-radius: 30px;
  color: var(--primary-dark); font-weight: 700; font-size: .7rem;
  text-transform: uppercase; cursor: pointer; transition: var(--transition);
}
.add-btn:active { background: var(--primary); color: white; }
.wishlist-btn, .share-btn {
  position: absolute; top: 6px; background: white;
  border: 1px solid var(--border); border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; font-size: .8rem; z-index: 2;
}
.wishlist-btn { right: 40px; }
.share-btn { right: 6px; }
.product-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--primary-dark); color: white; padding: 3px 8px;
  border-radius: 20px; font-size: .6rem; font-weight: 600; z-index: 2;
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 4rem; opacity: .5; display: block; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.browse-btn {
  display: inline-block; background: var(--primary); color: white;
  padding: 12px 24px; border-radius: 40px; text-decoration: none; font-weight: 600;
}

/* ===== FLOATING CART BAR ===== */
.floating-cart-bar {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%) translateY(20px);
  width: calc(100% - 28px); max-width: 452px; background: var(--card);
  padding: 12px 16px; border-radius: 16px; box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  z-index: 95; border: 1px solid var(--border);
  opacity: 0; visibility: hidden; transition: all .3s cubic-bezier(.4,0,.2,1);
}
.floating-cart-bar.visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.cart-bar-inner { display: flex; align-items: center; justify-content: space-between; }
.cart-bar-info { display: flex; align-items: center; gap: 8px; }
.cart-bar-icon { font-size: 1.3rem; }
.cart-bar-count { font-weight: 600; font-size: .9rem; }
.cart-bar-btn {
  background: var(--primary); color: white; padding: 10px 20px;
  border-radius: 30px; font-weight: 700; font-size: .85rem;
  text-decoration: none; transition: var(--transition);
}
.cart-bar-btn:active { background: var(--primary-dark); transform: scale(.96); }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); 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(--muted); font-size: .65rem;
  gap: 2px; padding: 6px 12px; border-radius: 40px; transition: var(--transition);
}
.nav-item.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }
.nav-item span:first-child { font-size: 1.1rem; }

/* ===== FLOATING BUTTONS ===== */
.fab-whatsapp {
  position: fixed; bottom: 90px; right: 14px;
  width: 48px; height: 48px; background: #25D366; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(37,211,102,.3); z-index: 80;
  text-decoration: none; font-size: 1.3rem; transition: var(--transition);
}
.fab-whatsapp:active { transform: scale(.9); }
.fab-call {
  position: fixed; bottom: 150px; right: 14px;
  width: 42px; height: 42px; background: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); z-index: 80; text-decoration: none;
  font-size: 1.1rem; border: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast-message {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(100px);
  padding: 12px 24px; border-radius: 40px; font-weight: 500; z-index: 999;
  opacity: 0; transition: all .3s; white-space: nowrap; pointer-events: none;
}
.toast-message.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== RESPONSIVE ===== */
@media (min-width: 500px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .app-container { max-width: 720px; }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
