/* ===== Aura Civillab – responsive & touch layer (loaded last) =====
   Phones (<600px) · tablets (600-899px) · laptops (900-1439px) · large monitors (1440px+) */

:root{ --max:1160px; --gutter:16px; }
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{ overflow-x:clip; }
a, button, .chip, .btn, input{ touch-action:manipulation; }         /* no 300ms tap delay / double-tap zoom */
.container{ width:min(var(--max), 100% - 2*var(--gutter)); }
img{ height:auto; }

/* ---------- Safe areas (notched phones, needs viewport-fit=cover) ---------- */
.site-header{ padding-top:env(safe-area-inset-top); }
.container{ margin-inline:auto; }
.footer{ padding-bottom:env(safe-area-inset-bottom); }
.to-top{ right:max(16px, env(safe-area-inset-right)); bottom:max(16px, env(safe-area-inset-bottom)); }

/* ---------- Hamburger drawn in CSS so the menu never depends on the icon font loading ---------- */
.menu-toggle{ position:relative; width:44px; height:44px; border-radius:10px; flex:none; }
.menu-toggle i{ display:none; }
.menu-toggle::before, .menu-toggle::after{ content:""; position:absolute; left:11px; right:11px; height:2px; border-radius:2px; background:var(--ink);
  transition:transform .3s var(--ease,ease), top .3s var(--ease,ease), box-shadow .3s; }
.menu-toggle::before{ top:15px; box-shadow:0 7px 0 var(--ink); }
.menu-toggle::after{ top:29px; }
.menu-toggle.is-open::before{ top:21px; transform:rotate(45deg); box-shadow:0 0 0 transparent; }
.menu-toggle.is-open::after{ top:21px; transform:rotate(-45deg); }
.menu-toggle:active{ background:var(--bg); }
.nav-links{ max-height:calc(100vh - 68px); max-height:calc(100dvh - 68px); overflow-y:auto; overscroll-behavior:contain; }

/* ---------- Filter chips: never squash, scroll sideways on phones ---------- */
.chip{ flex:none; scroll-snap-align:start; }
.filters{ scrollbar-width:none; -webkit-overflow-scrolling:touch; scroll-snap-type:x proximity; }
.filters::-webkit-scrollbar{ display:none; }

/* ---------- Modal ---------- */
.modal-box{ max-height:90vh; max-height:90dvh; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }

/* ---------- Touch: bigger tap targets (44px recommended minimum) ---------- */
@media (pointer:coarse), (max-width:759px){
  .chip{ min-height:44px; display:inline-flex; align-items:center; }
  .link-btn{ min-height:44px; display:inline-flex; align-items:center; }
  .contact-list a, .footer a{ display:inline-block; padding:9px 0; }
  .crumbs a{ display:inline-block; padding:11px 4px; margin:-11px -4px; }
  .nav-links a{ padding:14px 6px; }
  .icon-btn, .modal-close{ width:44px; height:44px; }
  .search input{ padding-block:15px; }
  .footer ul{ gap:0; }
}
@media (hover:none){
  .btn-primary:active, .icon-btn:active{ background:var(--red-dark); }
  .btn-ghost:active{ background:var(--red); color:#fff; }
  .pcard:active::before{ transform:scaleX(1); }
  .cat-card:active .cat-icon{ background:var(--red); color:#fff; }
}

/* ---------- Phones ---------- */
@media (max-width:599px){
  .section{ padding:44px 0; }
  .section.tight{ padding:22px 0 44px; }
  .hero{ padding:28px 0 40px; }
  .hero-grid{ gap:24px; }
  .hero-actions{ gap:10px; }
  .hero-actions .btn{ flex:1 1 100%; justify-content:center; padding:14px 20px; }
  .hero-points{ flex-direction:column; gap:6px; }
  .hero-img img{ max-height:min(52vh,380px); width:auto; max-width:100%; }
  .about{ padding:30px 0; }
  .section-head{ margin-bottom:20px; }
  .cat-card{ padding:20px 18px 18px; border-radius:16px; }
  .cat-num{ font-size:1.7rem; top:14px; right:18px; }
  .page-head{ padding:20px 0 24px; }
  .page-head h1{ padding-left:12px; border-left-width:4px; }
  .page-head p{ padding-left:16px; font-size:.95rem; }
  .toolbar{ margin-bottom:8px; }
  .filters{ margin-inline:calc(-1*var(--gutter)); padding-inline:var(--gutter); padding-bottom:4px;
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent); mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent); }
  .grid{ grid-template-columns:1fr; gap:16px; }
  .pimg{ height:200px; }
  .map iframe{ height:260px; }
  .branch{ padding:14px; }
  .insta{ padding:24px 18px; }
  .footer{ padding-top:32px; }
  .footer-grid{ gap:22px; }
  .badge, .pbody .code{ font-size:.8rem; }

  /* product details open as a bottom sheet */
  .modal{ place-items:end stretch; padding:0; }
  .modal-box{ max-width:none; border-radius:20px 20px 0 0; max-height:92vh; max-height:92dvh;
    padding:22px 18px calc(20px + env(safe-area-inset-bottom)); }
  .modal-box::before{ content:""; width:42px; height:4px; border-radius:4px; background:#ecd0d1; margin:-8px auto 4px; }
  .modal-box img{ max-height:min(32vh,240px); }
  .modal-box .btn{ justify-self:stretch; justify-content:center; padding:14px 20px; }
  .modal:not([hidden]) .modal-box{ animation:sheetIn .42s var(--ease,ease); }
  .modal.closing .modal-box{ animation:sheetOut .24s ease forwards!important; }
}
@keyframes sheetIn{ from{ transform:translateY(100%); } }
@keyframes sheetOut{ to{ transform:translateY(100%); } }

/* ---------- Small tablets ---------- */
@media (min-width:600px) and (max-width:899px){
  .hero-img img{ max-height:420px; }
  .cat-grid{ gap:18px; }
}

/* ---------- Phones in landscape (short screens) ---------- */
@media (max-height:500px) and (orientation:landscape){
  .hero{ padding:20px 0 28px; }
  .section{ padding:36px 0; }
  .modal-box{ max-height:94vh; max-height:94dvh; }
  .modal-box img{ max-height:36vh; }
  .nav-links{ max-height:calc(100dvh - 68px); }
}

/* ---------- Laptops / desktops ---------- */
@media (min-width:900px){
  .nav-links{ background:transparent; max-height:none; overflow:visible; }
  .hero{ padding:64px 0 76px; }
  .hero-img img{ max-height:min(520px,66vh); }
  .section{ padding:76px 0; }
}

/* ---------- Large monitors ---------- */
@media (min-width:1440px){
  :root{ --max:1280px; }
  html{ font-size:17px; }
  .nav{ height:76px; } .brand img{ height:52px; }
  .nav-links{ gap:34px; }
  .hero-img img{ max-height:min(600px,68vh); }
}
@media (min-width:1800px){
  :root{ --max:1480px; }
  html{ font-size:18px; }
  .grid{ grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:24px; }
  .cat-grid{ grid-template-columns:repeat(4,1fr); }
  .hero-img img{ max-height:min(680px,70vh); }
}

/* ---------- Print: plain, link-friendly ---------- */
@media print{
  .site-header, .scroll-progress, .to-top, .modal, .toolbar, .map, .insta{ display:none!important; }
  .reveal{ opacity:1!important; animation:none!important; }
  .pcard{ break-inside:avoid; box-shadow:none; }
}

/* ---------- Modal close button: keep it top-right (ripple styles had made it static) and draw the X in CSS ---------- */
.modal-close{ position:absolute; top:10px; right:10px; z-index:3; flex:none; }
.modal-close i{ display:none; }
.modal-close::before, .modal-close::after{ content:""; position:absolute; left:50%; top:50%; width:16px; height:2px; margin:-1px 0 0 -8px; border-radius:2px; background:currentColor; }
.modal-close::before{ transform:rotate(45deg); }
.modal-close::after{ transform:rotate(-45deg); }
@media (min-width:600px){ .modal-close{ top:12px; right:12px; } }
