/* =====================================================
   NIVA FOODS — SEAMLESS MOBILE UX STYLESHEET
   Loaded after style.css and multipage.css
   ===================================================== */

/* ===================================================
   1. PREVENT HORIZONTAL SCROLL EVERYWHERE
   =================================================== */
html, body {
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}
* { box-sizing: border-box; }
img, video, iframe { max-width: 100%; }

/* ===================================================
   2. PREVENT iOS ZOOM ON INPUT FOCUS
      (inputs must be >= 16px font-size on mobile)
   =================================================== */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ===================================================
   3. TOUCH ACTIVE STATES — instant visual feedback
   =================================================== */
button:active, a:active,
.co-pay-box:active, .co-delivery-opt:active,
.product-card:active, .weight-btn:active,
.qty-btn:active, .nav-link:active {
  opacity: 0.75;
  transform: scale(0.97);
  transition: opacity 0.08s, transform 0.08s !important;
}

/* ===================================================
   4. HAMBURGER & SIDE DRAWER (REMOVED - BOTTOM NAV ACTIVE)
   =================================================== */
.hamburger { display: none !important; }
.nav-overlay { display: none !important; }

@media (max-width: 768px) {
  .hamburger { display: none !important; }
  .nav-links { display: none !important; }
  .nav-overlay { display: none !important; }
  .nav-cta { display: flex !important; }
}

/* ===================================================
   7. STICKY BOTTOM BAR — CART PAGE
   =================================================== */
@media (max-width: 768px) {
  .mobile-cart-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    padding: 10px 16px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    border-top: 1.5px solid #e0ebe2 !important;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.12) !important;
    z-index: 9990 !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    box-sizing: border-box !important;
  }
  .mobile-cart-bar-total {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  .mobile-cart-bar-total .label {
    font-size: 0.72rem !important;
    color: #64748b !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    margin: 0 0 2px !important;
    line-height: 1.2 !important;
  }
  .mobile-cart-bar-total .amount {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    color: #073b18 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
  .mobile-cart-bar-btn {
    flex-shrink: 0 !important;
    background: #073b18 !important;
    color: white !important;
    border: none !important;
    padding: 13px 20px !important;
    border-radius: 40px !important;
    font-weight: 800 !important;
    font-size: 0.92rem !important;
    font-family: 'Outfit', sans-serif !important;
    cursor: pointer !important;
    box-shadow: 0 6px 20px rgba(7,59,24,0.3) !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
  }
  .mobile-cart-bar-btn:active { transform: scale(0.97) !important; }

  /* Add bottom padding to cart page content so bar doesn't overlap */
  .page-checkout-replica main,
  .page-cart main,
  body.page-cart main,
  body.page-checkout-replica main {
    padding-bottom: 95px !important;
  }
}
/* Hide on desktop */
.mobile-cart-bar { display: none; }

/* ===================================================
   8. STICKY BOTTOM BAR — CHECKOUT PAGE
   =================================================== */
@media (max-width: 768px) {
  .mobile-pay-bar {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 2px solid #e0e6e2;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.1);
    z-index: 9990;
    align-items: center;
    gap: 12px;
  }
  .mobile-pay-bar-total { flex: 1; }
  .mobile-pay-bar-total .label { font-size: 0.72rem; color: #68786c; font-weight: 600; }
  .mobile-pay-bar-total .amount { font-size: 1.25rem; font-weight: 900; color: #073b18; line-height: 1; }
  .mobile-pay-bar-btn {
    flex-shrink: 0;
    background: #073b18;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 40px;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(7,59,24,0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 140px;
  }
  .mobile-pay-bar-btn:active { transform: scale(0.97); }

  /* Add padding to checkout main content */
  .page-checkout-replica main { padding-bottom: 90px !important; }

  /* Hide desktop pay button on mobile (use sticky bar instead) */
  .co-pay-action { display: none !important; }
}
.mobile-pay-bar { display: none; }

/* ===================================================
   9. STICKY PRODUCT CTA — PRODUCT DETAIL PAGE
   =================================================== */
@media (max-width: 768px) {
  .mobile-product-bar {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-top: 2px solid #e0e6e2;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.1);
    z-index: 9990;
    gap: 10px;
    align-items: center;
  }
  .mobile-product-bar-price { flex: 1; }
  .mobile-product-bar-price .price { font-size: 1.3rem; font-weight: 900; color: #073b18; }
  .mobile-product-bar-price .label { font-size: 0.7rem; color: #68786c; }
  .mobile-product-bar-add {
    flex: 1;
    background: #073b18;
    color: white;
    border: none;
    padding: 14px 10px;
    border-radius: 40px;
    font-weight: 800;
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    text-align: center;
  }
  .mobile-product-bar-add:active { transform: scale(0.97); }

  /* Padding for product pages */
  body:not(.page-cart):not(.page-checkout-replica) main { padding-bottom: 90px !important; }
}
.mobile-product-bar { display: none; }

/* ===================================================
   10. MOBILE LAYOUT IMPROVEMENTS
   =================================================== */
@media (max-width: 768px) {
  /* Bigger tap targets for qty controls */
  .qty-btn {
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 10px !important;
    font-size: 1.2rem !important;
  }

  /* Better cart item layout on mobile */
  .cart-page-layout, .replica-cart-layout {
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* Checkout columns stack */
  .co-grid {
    flex-direction: column !important;
    gap: 14px !important;
  }
  .co-col-left, .co-col-mid, .co-col-right {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Email + phone side by side on mobile is too tight */
  .co-form-row { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* Checkout card spacing */
  .co-card { padding: 16px !important; margin-bottom: 12px !important; border-radius: 14px !important; }
  .co-card h3 { font-size: 1rem !important; margin-bottom: 14px !important; }

  /* Payment logos smaller */
  .co-pay-logos { gap: 4px !important; margin-top: 6px !important; }
  .co-pay-logo { height: 22px !important; padding: 2px 5px !important; border-radius: 6px !important; }
  .co-pay-box { padding: 11px 12px !important; margin-bottom: 8px !important; border-radius: 10px !important; }
  .co-pay-title { font-size: 0.88rem !important; }
  .co-pay-sub { font-size: 0.72rem !important; }

  /* Bottom trust bar */
  .co-bottom-bar { grid-template-columns: 1fr 1fr !important; gap: 8px !important; margin-top: 16px !important; }
  .co-bottom-box { padding: 10px !important; gap: 8px !important; border-radius: 10px !important; }
  .co-bottom-icon { width: 32px !important; height: 32px !important; font-size: 0.9rem !important; }
  .co-bottom-text strong { font-size: 0.75rem !important; }
  .co-bottom-text span { font-size: 0.65rem !important; }

  /* Inner page container horizontal padding */
  .replica-main-container,
  .co-container,
  .container { padding-left: 14px !important; padding-right: 14px !important; }

  /* Section padding smaller on mobile */
  .section { padding: 48px 0 !important; }
  .section-header { margin-bottom: 28px !important; }

  /* Card radius smaller on mobile (looks better on small screens) */
  .replica-card, .cart-summary-box { border-radius: 14px !important; }

  /* Make modal full-screen on mobile */
  #orderSuccessModal > div,
  #validationNoticeModal > div {
    max-width: 100% !important;
    margin: 0 12px !important;
    border-radius: 20px !important;
    padding: 1.8rem 1.4rem !important;
  }

  /* Announcement bar hidden on very small (too cluttered) */
  .announcement-bar { font-size: 0.7rem !important; }
}

/* ===================================================
   11. SAFE AREA INSETS (iPhone notch / home bar)
   =================================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .mobile-cart-bar,
    .mobile-pay-bar,
    .mobile-product-bar {
      padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    }
  }
}

/* ===================================================
   12. SMOOTH SCROLL & SCROLL MOMENTUM ON MOBILE
   =================================================== */
.co-items-list,
#cartItemsList,
.catalog-filters,
.tabs-nav {
  -webkit-overflow-scrolling: touch !important;
  scroll-behavior: smooth !important;
}

/* ===================================================
   13. BETTER FORM INPUTS & PROMO CODE ON MOBILE
   =================================================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  .co-form-group input,
  .co-form-group select,
  input[type="text"]:not(.catalog-search-input),
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select, textarea {
    font-size: 16px !important; /* Prevents iOS zoom */
    min-height: 46px !important;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
  }

  .co-form-group label { font-size: 0.82rem !important; margin-bottom: 4px !important; }

  /* Promo Input Group (Never overflow screen) */
  .promo-input-group {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .promo-input-group input,
  .promo-input {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 0.88rem !important;
  }

  .promo-input-group button,
  .btn-apply-promo,
  .btn-promo-apply {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 10px 16px !important;
  }

  /* Free Shipping Bar */
  .free-ship-bar-wrap,
  .free-shipping-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .free-ship-header,
  .free-ship-labels {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 8px !important;
  }

  /* Checkbox bigger on mobile */
  .co-save-addr input[type=checkbox] { width: 20px !important; height: 20px !important; }
  .co-save-addr { font-size: 0.85rem !important; gap: 10px !important; margin-top: 12px !important; }

  /* Select arrow bigger */
  select { appearance: auto !important; -webkit-appearance: auto !important; }

  /* Header Clean Mobile Layout */
  .search-btn-nav,
  .nav-search,
  #searchBtn,
  .catalog-search-wrap,
  .hamburger {
    display: none !important;
  }
}

/* ===================================================
   14. MOBILE BOTTOM NAVIGATION BAR (App-Style)
   =================================================== */
.niva-mobile-bottom-bar {
  display: none;
}

@media (max-width: 768px) {
  .niva-mobile-bottom-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 58px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid #e0ebe2 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07) !important;
    z-index: 9980 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 4px 6px !important;
    padding-bottom: calc(4px + env(safe-area-inset-bottom)) !important;
  }

  .mb-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
    height: 100% !important;
    color: #64748b !important;
    text-decoration: none !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    font-family: 'Outfit', sans-serif !important;
    gap: 2px !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
  }

  .mb-nav-item svg {
    stroke-width: 2.2 !important;
    transition: transform 0.2s ease !important;
  }

  .mb-nav-item:active {
    transform: scale(0.92) !important;
  }

  .mb-nav-item.active {
    color: #073b18 !important;
    font-weight: 800 !important;
  }

  .mb-nav-item.active svg {
    color: #073b18 !important;
    transform: translateY(-2px) !important;
  }

  .mb-cart-wrap {
    position: relative !important;
    display: inline-flex !important;
  }

  .mb-cart-badge {
    position: absolute !important;
    top: -6px !important;
    right: -10px !important;
    background: #073b18 !important;
    color: #ffffff !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    min-width: 17px !important;
    height: 17px !important;
    line-height: 17px !important;
    border-radius: 10px !important;
    text-align: center !important;
    padding: 0 4px !important;
    border: 1.5px solid #ffffff !important;
  }

  /* Adjust page bottom padding so content is not cut off by bottom nav */
  body:not(.page-checkout-replica) {
    padding-bottom: 66px !important;
  }

  /* Adjust WhatsApp button so it floats gracefully above the bottom navigation bar */
  body:not(.page-checkout-replica) .niva-floating-whatsapp {
    bottom: 74px !important;
  }
}

/* ===================================================
   15. RECIPE MODAL OVERLAY & POPUP (UNIVERSAL)
   =================================================== */
.recipe-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.recipe-modal.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.recipe-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(7, 35, 15, 0.72) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 1 !important;
}

.recipe-modal-content {
  position: relative !important;
  background: #ffffff !important;
  width: 100% !important;
  max-width: 620px !important;
  max-height: 85vh !important;
  margin: auto !important;
  border-radius: 20px !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
}

/* ===================================================
   16. FIRST-TIME BUYER WELCOME COUPON POPUP (WELCOME10)
   =================================================== */
.niva-welcome-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.niva-welcome-modal.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.niva-welcome-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(7, 35, 15, 0.72) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 1 !important;
}

.niva-welcome-card {
  position: relative !important;
  background: linear-gradient(180deg, #ffffff 0%, #faf8f5 100%) !important;
  width: 100% !important;
  max-width: 440px !important;
  margin: auto !important;
  border-radius: 24px !important;
  padding: 32px 24px 24px !important;
  text-align: center !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1.5px rgba(212, 175, 55, 0.35) !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
  transform: scale(0.92) translateY(20px) !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.niva-welcome-modal.active .niva-welcome-card {
  transform: scale(1) translateY(0) !important;
}

.niva-welcome-close {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 32px !important;
  height: 32px !important;
  background: #f0f5f1 !important;
  border: none !important;
  border-radius: 50% !important;
  font-size: 1.2rem !important;
  color: #073b18 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  transition: background 0.2s ease, transform 0.2s ease !important;
}

.niva-welcome-close:hover {
  background: #e2ede5 !important;
  transform: rotate(90deg) !important;
}

.niva-welcome-icon-circle {
  width: 58px !important;
  height: 58px !important;
  background: linear-gradient(135deg, #e8f5e8, #d1ebd1) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.8rem !important;
  margin: 0 auto 12px !important;
  box-shadow: 0 6px 16px rgba(45, 125, 45, 0.15) !important;
}

.niva-welcome-badge {
  display: inline-block !important;
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #92400e !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 1px !important;
  padding: 4px 12px !important;
  border-radius: 30px !important;
  border: 1px solid #fcd34d !important;
  margin-bottom: 10px !important;
  text-transform: uppercase !important;
}

.niva-welcome-title {
  font-family: 'Playfair Display', serif !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  color: #073b18 !important;
  line-height: 1.25 !important;
  margin: 0 0 8px 0 !important;
}

.niva-welcome-title .highlight-gold {
  color: #d97706 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

.niva-welcome-desc {
  font-size: 0.88rem !important;
  color: #4b6352 !important;
  line-height: 1.45 !important;
  margin: 0 0 18px 0 !important;
}

.niva-welcome-coupon-box {
  background: #ffffff !important;
  border: 2px dashed #16a34a !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.08) !important;
}

.niva-coupon-code {
  font-family: 'Outfit', sans-serif !important;
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  color: #073b18 !important;
  letter-spacing: 2px !important;
}

.niva-coupon-sub {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #16a34a !important;
  background: #f0fdf4 !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
}

.niva-welcome-claim-btn {
  width: 100% !important;
  background: linear-gradient(135deg, #073b18, #166534) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 14px 20px !important;
  border-radius: 40px !important;
  font-weight: 800 !important;
  font-size: 0.98rem !important;
  font-family: 'Outfit', sans-serif !important;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(7, 59, 24, 0.3) !important;
  transition: all 0.25s ease !important;
  display: block !important;
}

.niva-welcome-claim-btn:active {
  transform: scale(0.97) !important;
}

.niva-welcome-dismiss-link {
  background: none !important;
  border: none !important;
  color: #8b9b90 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  margin-top: 12px !important;
  cursor: pointer !important;
  display: inline-block !important;
}

.niva-welcome-dismiss-link:hover {
  color: #073b18 !important;
}

@media (max-width: 480px) {
  .niva-welcome-card {
    padding: 26px 18px 20px !important;
    border-radius: 20px !important;
  }
  .niva-welcome-title {
    font-size: 1.3rem !important;
  }
}


