/* ==========================================================================
   AVENTRA SPICE GLOBAL — Mobile Responsive Polish & Single-Column Layout
   1. All grids converted to single-by-single coming (1 column) on mobile
   2. Zero clipping / horizontal overflow on sides
   3. Top-bar & Header cleanly aligned, no overlapping or multiple line issues
   4. Floating WhatsApp cleanly docked and unobtrusive
   5. WhatsApp preview fully contained without side cutting
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
   TOP BAR  — Clean single line or minimal 2-line layout on mobile
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .top-bar {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    overflow: hidden;
  }

  .top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: 100%;
  }

  .top-bar-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    font-size: 0.7rem;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-bar-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
  }

  .top-bar-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: nowrap;
  }

  .top-bar-link {
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 0.2rem 0.3rem;
  }

  /* Hide email link entirely on mobile top bar */
  .top-bar-link[href^="mailto"],
  .top-bar-link.hide-mobile {
    display: none !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   SITE HEADER / NAVBAR  — Clean spacing, no clipping
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  }

  .navbar {
    height: 64px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
  }

  .brand-logo-wrap {
    flex-shrink: 0;
    flex-grow: 0;
    max-width: 150px;
  }

  .brand-logo-img {
    height: 38px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    display: block;
  }

  .nav-menu {
    display: none !important;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
  }

  .nav-actions .btn-gold {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    white-space: nowrap;
    border-radius: var(--radius-sm, 6px);
  }

  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--emerald-700);
    border-radius: var(--radius-md, 8px);
    background: transparent;
    color: var(--emerald-800);
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   MOBILE DRAWER  — Guaranteed Full Slide & Proper Stacking
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .drawer-backdrop.active,
  .drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(310px, 86vw);
    height: 100dvh;
    z-index: 1100;
    background: var(--emerald-950);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: -8px 0 35px rgba(0, 0, 0, 0.5);
  }

  .mobile-drawer.open {
    transform: translateX(0);
  }

  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .drawer-header img {
    height: 38px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
  }

  .drawer-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
  }

  .drawer-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
  }

  .drawer-link:hover,
  .drawer-link.active {
    color: var(--gold-400);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
  }

  .drawer-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: auto;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   HERO BANNER & SLIDER  — Clean text hierarchy
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .hero-slider-wrap {
    min-height: 85svh;
  }

  .hero-slide {
    min-height: 85svh;
  }

  .hero-container {
    padding: 1.5rem 1rem 3.5rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-tag {
    font-size: 0.72rem;
    padding: 0.35rem 0.8rem;
    margin-bottom: 0.85rem;
    display: inline-flex;
    max-width: 100%;
    white-space: normal;
    line-height: 1.4;
  }

  .hero-title {
    font-size: clamp(1.6rem, 7.5vw, 2.3rem) !important;
    line-height: 1.22;
    margin-bottom: 0.85rem;
    word-wrap: break-word;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
  }

  .hero-badges-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
  }

  .hero-badge-pill {
    font-size: 0.72rem;
    padding: 0.35rem 0.75rem;
    width: auto;
  }

  .hero-cta-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.92rem;
    padding: 0.85rem 1rem;
  }

  .slider-controls {
    bottom: 1rem;
    right: 1rem;
  }

  .slider-btn {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ALL GRIDS: SINGLE BY SINGLE (1 COLUMN) ON MOBILE
   Requested: "2 column is not required make it as single by single coming"
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* 4 Core Pillars */
  .pillars-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .pillar-card {
    padding: 1.75rem 1.25rem !important;
    text-align: center;
  }

  /* Certifications Cards */
  .certs-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .cert-card {
    padding: 1.75rem 1.25rem !important;
  }

  .cert-logos-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Why Choose Us (6 cards) */
  .why-us-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .why-card {
    padding: 1.5rem 1.25rem !important;
  }

  /* Product Catalog Grid */
  .products-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .product-card {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }

  /* Stats / Numbers */
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Global Grid */
  .global-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Supply Chain (About page) */
  .supply-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Packaging Grid */
  .packaging-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Values Grid */
  .values-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Quality Cards */
  .quality-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Contact Cards */
  .contact-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Form Row (Two fields side-by-side → One by One) */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  /* Product Multi-Picker Chips in Order Form */
  .product-chip-grid {
    grid-template-columns: 1fr !important;
    gap: 0.45rem !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ORDER ENQUIRY PAGE & LIVE PREVIEW CARD  — Full Visibility & No Overlap
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .order-builder-layout {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .form-box {
    padding: 1.5rem 1rem !important;
    width: 100% !important;
  }

  /* WhatsApp Preview Box: disable sticky on mobile to prevent overlay */
  .whatsapp-preview-box {
    position: static !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    margin-top: 1rem;
    box-sizing: border-box !important;
  }

  .wa-preview-header {
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .wa-chat-body {
    padding: 1rem 0.75rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .wa-bubble,
  #whatsapp-live-preview-content {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
    font-size: 0.76rem !important;
    line-height: 1.45 !important;
    padding: 0.85rem !important;
    box-sizing: border-box !important;
  }

  .wa-preview-footer {
    padding: 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   PROCESSING UNIT FOOTER STRIP & CONTACT BLOCKS
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  /* Prevent side clipping on the Processing Unit footer strip */
  section[style*="background: var(--cream-surface)"] .container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem !important;
  }

  section[style*="background: var(--cream-surface)"] .container > div:last-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    width: 100%;
  }

  section[style*="background: var(--cream-surface)"] a {
    word-break: break-all;
    font-size: 0.95rem !important;
  }

  /* Site Footer */
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .footer-col {
    width: 100%;
  }

  .footer-logo-img {
    height: 44px;
    width: auto;
  }

  /* Floating WhatsApp Button */
  .floating-whatsapp {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 52px;
    height: 52px;
    font-size: 1.45rem;
    z-index: 999;
  }

  .floating-whatsapp::before {
    display: none !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   GLOBAL OVERFLOW & VIEWPORT DEFENSE
   ────────────────────────────────────────────────────────────────────────── */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0;
  padding: 0;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

img, video, canvas, svg {
  max-width: 100% !important;
  height: auto;
}
