/* ==========================================================
   Vinaayak Fab - Responsive Styles
   ========================================================== */

/* Header: tighter menu spacing on smaller desktops */
@media (max-width: 1339.98px) {
  .main-nav a, .nav-drop-toggle { padding: 10px 10px; }
  .main-nav > ul > li > a::after, .nav-drop-toggle::after { left: 10px; right: 10px; }
}

@media (max-width: 1199.98px) {
  .value:nth-child(4)::before { display: none; }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid rgba(255, 255, 255, .2); }
}

/* Mobile navigation (below Bootstrap xl) */
@media (max-width: 1199.98px) {
  :root { --header-h: 74px; }
  .menu-toggle { display: inline-flex; }
  .header-actions .btn { display: none; }
  /* backdrop-filter would trap the fixed menu panel inside the header */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--ivory); }
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 86vw);
    background: var(--ivory); z-index: 1200; padding: 90px 26px 30px; overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform .4s var(--ease), visibility .4s;
    box-shadow: -10px 0 40px rgba(0, 0, 0, .12);
  }
  .nav-open .main-nav { transform: none; visibility: visible; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav > ul > li { border-bottom: 1px solid var(--line); }
  .main-nav a, .nav-drop-toggle { width: 100%; justify-content: space-between; padding: 15px 4px; }
  .main-nav > ul > li > a::after, .nav-drop-toggle::after { display: none; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 10px 10px; display: none; min-width: 0; }
  .has-drop:hover .dropdown, .has-drop:focus-within .dropdown { opacity: 1; visibility: visible; }
  .has-drop.open .dropdown { display: block; }
  .has-drop:hover .nav-drop-toggle img { transform: none; }
  .has-drop.open .nav-drop-toggle img { transform: rotate(180deg); }
  .nav-close { position: absolute; top: 20px; right: 20px; }
  .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(20, 28, 38, .45); z-index: 1100; opacity: 0; visibility: hidden; transition: opacity .3s; }
  .nav-open .nav-overlay { opacity: 1; visibility: visible; }
  .nav-open { overflow: hidden; }
  .nav-open .site-header { z-index: 1150; }
  .mobile-nav-cta { display: block !important; margin-top: 26px; }
  .mobile-nav-cta .btn { width: 100%; }
}

@media (max-width: 991.98px) {
  .hero, .cat-hero.bg-texture {
    background:
      linear-gradient(180deg, rgba(251, 252, 251, .95) 0%, rgba(251, 252, 251, .86) 100%),
      url("../images/hero/hero-bg-soft.jpg") center / cover no-repeat;
  }
  .section { padding: 84px 0; }
  .hero-media { max-width: 560px; margin-left: auto; margin-right: auto; }
  .hero-badge { left: 10px; }
  .split-media { max-width: 600px; margin-left: auto; margin-right: auto; }
  .split-media .img-accent { right: 10px; }
  .split-media .stamp { left: 10px; }
  .cat-hero-media { max-width: 420px; }
  .cat-hero-grid > div:last-child { justify-content: center; }
  .feature:nth-child(3)::before { display: none; }
  .check-grid { --bs-gutter-y: 28px; }
  .check-item { padding: 0; }
  .check-item + .check-item { border-left: 0; border-top: 1px solid rgba(107, 117, 131, .25); padding-top: 28px; }
  .footer-grid { --bs-gutter-x: 40px; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 50px 40px; }
  .enquiry-content { grid-template-columns: 1fr; }
  .enquiry-content .modal-aside { display: none; }
  .cert-detail { grid-template-columns: 180px 1fr; gap: 30px; }
}
.mobile-nav-cta, .nav-close { display: none; }
@media (max-width: 1199.98px) { .nav-close { display: inline-flex; } }

@media (max-width: 767.98px) {
  .hero.hero-center { min-height: 520px; padding: 90px 0; }
  .container { padding: 0 20px; }
  .section { padding: 70px 0; }
  .section-sm { padding: 54px 0; }
  .section-head { margin-bottom: 42px; }
  .topbar-info .tb-hide { display: none; }
  .topbar-info { gap: 14px; }
  .brand img { width: 50px; }
  .brand-name { font-size: 22px; }
  .brand-tag { font-size: 9px; letter-spacing: .2em; }
  .hero { padding: 40px 0 70px; }
  .hero-meta { gap: 18px; }
  .hero-badge { padding: 14px 18px; bottom: 24px; }
  .hero-badge strong { font-size: 34px; }
  .trust-item { justify-content: flex-start; padding: 16px 4px; font-size: 14px; }
  .trust-item + .trust-item { border-left: 0; border-top: 1px solid rgba(31, 45, 62, .18); }
  .feature + .feature::before { left: 20%; right: 20%; top: -25px; bottom: auto; width: auto; height: 1px; }
  .feature:nth-child(3)::before { display: block; }
  .value:nth-child(odd)::before { display: none; }
  .value:nth-child(4)::before { display: block; }
  .stat + .stat { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .2); }
  .panel { padding: 34px 22px; }
  .icon-row { gap: 18px; }
  .icon-row .ir-icon { width: 56px; height: 56px; }
  .icon-row .ir-icon img { width: 26px; height: 26px; }
  .page-banner { min-height: 300px; }
  .page-banner::before { background: linear-gradient(90deg, rgba(251, 252, 251, .96) 0%, rgba(251, 252, 251, .85) 65%, rgba(251, 252, 251, .5) 100%); }
  .image-band::before { background: rgba(251, 252, 251, .84); }
  .image-band { min-height: 380px; }
  .split-media .img-accent { width: 40%; bottom: -26px; border-width: 5px; }
  .form-card { padding: 30px 22px; }
  .modal-body { padding: 34px 22px 26px; }
  .cta-band { padding: 42px 26px; }
  .cert-detail { grid-template-columns: 1fr; }
  .cert-logo-slot { max-width: 220px; }
  .map-wrap { aspect-ratio: 4 / 3; }

  /* Floating buttons: compact, kept clear of content edges */
  .float-enquiry { top: auto; bottom: 24px; transform: none; writing-mode: horizontal-tb; border-radius: 30px; right: 16px; padding: 14px 18px; font-size: 12px; letter-spacing: .16em; }
  .float-enquiry img { transform: none; }
  .float-enquiry:hover { padding-right: 18px; }
  .float-left { left: 16px; bottom: 24px; flex-direction: row; gap: 10px; }
  .float-btn { width: 48px; height: 48px; }
  .float-btn img { width: 23px; height: 23px; }
  .float-btn .tip { display: none; }
  .site-footer { padding-bottom: 80px; }
}

@media (max-width: 420px) {
  .btn { padding: 13px 22px; }
}

/* v2 additions */
@media (max-width: 767.98px) {
  .gallery-grid { --bs-gutter-x: 16px; --bs-gutter-y: 16px; }
  .gallery-item figcaption { font-size: 20px; padding: 12px 10px; }
  .gallery-zoom { display: none; }
  .lightbox { padding: 60px 14px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; margin-top: 0; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
  .lightbox-img { max-height: calc(100vh - 230px); }
  .lightbox-caption { font-size: 24px; }
  .hero-slide .slide-label { right: auto; left: 50%; transform: translateX(-50%); bottom: 82px; white-space: nowrap; }
  .slider-dots { bottom: 56px; }
  .hero-media .hero-badge { left: 50%; transform: translateX(-50%); bottom: -30px; white-space: nowrap; }
  .hero { padding-bottom: 90px; }
}

/* ==========================================================
   v13: mobile and tablet first screen
   ========================================================== */
@media (max-width: 991.98px) {
  .first-screen { padding-top: 28px; }
  .first-screen .section-head { margin-bottom: 24px; }
  .first-screen .section-head .divider { margin: 2px auto 10px; }
  .first-screen .section-head p { font-size: 16px; margin-bottom: 0; }
  .gallery-head .gh-title .eyebrow { margin-bottom: 6px; }

  /* Home: hero and green bar together on the first screen */
  .hero.hero-center { min-height: calc(100vh - 42px - var(--header-h) - 80px); min-height: calc(100svh - 42px - var(--header-h) - 80px); padding: 36px 0 56px; }
  .hero-center h1 { margin-bottom: 26px; }
  .hero-bg-dots { bottom: 20px; }

  /* About: shorter image so the title shows */
  .about-intro { padding-top: 24px; }
  .about-intro .split-media .img-main { aspect-ratio: 16 / 11; }
  .about-intro .split { --bs-gutter-y: 34px; }

  /* Products: first card on the first screen */
  .products-intro .cat-wide .cw-img { aspect-ratio: 16 / 9; }
  .products-intro .compact-head .page-title { margin-bottom: 4px; }
  .products-intro .cat-wide .cw-body { padding: 18px 22px 20px; }

  .fs-split .split-media .img-main { aspect-ratio: 16 / 11; }
  .fs-contact .form-card { padding: 34px 22px; }
}

@media (max-width: 767.98px) {
  .first-screen { padding-top: 24px; }
  /* Green bar: three items in one row */
  .trust-row > .trust-item { width: 33.333%; flex: 0 0 33.333%; flex-direction: column; justify-content: center; gap: 8px; padding: 14px 4px; font-size: 11px; letter-spacing: .1em; text-align: center; line-height: 1.35; }
  .trust-row > .trust-item + .trust-item { border-top: 0; border-left: 1px solid rgba(31, 45, 62, .18); }
  .trust-row > .trust-item img { width: 24px; height: 24px; }
  .hero.hero-center { min-height: calc(100vh - 42px - var(--header-h) - 92px); min-height: calc(100svh - 42px - var(--header-h) - 92px); padding: 28px 0 50px; }
  .hero-center .eyebrow { font-size: 11px; letter-spacing: .18em; }
  .hero-center .btn-row .btn { padding-top: 14px; padding-bottom: 14px; }
  .first-screen .section-head .divider::before, .first-screen .section-head .divider::after { width: 50px; }
  .fs-global .market { padding: 22px 12px; }
  .fs-global .market .m-code { font-size: 32px; }
  .products-intro .compact-head .divider { display: none; }
  .products-intro .compact-head p { font-size: 15px; line-height: 1.6; }
  .products-intro .cat-wide .cw-body { padding: 16px 20px 18px; }
  .products-intro .cat-wide .cw-img { aspect-ratio: 2 / 1; }
  .products-intro .cat-wide p { font-size: 15px; margin-bottom: 8px; }
}

/* v13: on phones, floating buttons appear after a short scroll so the first screen stays clear */
@media (max-width: 767.98px) {
  .float-left, .float-enquiry { transition: opacity .3s, visibility .3s, transform .3s; }
  html:not(.float-ready) .float-left, html:not(.float-ready) .float-enquiry { opacity: 0; visibility: hidden; transform: translateY(16px); }
}

/* ==========================================================
   v14: mobile fixes
   ========================================================== */
@media (max-width: 767.98px) {
  /* Product galleries: two images per row */
  .gallery-grid { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
  .gallery-item { border-radius: 14px; }
  .gallery-zoom { transform: scale(.8); }

  /* Certificates: neat 2 x 2 grid */
  .cert-logo-row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
  .cert-logo-row .cert-logo-slot { padding: 16px 10px 14px; gap: 4px; border-radius: 16px; }
  .cert-logo-row .cert-logo-slot img.cert-logo { height: 64px; max-width: 112px; margin-bottom: 4px; }
  .cert-logo-row .cert-logo-slot small { font-size: 11px; line-height: 1.35; min-height: 30px; letter-spacing: 0; }
  .cert-dl { font-size: 10px; letter-spacing: .1em; }

  /* Green bar: long translated words stay inside */
  .trust-row > .trust-item { letter-spacing: .05em; padding-left: 6px; padding-right: 6px; }

  /* Enquiry forms (contact page and popup): compact fields */
  .form-card, .fs-contact .form-card { padding: 22px 16px 20px; }
  .form-card h3, .modal-body h3 { font-size: 26px; margin-bottom: 2px; }
  .form-card > p, .modal-body > p { font-size: 14px; margin-bottom: 12px; line-height: 1.5; }
  .modal-body { padding: 26px 16px 20px; }
  .form-grid { --bs-gutter-x: 10px; --bs-gutter-y: 8px; }
  .form-grid > .form-field.col-md-6 { flex: 0 0 auto; width: 50%; }
  .form-field { gap: 4px; }
  .form-field label { font-size: 11px; letter-spacing: .06em; }
  .form-field input, .form-field select, .form-field textarea { padding: 7px 10px; font-size: 15px; line-height: 1.4; border-radius: 6px; }
  .form-field select { padding-right: 30px; background-position: right 8px center; background-size: 14px; }
  .form-field textarea, .fs-contact .form-field textarea { min-height: 64px; height: 64px; }
  .form-foot { margin-top: 12px; gap: 10px; }
  .form-foot small { font-size: 12px; }
  .form-foot .btn { padding: 12px 20px; font-size: 12px; }
}

@media (max-width: 767.98px) {
  .cert-status { font-size: 10px; letter-spacing: .1em; }
}
