/* India Gate customer-experience fixes (nav overflow, auth pages, responsive polish).
   Loaded after the compiled theme so these rules win without rebuilding the SCSS. */

/* ---- Phase 1: top-nav dropdowns must stay inside the viewport ---- */
/* The theme animates `all` on .sub-menu; position (left) must never animate or the viewport-fit
   measurement reads a half-way value. Only the fade/slide properties transition. */
.main-menu ul li.has-dropdown > .sub-menu { transition-property: opacity, visibility, transform !important; }

.main-menu nav > ul { max-width: 100%; }
.main-menu ul li.has-dropdown > .sub-menu {
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
}
.main-menu ul li.has-dropdown > .sub-menu.mega-menu {
  width: max-content !important;
  max-width: calc(100vw - 24px);
  left: 0; right: auto !important;
  flex-wrap: wrap; justify-content: flex-start;
  gap: 0 28px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.main-menu ul li.has-dropdown > .sub-menu.mega-menu > li { width: 200px; max-width: 100%; }
.main-menu ul li.has-dropdown > .sub-menu a:focus-visible,
.main-menu ul li.has-dropdown > a:focus-visible { outline: 2px solid #1f6b3a; outline-offset: 2px; }
.main-menu ul li.has-dropdown:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }

/* ---- Phase 5/7: authentication pages ---- */
.ig-auth { padding: 36px 0 56px; }
.ig-auth-card { max-width: 460px; margin: 0 auto; background: #fff; border: 1px solid #eadfc8; border-radius: 16px; padding: 28px 24px; box-shadow: 0 8px 24px rgba(31,107,58,.08); }
.ig-auth-card h1 { font-size: 26px; margin: 0 0 4px; }
.ig-auth-sub { color: #6b6b6b; margin-bottom: 18px; font-size: 15px; }
.ig-auth-card label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.ig-auth-card input[type=text], .ig-auth-card input[type=email], .ig-auth-card input[type=tel],
.ig-auth-card input[type=password] { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #cfc7b4; border-radius: 10px; font-size: 16px; }
.ig-auth-card input:focus-visible, .ig-auth-card button:focus-visible, .ig-auth-card a:focus-visible { outline: 2px solid #1f6b3a; outline-offset: 2px; }
.ig-auth-card .ig-btn { width: 100%; min-height: 48px; margin-top: 18px; border: 0; border-radius: 50px; background: #1f6b3a; color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; }
.ig-auth-card .ig-btn:hover { background: #17552d; }
.ig-auth-switch { text-align: center; margin-top: 16px; font-size: 15px; }
.ig-seg { display: flex; gap: 6px; background: #f6edd9; padding: 4px; border-radius: 50px; margin-bottom: 8px; }
.ig-seg button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 50px; font-weight: 600; cursor: pointer; }
.ig-seg button[aria-pressed=true] { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); color: #1f6b3a; }
.ig-pw { position: relative; }
.ig-pw .ig-pw-toggle { position: absolute; right: 6px; top: 6px; min-width: 44px; height: 36px; border: 0; background: transparent; font-size: 13px; cursor: pointer; color: #1f6b3a; font-weight: 600; }
.ig-err { color: #b00020; font-size: 14px; margin-top: 8px; }
@media (max-width: 480px) { .ig-auth { padding: 20px 0 36px; } .ig-auth-card { padding: 22px 16px; border-radius: 12px; } }

/* ---- Phase 7: checkout / cart touch targets on small screens ---- */
@media (max-width: 575.98px) {
  .main-btn .btn { display: block; width: 100%; min-height: 48px; margin: 0 0 10px; line-height: 1.6; }
  #checkout-form .form-control, #checkout-form textarea { font-size: 16px; } /* avoids iOS zoom on focus */
  #checkout-form .form-check-input { width: 1.25em; height: 1.25em; }
  .delivery-method-card { padding: 14px !important; }
}
#checkout-form .form-control:focus-visible, #checkout-form .btn:focus-visible { outline: 2px solid #1f6b3a; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } .main-menu .sub-menu { transition: none !important; } }
