/* ============================================================
   AGRIVANA — Responsive Styles (Mobile-First Polish)
   Breakpoints: 1280px / 1024px / 768px / 480px
   ============================================================ */

/* ── Large Desktop (1280px) ── */
@media (max-width: 1280px) {
  .hero__badge--top { left: -2%; }
  .hero__badge--bottom { right: -2%; }
  .products__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Tablet Landscape (1024px) ── */
@media (max-width: 1024px) {
  .hero__container {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
    text-align: center;
  }

  .hero__content {
    align-items: center;
    max-width: 680px;
    margin: 0 auto;
  }

  .hero__body {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__visual {
    max-width: 480px;
    margin: 0 auto;
  }

  .trust-strip__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .trust-item {
    border-right: none;
    border-bottom: 1px solid var(--c-border-light);
    padding-bottom: 1rem;
  }

  .trust-item:nth-child(3),
  .trust-item:nth-child(4) {
    border-bottom: none;
    padding-bottom: 0;
  }

  .products__grid,
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .why__inner {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .why__images {
    max-width: 520px;
    margin: 0 auto;
  }

  .process__timeline {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
  }

  .process__line-track {
    display: none;
  }

  .markets__inner {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .quality__inner {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .quality__image-wrap {
    max-width: 480px;
    margin: 0 auto;
  }

  .footer__grid {
    grid-template-columns: 1.2fr 0.9fr 1fr 1fr;
    gap: 1.5rem;
  }

  /* Header mobile toggle */
  .header__nav,
  .header__cta,
  .header__actions-wrap .lang-switch,
  .site-header .lang-switch {
    display: none !important;
  }

  .header__hamburger {
    display: flex;
  }

  .about-grid,
  .product-detail-grid,
  .contact-layout {
    grid-template-columns: 1fr !important;
    gap: var(--sp-4) !important;
  }

  .about-values-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile Landscape & Tablets (768px) ── */
@media (max-width: 768px) {
  .section {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }

  .page-hero {
    padding-top: calc(76px + 2rem);
    padding-bottom: 3.5rem;
    min-height: auto;
  }

  .page-hero__container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .page-hero__content {
    max-width: 100%;
  }

  .page-hero__visual-frame {
    max-width: 440px;
    margin: 0 auto;
  }

  .hero {
    padding-top: calc(76px + 1.5rem);
    padding-bottom: 3.5rem;
  }

  .hero__container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__image-container {
    max-width: min(340px, 82vw);
    margin: 1.5rem auto 2rem;
  }

  .hero__headline {
    font-size: clamp(2.15rem, 8vw, 3.25rem);
  }

  .hero__process-line {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .hero__brand-seal {
    width: 78px;
    height: 78px;
    bottom: -15px;
    left: -8px;
    right: auto;
  }

  .hero__leaf-top {
    width: 75px;
    height: 100px;
    top: -22px;
    left: -15px;
  }

  .hero__leaf-bottom {
    width: 120px;
    height: 90px;
    bottom: -15px;
    left: -20px;
  }

  /* Badges frame the outer edges as compact cards with left: auto to prevent stretching */
  .hero__badge {
    width: auto !important;
    max-width: max-content !important;
    white-space: nowrap !important;
    display: inline-flex !important;
  }

  .hero__badge--top {
    left: auto !important;
    right: -4px !important;
    top: 2% !important;
    bottom: auto !important;
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(11, 66, 31, 0.12);
  }

  .hero__badge--bottom {
    left: auto !important;
    right: -4px !important;
    bottom: 2% !important;
    top: auto !important;
    padding: 0.4rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(11, 66, 31, 0.12);
  }

  .hero__badge-icon {
    width: 22px;
    height: 22px;
  }

  .hero__badge-icon svg {
    width: 18px;
    height: 18px;
  }

  .hero__badge-title {
    font-size: 0.65625rem;
    text-align: left;
  }

  .why__images {
    height: 360px;
  }

  .why__pillars {
    grid-template-columns: 1fr;
  }

  .process__timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .quality__stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .market-routes-grid {
    grid-template-columns: 1fr;
  }

  .about-values-grid {
    grid-template-columns: 1fr;
  }

  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cert-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group--full {
    grid-column: span 1;
  }

  .rfq-form-card {
    padding: 1.5rem;
  }

  /* Enhanced Mobile Footer */
  .footer {
    padding-top: 2.75rem;
    padding-bottom: 1.5rem;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
  }

  .footer__col--brand {
    grid-column: 1 / -1;
  }

  /* Hide Featured Produce on mobile and place Commercial Desk alongside Quick Links */
  .footer__col:nth-child(3),
  .footer__col--produce {
    display: none !important;
  }

  .footer__col--contact,
  .footer__col:nth-child(4) {
    display: block;
  }

  .footer__col-title,
  .footer__heading {
    font-size: 0.78rem;
    margin-bottom: 0.65rem;
  }

  .footer__link {
    font-size: 0.8125rem;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding-top: 1rem;
  }

  .footer__bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }
}

/* ── Mobile Portrait (480px) ── */
@media (max-width: 480px) {
  .products__grid,
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .trust-strip__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .trust-item {
    border-bottom: 1px solid var(--c-border-light);
    padding-bottom: 0.75rem;
  }

  .trust-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .product-tile {
    padding: 0.5rem;
    border-radius: 16px;
  }

  .product-tile__media {
    border-radius: 12px;
    padding: 0.5rem;
  }

  .product-tile__content,
  .product-card__body {
    padding: 0.55rem 0.25rem 0.25rem;
    justify-content: center;
    text-align: center;
  }

  .product-tile__title,
  .product-card__title {
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    word-break: normal;
    overflow: visible;
  }

  /* ── Citrus Marquee on Mobile / Tablets (768px and below) ── */
  .products-family-group {
    padding: 1.25rem 0.75rem 0.5rem;
    border-radius: 16px;
    overflow: hidden;
  }

  .citrus-marquee {
    padding: 0.25rem 0 0.5rem;
    touch-action: pan-y;
  }

  .citrus-marquee__group {
    gap: 1.25rem;
    padding-right: 1.25rem;
  }

  [dir="rtl"] .citrus-marquee__group {
    padding-right: 0;
    padding-left: 1.25rem;
  }

  .citrus-marquee .product-tile {
    flex: 0 0 140px !important;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .citrus-marquee .product-tile .product-tile__media {
    width: 100% !important;
    height: 120px !important;
    aspect-ratio: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .citrus-marquee .product-tile .product-tile__img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08)) !important;
  }

  .citrus-marquee .product-tile .product-tile__content {
    padding: 0.5rem 0 0 !important;
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
  }

  .citrus-marquee .product-tile .product-tile__title {
    font-size: 0.875rem !important;
    font-weight: 800 !important;
    text-align: center !important;
    white-space: nowrap !important;
    color: #0B2516 !important;
  }

  .products-grid .product-tile--frameless {
    width: 100%;
    flex: initial;
  }

  .products-grid .product-tile--frameless .product-tile__title {
    font-size: 0.8125rem;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }

  .header__logo {
    gap: 0.5rem;
  }

  .header__logo-img {
    width: 40px !important;
    height: 40px !important;
  }

  .header__logo-title {
    font-size: 1.1rem !important;
  }

  .header__logo-sub {
    font-size: 0.625rem !important;
  }

  .loader__inner {
    padding: 1.5rem 1.75rem !important;
    border-radius: 20px !important;
    gap: 1rem !important;
  }

  .loader__logo-wrap {
    width: 104px !important;
    height: 104px !important;
  }

  .loader__logo-img {
    width: 58px !important;
    height: 58px !important;
  }

  .loader__wordmark {
    font-size: 1.1rem !important;
    letter-spacing: 0.16em !important;
  }

  .loader__tagline {
    font-size: 0.875rem !important;
  }

  .hero.hero--cinema,
  .hero.hero--video {
    min-height: 100svh;
    min-height: 100dvh;
    height: 100svh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: calc(76px + 1rem);
    padding-bottom: 1.5rem;
    box-sizing: border-box;
  }

  .hero__container {
    margin-top: auto;
    margin-bottom: 1rem;
  }

  .hero__content-wrap {
    max-width: 100%;
    align-items: flex-start;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .hero__headline {
    font-size: clamp(1.65rem, 6.8vw, 2.2rem);
    line-height: 1.15;
    margin-bottom: 0.65rem;
  }

  .hero__body {
    font-size: clamp(0.8125rem, 3.4vw, 0.9375rem);
    line-height: 1.48;
    margin-bottom: 1.25rem;
    max-width: 100%;
  }

  .hero__bottom-bar {
    padding-top: 0;
    margin-top: 0;
  }

  .hero__bottom-container {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .hero__process-strip {
    padding: 0.4rem 0.95rem;
    font-size: 0.625rem;
    gap: 0.45rem;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 100%;
  }

  /* All Hero Actions (Homepage & Inner Pages) Side-by-Side on Mobile */
  .hero__actions,
  .page-hero__actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }

  .hero__actions > a,
  .hero__actions > button,
  .page-hero__actions > a,
  .page-hero__actions > button,
  .hero__btn-primary,
  .hero__btn-secondary,
  .hero__actions .btn,
  .page-hero__actions .btn {
    flex: 1 1 50% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.75rem 0.65rem !important;
    font-size: 0.78125rem !important;
    white-space: nowrap !important;
    border-radius: var(--r-full) !important;
  }

  .hero__actions svg,
  .page-hero__actions svg {
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0;
  }

  .process__timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }

  .process-step__desc {
    max-width: 100%;
    font-size: 0.75rem;
  }

  .process-step__title {
    font-size: 0.8125rem;
  }

  .process-step__dot {
    width: 44px;
    height: 44px;
  }

  .spec-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .detail-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .detail-actions > a,
  .detail-actions > button,
  .detail-actions .btn {
    flex: 1 1 50% !important;
    padding: 0.75rem 0.65rem !important;
    font-size: 0.78125rem !important;
    white-space: nowrap !important;
    justify-content: center !important;
  }

  .cta-section__actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-section__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .calendar-matrix {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ── Extra Small Mobile (380px and below) ── */
@media (max-width: 380px) {
  .hero__actions,
  .page-hero__actions {
    gap: 0.35rem !important;
  }

  .hero__actions > a,
  .hero__actions > button,
  .page-hero__actions > a,
  .page-hero__actions > button,
  .hero__btn-primary,
  .hero__btn-secondary,
  .hero__actions .btn,
  .page-hero__actions .btn {
    padding: 0.68rem 0.4rem !important;
    font-size: 0.71875rem !important;
  }

  .hero__process-line {
    font-size: 0.6875rem;
    gap: 0.4rem;
  }

  .hero__brand-seal {
    width: 72px;
    height: 72px;
  }

  /* Citrus Marquee on small screens */
  .citrus-marquee .product-tile {
    flex: 0 0 120px !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    padding: 0.15rem !important;
  }

  .citrus-marquee .product-tile .product-tile__media {
    height: 96px !important;
  }

  .citrus-marquee__group {
    gap: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  [dir="rtl"] .citrus-marquee__group {
    padding-right: 0 !important;
    padding-left: 0.85rem !important;
  }

  .citrus-marquee .product-tile .product-tile__title {
    font-size: 0.8125rem !important;
  }
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {

  /* Hide loader entirely */
  .loader {
    display: none !important;
  }

  /* Ensure all animated elements are visible */
  .hero, .hero *,
  .page-hero, .page-hero *,
  .site-header, .site-header *,
  .hero__image-mask, .hero__image-wrap,
  .page-hero__image-mask, .hero__gold-arc,
  .page-hero__gold-arc, .hero__brand-seal,
  .page-hero__stamp, .page-hero__visual-leaf,
  .hero__badge, .hero__card,
  .js-reveal {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    clip-path: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* Kill all continuous animations */
  .hero__gold-arc,
  .why__seal-badge,
  .floating-whatsapp__pulse,
  .loader__dot {
    animation: none !important;
  }

  /* Remove hover movement from buttons */
  .btn,
  .hero__btn-primary,
  .hero__btn-secondary,
  .product-tile,
  .product-card,
  .value-card,
  .pillar-item,
  .route-box {
    transition: color 0.2s, background-color 0.2s, border-color 0.2s !important;
    transform: none !important;
  }

  /* Process line shows complete immediately */
  .process__line-fill {
    width: 100% !important;
    transition: none !important;
  }

  /* Map elements visible immediately */
  .map-route, .map-origin, .map-destination, .map-label {
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
}

