/* Dedicated phone experience. Desktop styles remain in style.css/components.css. */
@media (max-width: 768px) {
  :root {
    --mobile-gutter: 14px;
  }

  body {
    background: #f6f8fb;
  }

  .container {
    width: 100%;
    padding-left: var(--mobile-gutter);
    padding-right: var(--mobile-gutter);
  }

  .top-announcement-bar,
  .header-actions .util-btn,
  .header-actions .btn-upload-rx,
  .hero-side-card,
  .quick-view-overlay-btn,
  .floating-bottom-cart-bar {
    display: none !important;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.97);
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'brand actions'
      'search search';
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .brand-logo-group { grid-area: brand; min-width: 0; gap: 8px; }
  .brand-icon-wrap { width: 36px; height: 36px; border-radius: 10px; }
  .brand-icon-wrap svg { width: 20px; height: 20px; }
  .brand-text h1 { font-size: 1rem; gap: 4px; white-space: nowrap; }
  .brand-text p { font-size: 0.56rem; letter-spacing: 0.04em; }

  .header-actions { grid-area: actions; gap: 8px; }
  .action-btn.btn-upload-rx {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
  }
  .action-btn.btn-upload-rx span { display: none; }
  .action-btn.btn-upload-rx svg { width: 19px; height: 19px; }
  .cart-button { width: 42px; height: 36px; padding: 0; border-radius: 10px; }
  .cart-badge { top: -5px; right: -5px; }

  .header-search-container { grid-area: search; width: 100%; max-width: none; }
  .header-search-box { height: 42px; padding: 6px 13px; border-radius: 12px; }
  .header-search-box input { font-size: 0.84rem; }
  .quick-search-tags { margin-top: 7px; gap: 6px; }
  .quick-tag-chip { padding: 4px 9px; font-size: 0.68rem; }

  .categories-nav-section { position: sticky; top: 95px; z-index: 1090; padding: 8px 0; background: #fff; }
  .category-scroll-container { margin: 0 -2px; padding: 0 2px 2px; gap: 7px; }
  .category-pill { padding: 7px 11px; font-size: 0.73rem; border-radius: 10px; }
  .category-pill svg { width: 14px; height: 14px; }

  .hero-section { padding: 14px 0 10px; }
  .hero-grid { display: block; }
  .hero-banner-card {
    min-height: 214px;
    padding: 20px;
    border-radius: 18px;
    background: linear-gradient(145deg, #075f52, #049177);
  }
  .hero-pill { margin-bottom: 12px; font-size: 0.68rem; }
  .hero-banner-card h2 { max-width: 310px; font-size: 1.35rem; line-height: 1.18; margin-bottom: 8px; }
  .hero-banner-card p { max-width: 340px; font-size: 0.77rem; line-height: 1.45; margin-bottom: 16px; }
  .hero-btn-group { gap: 9px; }
  .btn-hero-primary, .btn-hero-secondary { min-height: 42px; padding: 9px 12px; font-size: 0.78rem; border-radius: 12px; }

  .trust-badges-bar { padding: 6px 0 8px; }
  .trust-badges-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .trust-badge-item { min-height: 92px; padding: 11px 10px; align-items: flex-start; gap: 8px; border-radius: 13px; }
  .trust-icon-box { width: 32px; height: 32px; flex: 0 0 32px; }
  .trust-text h4 { font-size: 0.72rem; line-height: 1.25; }
  .trust-text p { display: none; }

  .main-catalog-section { padding: 18px 0 25px; }
  .catalog-header { align-items: flex-end; margin-bottom: 13px; gap: 10px; }
  .catalog-header-title { min-width: 0; }
  .catalog-header-title h2 { font-size: 1.12rem; line-height: 1.25; }
  .catalog-header-title p { font-size: 0.7rem; line-height: 1.35; }
  .catalog-controls { gap: 0; }
  .sort-dropdown-wrap { padding: 5px 8px; border-radius: 9px; font-size: 0.68rem; gap: 4px; }
  .sort-select { max-width: 106px; font-size: 0.68rem; }

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

  /* Blinkit-style Category Grid */
  .category-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 10px;
  }
  .category-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s ease;
  }
  .category-grid-item:active {
    transform: scale(0.95);
  }
  .category-grid-img-wrap {
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 6px;
    border: 1px solid rgba(0,0,0,0.03);
    overflow: hidden;
  }
  .category-grid-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .category-grid-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 70px;
  }
  .product-card { min-width: 0; padding: 10px; border-radius: 14px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06); }
  .product-card:hover { transform: none; }
  .card-badges-top { top: 8px; left: 8px; right: 8px; }
  .badge-discount, .badge-rx, .badge-cold { max-width: 48%; padding: 2px 6px; font-size: 0.57rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .product-image-container { height: 116px; margin-bottom: 9px; border-radius: 10px; background: #fff; }
  .product-image-container img { width: 100%; height: 100%; object-fit: cover; }
  .product-category-tag { font-size: 0.59rem; margin-bottom: 3px; }
  .product-title { min-height: 2.45em; margin-bottom: 3px; font-size: 0.79rem; line-height: 1.25; }
  .product-salt { height: 1.25em; margin-bottom: 4px; font-size: 0.64rem; }
  .product-pack-size { height: 1.3em; margin-bottom: 7px; font-size: 0.65rem; }
  .product-card-footer { gap: 6px; padding-top: 8px; }
  .badge-low-stock { bottom: 44px; left: 8px; font-size: 0.55rem; padding: 2px 6px; }
  .current-price { font-size: 0.96rem; }
  .mrp-price { font-size: 0.63rem; }
  .btn-add-cart { min-width: 66px; min-height: 34px; justify-content: center; padding: 6px 9px; border-radius: 9px; font-size: 0.73rem; }
  .btn-add-cart svg { width: 14px; height: 14px; }
  .qty-stepper-wrap { min-height: 34px; border-radius: 9px; }
  .qty-stepper-wrap button { min-width: 25px; padding: 5px 7px; }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 2000;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #94a3b8;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .bottom-nav-item svg {
    width: 23px;
    height: 23px;
    transition: all 0.25s ease;
  }

  .bottom-nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .bottom-nav-item.active {
    color: var(--primary-600, #059669);
  }

  .bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--primary-600, #059669);
    border-radius: 0 0 4px 4px;
  }

  .bottom-nav-item.active .nav-icon {
    transform: translateY(-2px);
  }

  .bottom-nav-item:not(.active):hover {
    color: #64748b;
  }

  .nav-cart-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--danger-500);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
    border: 2px solid white;
    font-weight: 700;
  }

  .nav-wishlist-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
    border: 2px solid white;
    font-weight: 700;
  }

  .wishlist-button { width: 36px; height: 36px; padding: 0; }
  .wishlist-badge { top: -4px; right: -4px; font-size: 0.6rem; min-width: 14px; height: 14px; }

  .cart-drawer { width: 100vw !important; max-width: 100vw !important; height: 100dvh; }
  .cart-header { padding: 15px var(--mobile-gutter); }
  .cart-header-title { gap: 8px; }
  .cart-header-title h3 { font-size: 1.05rem; }
  .cart-count-chip { font-size: 0.7rem; }
  .free-shipping-tracker { padding: 10px var(--mobile-gutter); }
  .cart-items-container { padding: 12px var(--mobile-gutter); gap: 10px; }
  .cart-item-row { gap: 10px; padding-bottom: 10px; }
  .cart-item-img { width: 52px; height: 52px; }
  .cart-item-title { font-size: 0.82rem; }
  .cart-footer { padding: 10px var(--mobile-gutter) max(12px, env(safe-area-inset-bottom)); }
  .cart-footer .btn-checkout-proceed { min-height: 44px; font-size: 0.88rem; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-card, .modal-card.large, .modal-card.small { width: 100%; max-width: 100%; max-height: 92dvh; margin: 0; border-radius: 20px 20px 0 0; }
  .modal-header { padding: 15px var(--mobile-gutter); }
  .modal-body { padding: 14px var(--mobile-gutter); }
  .modal-footer { padding: 12px var(--mobile-gutter) max(14px, env(safe-area-inset-bottom)); }

  /* Toast - center on mobile */
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 80px;
  }
  .toast-item {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  .brand-text p { display: none; }
  .trust-badge-item { min-height: 78px; }
  .trust-icon-box { display: none; }
  .product-image-container { height: 102px; }
  .btn-add-cart { min-width: 58px; padding: 5px 7px; }

  /* Smart Reorder mobile */
  .smart-reorder-section { padding: 14px 0 8px; }
  .smart-reorder-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .smart-reorder-header { margin-bottom: 12px; }
  .smart-reorder-title h3 { font-size: 1rem; }
  .smart-reorder-title p { font-size: 0.72rem; }
  .sr-card { padding: 10px; }
  .sr-card-img { height: 80px; }
  .sr-card-title { font-size: 0.76rem; }
  .sr-card-price { font-size: 0.88rem; }
  .sr-badge { font-size: 0.52rem; padding: 2px 6px; }

  /* Profile mobile */
  .profile-header { padding: 14px; gap: 12px; }
  .profile-avatar { width: 48px; height: 48px; font-size: 1rem; }
  .profile-info h2 { font-size: 1rem; }
  .profile-stats-row { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .profile-stat-card { padding: 10px 4px; }
  .profile-stat-value { font-size: 1rem; }
  .profile-stat-label { font-size: 0.6rem; }
  .profile-quick-actions { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .profile-action-btn { padding: 10px 4px; }
  .profile-action-icon { width: 32px; height: 32px; font-size: 0.95rem; }
  .profile-action-btn span { font-size: 0.65rem; }
  .profile-form-row { grid-template-columns: 1fr; }
  .profile-orders-list { max-height: 280px; }
  .profile-order-bottom { flex-direction: column; align-items: flex-start; }
  .profile-order-actions { margin-left: 0; margin-top: 4px; }
  .otp-digit { width: 42px; height: 50px; font-size: 1.2rem; }
  .otp-input-group { gap: 8px; }

  /* Dark mode bottom nav */
  [data-theme="dark"] .mobile-bottom-nav {
    background: rgba(11, 17, 32, 0.95);
    border-top-color: rgba(255,255,255,0.06);
    box-shadow: 0 -2px 20px rgba(0,0,0,0.3);
  }

  [data-theme="dark"] .bottom-nav-item {
    color: #64748b;
  }

  [data-theme="dark"] .bottom-nav-item.active {
    color: #34d399;
  }

  [data-theme="dark"] .bottom-nav-item.active::before {
    background: #34d399;
  }

  [data-theme="dark"] .bottom-nav-item:not(.active):hover {
    color: #94a3b8;
  }

  /* Hero slides mobile */
  .hero-slide {
    padding: 10px 0;
  }
  .hero-dots {
    margin-top: 8px !important;
  }

  /* Faster stagger on mobile */
  .stagger-item {
    animation-duration: 0.35s;
  }

  /* Smooth skeleton removal */
  .skeleton-card {
    transition: opacity 0.3s ease;
  }
}

.badge-cold {
  background: rgba(2, 132, 199, 0.2) !important;
  color: #0284c7 !important;
  font-weight: 800;
}
