/* ============================================================
   EAZYMART - PREMIUM MOBILE UI (Swiggy/Zepto Style)
   Modern, Clean, Professional Mobile Experience
============================================================ */

/* ========== MOBILE-SPECIFIC IMPROVEMENTS ========== */
@media (max-width: 768px) {
  
  /* BODY & GLOBAL SPACING */
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }

  /* HEADER - Premium Style */
  .header,
  .navbar {
    background: linear-gradient(135deg, #042853 0%, #063d7a 100%) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 12px 16px !important;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .logo {
    max-height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  }

  /* CATEGORY ICONS - Fix Letter Display */
  .category-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 12px 8px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-width: 85px;
  }

  .category-icon-item:active {
    transform: scale(0.95);
  }

  .category-icon-item.active {
    background: linear-gradient(135deg, #FFD839 0%, #f0c830 100%);
    border-color: #e6c230;
    box-shadow: 0 4px 12px rgba(255, 216, 57, 0.3);
  }

  .category-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #042853 0%, #063d7a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(4, 40, 83, 0.2);
  }

  .category-icon img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
  }

  .category-icon-item span {
    font-size: 11px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    line-height: 1.3;
    max-width: 70px;
  }

  .category-icon-item.active span {
    color: #042853;
  }

  /* DAILY DEALS SECTION - Premium Header */
  .product-row-header {
    margin-bottom: 16px;
    padding: 0 16px;
  }

  .product-row-header h4 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .gold-primary {
    color: #FFD839 !important;
    text-shadow: 0 2px 4px rgba(255, 216, 57, 0.2);
  }

  .blue-primary {
    color: #042853 !important;
  }

  /* PRODUCT CARDS - Premium Elevation */
  .product-card,
  .product-row-item-card {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: white !important;
    margin-bottom: 4px;
  }

  .product-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  }

  /* PRODUCT IMAGE CONTAINER */
  .product-card-image-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    padding: 16px;
    position: relative;
  }

  .product-card-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 140px;
  }

  /* BADGES - Modern Design */
  .limited-deal-banner {
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    z-index: 10;
    gap: 8px;
  }

  .discount-percent-badge {
    background: linear-gradient(135deg, #ff4757 0%, #d32f2f 100%) !important;
    color: white !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4) !important;
    letter-spacing: 0.3px;
  }

  .deal-text-badge {
    background: white !important;
    color: #ff4757 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border: 1.5px solid #ff4757 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* PRODUCT CARD BODY */
  .product-card-body,
  .card-body {
    padding: 12px !important;
  }

  .product-card-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 4px !important;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-card-unit {
    font-size: 12px !important;
    color: #7f8c8d !important;
    margin-bottom: 8px !important;
  }

  /* PRICES - Premium Typography */
  .product-price {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #042853 !important;
  }

  .product-price-old {
    font-size: 14px !important;
    color: #95a5a6 !important;
    text-decoration: line-through !important;
    font-weight: 500 !important;
  }

  /* BUTTONS - Modern iOS Style */
  .btn-gold,
  .btn-add-cart {
    background: linear-gradient(135deg, #FFD839 0%, #f0c830 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 8px 16px !important;
    font-weight: 700 !important;
    color: #042853 !important;
    box-shadow: 0 4px 12px rgba(255, 216, 57, 0.3) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 14px !important;
  }

  .btn-gold:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(255, 216, 57, 0.4) !important;
  }

  /* QUANTITY CONTROL - Premium Style */
  .quantity-control-card {
    background: linear-gradient(135deg, #FFD839 0%, #f0c830 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 6px 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 4px 12px rgba(255, 216, 57, 0.3) !important;
  }

  .quantity-control-card button {
    background: #042853 !important;
    border: none !important;
    color: white !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(4, 40, 83, 0.2) !important;
  }

  .quantity-control-card span {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #042853 !important;
    min-width: 24px !important;
    text-align: center !important;
  }

  /* BOTTOM NAVIGATION - Premium iOS Style */
  .bottom-nav,
  .navbar-bottom {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    padding: 8px 0 !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    color: #7f8c8d !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
    position: relative;
  }

  .nav-item i {
    font-size: 22px;
  }

  .nav-item.active {
    color: #FFD839 !important;
  }

  .nav-item.active i {
    transform: scale(1.1);
  }

  /* CART BADGE */
  .cart-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, #ff4757 0%, #d32f2f 100%) !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
  }

  /* CHAT BUBBLE - Better Positioning */
  .chat-bubble,
  [class*="chat"] {
    position: fixed !important;
    bottom: 90px !important; /* Above bottom nav */
    right: 20px !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4) !important;
    z-index: 999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .chat-bubble:active {
    transform: scale(0.9) !important;
  }

  /* FORMS - Premium Style */
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  textarea,
  .form-control {
    background: white !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #2c3e50 !important;
    transition: all 0.2s ease !important;
  }

  input:focus,
  textarea:focus,
  .form-control:focus {
    border-color: #FFD839 !important;
    box-shadow: 0 0 0 4px rgba(255, 216, 57, 0.1) !important;
    outline: none !important;
  }

  /* CUSTOM RADIO BUTTONS */
  input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
  }

  input[type="radio"]:checked {
    border-color: #FFD839;
    background: #FFD839;
    box-shadow: 0 0 0 4px rgba(255, 216, 57, 0.1);
  }

  input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #042853;
  }

  label {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    cursor: pointer;
  }

  /* CURRENT LOCATION BUTTON */
  .btn[onclick*="getCurrentLocation"],
  button:contains("Current Location") {
    background: linear-gradient(135deg, #FFD839 0%, #f0c830 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 20px !important;
    font-weight: 700 !important;
    color: #042853 !important;
    box-shadow: 0 4px 12px rgba(255, 216, 57, 0.3) !important;
    font-size: 15px !important;
  }

  /* SKELETON LOADER - Shimmer Effect */
  .skeleton-box,
  .skeleton-line {
    background: linear-gradient(
      90deg,
      #f0f0f0 25%,
      #e0e0e0 50%,
      #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
  }

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

  /* SEARCH BAR - Premium Style */
  .search-input,
  input[type="search"] {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid #e9ecef !important;
    border-radius: 16px !important;
    padding: 12px 16px 12px 48px !important;
    font-size: 15px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }

  .search-input::placeholder {
    color: #95a5a6 !important;
    font-weight: 500 !important;
  }

  /* SPACING & PADDING */
  .container,
  .container-fluid {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .product-row-container {
    margin-bottom: 32px !important;
  }

  /* SCROLLBAR - Minimal Style */
  ::-webkit-scrollbar {
    width: 4px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
  }
}

/* ========== DARK MODE MOBILE IMPROVEMENTS ========== */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  
  .category-icon-item {
    background: linear-gradient(135deg, #2d323a 0%, #242830 100%);
    border-color: #3a3f4a;
  }

  .category-icon-item.active {
    background: linear-gradient(135deg, #FFD839 0%, #f0c830 100%);
  }

  .product-card,
  .product-row-item-card {
    background: #242830 !important;
    border-color: #3a3f4a !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  }

  .product-card-title {
    color: #f5f5f7 !important;
  }

  .product-card-unit {
    color: #9ca3af !important;
  }

  .product-price {
    color: #FFD839 !important;
  }

  .bottom-nav,
  .navbar-bottom {
    background: rgba(30, 33, 38, 0.95) !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
  }

  input[type="text"],
  input[type="tel"],
  input[type="email"],
  textarea,
  .form-control {
    background: #242830 !important;
    border-color: #3a3f4a !important;
    color: #f5f5f7 !important;
  }

  label {
    color: #f5f5f7 !important;
  }
}
