/* =========================================
   MOBILE FIRST PREMIUM STYLES
   Chitra Crop Science - High End Responsive
   ========================================= */

/* --- 1. Typography & Global --- */
:root {
  --header-height: 70px;
  --bottom-bar-height: 60px;
}

html, body {
  overflow-x: hidden; /* Prevent horizontal scroll */
  -webkit-tap-highlight-color: transparent; /* Remove blue highlight on tap */
}

body {
  font-size: 16px; /* Readability boost */
  line-height: 1.6;
}

/* Premium smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Headings adjustment for mobile */
@media (max-width: 768px) {
  h1 { font-size: 2rem !important; }
  h2 { font-size: 1.75rem !important; }
  h3 { font-size: 1.5rem !important; }
  h4 { font-size: 1.25rem !important; }
  h5, h6 { font-size: 1.1rem !important; }
  
  .section {
    padding: 40px 0 !important; /* Cleaner spacing on mobile */
  }
}

/* --- 2. Navigation (Hamburger & Header) --- */
.navbar {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08); /* Premium shadow */
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(10px);
}

.navbar-brand img {
  height: 40px; /* Slightly larger brand */
}

/* Hamburger Menu Toggler */
.navbar-toggler {
  border: none;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

/* Animated Hamburger Icon */
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(46, 125, 50, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile Menu Dropdown */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: #fff;
    padding: 1rem;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  .navbar-nav .nav-link {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s;
  }

  .navbar-nav .nav-link:active,
  .navbar-nav .nav-link.active {
    background-color: var(--mint-100);
    color: var(--primary);
  }
}

/* --- 3. Touch Targets & Buttons --- */
button, a.btn, .nav-link {
  min-height: 44px; /* Finger-friendly */
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn {
  border-radius: 50px; /* Modern rounded buttons */
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 12px 24px;
}

/* --- 4. Layout & Cards --- */
@media (max-width: 768px) {
  .container, .container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .row {
    margin-left: -10px;
    margin-right: -10px;
  }
  
  .col, .col-12, .col-md-6, .col-lg-4 {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Stack cards nicely */
  .card {
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-radius: 16px !important; /* Soft corners */
  }

  .card-img-top-custom {
    height: 180px; /* Adjust for mobile */
    padding: 10px;
  }
}

/* Explicit Grid for Products */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }
}

/* --- 5. Mobile Bottom Bar (Premium Look) --- */
.fixed-bottom {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.05) !important;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
  padding-bottom: env(safe-area-inset-bottom); /* iPhone X+ support */
  z-index: 1030;
}

.fixed-bottom .btn-link {
  color: #666;
  text-decoration: none;
  font-size: 11px; /* Small text for labels */
  font-weight: 500;
  flex-direction: column;
  padding: 8px 0;
  min-height: auto; /* Override general button rule */
  width: 100%;
}

.fixed-bottom .btn-link i {
  font-size: 1.4rem;
  margin-bottom: 2px;
  color: #888;
  transition: color 0.2s;
}

.fixed-bottom .btn-link.active i,
.fixed-bottom .btn-link:active i {
  color: var(--primary);
}

/* Hide WhatsApp button behind bottom bar if needed, or move it up */
.whatsapp-float {
  bottom: 80px !important; /* Move above bottom bar */
  width: 50px;
  height: 50px;
  font-size: 24px;
}

/* --- 6. Forms & Inputs --- */
input.form-control, select.form-control, textarea.form-control {
  font-size: 16px; /* Prevent zoom on iOS */
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
}

input.form-control:focus {
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
  border-color: var(--primary);
}

/* --- 7. Images & Media --- */
img {
  max-width: 100%;
  height: auto;
}

/* Lazy load placeholder effect */
img[loading="lazy"] {
  background-color: #f0f0f0;
  transition: opacity 0.3s;
}

/* --- 8. Utilities --- */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Spacer for bottom bar */
body {
  padding-bottom: 70px;
}

/* --- 9. Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-up {
  animation: fadeInUp 0.5s ease-out forwards;
}
