/* Mobile & tablet polish — header through footer (≤1023px) */

@media (max-width: 1023px) {
  html {
    background-attachment: scroll;
    background-size: min(100vw, 420px) auto;
  }

  main {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }

  /* —— Touch-friendly controls —— */
  .btn-accent,
  .btn-primary,
  .btn-outline,
  .btn-outline-light {
    min-height: 44px;
    padding: 0.7rem 1.25rem;
    font-size: 0.875rem;
  }

  .search-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.15rem;
  }

  .nav-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
  }

  /* —— Header —— */
  .site-header:not(.is-scrolled) {
    box-shadow: none;
  }

  .top-ticker {
    min-height: 40px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  }

  .top-ticker-track {
    width: max-content;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0;
    gap: 0;
    animation: top-ticker-scroll 28s linear infinite;
    will-change: transform;
  }

  .top-ticker-group {
    padding-right: 2.5rem;
  }

  .top-ticker-group[aria-hidden="true"] {
    display: flex;
  }

  .top-ticker-group a {
    font-size: 0.68rem;
  }

  .top-ticker-group a:active {
    color: var(--accent-hover);
  }

  .nav-inner {
    min-height: 52px;
  }

  .logo img {
    height: 36px;
    max-width: min(130px, 40vw);
  }

  .nav-menu.open {
    padding: 0.5rem clamp(0.75rem, 3.5vw, 1rem) 1rem;
    max-height: calc(100dvh - var(--header-offset, 7.5rem));
  }

  .nav-menu.open > li {
    border-bottom: 1px solid rgba(26, 39, 68, 0.08);
  }

  .nav-menu.open > li:last-child {
    border-bottom: none;
  }

  .nav-menu.open > li > a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
  }

  .has-dropdown:hover .mega-menu {
    display: none;
  }

  .mega-menu-inner {
    padding: 0;
    max-height: none;
    overflow: visible;
  }

  .nav-menu.open .has-dropdown .mega-menu {
    display: none;
    position: static;
    transform: none;
    width: 100%;
    margin: 0 0 0.25rem;
    padding: 0;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
  }

  .nav-menu.open .has-dropdown.is-open .mega-menu {
    display: block;
    max-height: 50vh;
    opacity: 1;
    padding: 0.25rem 0 0.75rem 0.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu.open .has-dropdown > .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .nav-menu.open .mega-all-link {
    display: block;
    padding: 0.5rem 0.5rem 0.65rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.08);
    margin-bottom: 0.35rem;
  }

  .nav-menu.open .mega-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .nav-menu.open .mega-grid a {
    min-height: 44px;
    padding: 0.6rem 0.5rem;
    font-size: 0.875rem;
  }

  .nav-menu.open .mega-grid small {
    display: none !important;
  }

  .nav-menu.open .mega-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
  }

  /* —— Hero —— */
  .hero-carousel-wrap {
    padding-top: 0.65rem;
  }

  .hero-carousel {
    border-radius: 12px;
    width: 100%;
  }

  .carousel-track {
    aspect-ratio: 16 / 9;
    max-height: none;
    width: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .carousel-slide img {
    object-fit: cover;
    object-position: center;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .carousel-btn.prev { left: 0.35rem; }
  .carousel-btn.next { right: 0.35rem; }

  .carousel-dots {
    bottom: 0.5rem;
  }

  .hero-intro {
    padding: 1.15rem 0 0;
  }

  .hero-intro h1 {
    font-size: clamp(1.35rem, 5.5vw, 1.85rem);
    margin: 0.35rem 0;
  }

  .hero-lead {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions .btn-accent,
  .hero-actions .btn-outline-light {
    width: 100%;
  }

  /* —— Trust bar (marquee on mobile) —— */
  .trust-bar-scroll {
    padding: 0.85rem 0;
  }

  .trust-bar-track {
    width: max-content;
    animation: trust-bar-scroll 22s linear infinite;
    will-change: transform;
  }

  .trust-bar-set {
    gap: 1.75rem;
    padding-right: 1.75rem;
  }

  .trust-bar-set[aria-hidden="true"] {
    display: flex;
  }

  .trust-item {
    font-size: 0.8rem;
  }

  @keyframes trust-bar-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }

  .trust-bar-scroll:hover .trust-bar-track {
    animation-play-state: paused;
  }

  /* —— Sections —— */
  .section-categories,
  .section-featured,
  .section-about,
  .section-partner,
  .section-contact-trio {
    padding: 2.5rem 0;
  }

  .section-head-center {
    margin-bottom: 1.5rem;
  }

  .section-head-row {
    margin-bottom: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .section-eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
  }

  .section-title {
    font-size: clamp(1.3rem, 5vw, 1.65rem);
  }

  .section-sub {
    font-size: 0.875rem;
    line-height: 1.55;
    padding: 0 0.15rem;
  }

  /* —— Category bento (2 per row, like featured products) —— */
  .category-bento {
    gap: 0.65rem;
  }

  .cat-card {
    border-radius: 12px;
  }

  .cat-content {
    padding: 0.85rem 0.9rem;
  }

  .cat-content h3 {
    font-size: 0.9rem;
  }

  .cat-content p {
    font-size: 0.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .cat-link {
    opacity: 1;
    transform: none;
    margin-top: 0.35rem;
    font-size: 0.7rem;
  }

  .cat-badge {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.6rem;
  }

  /* —— Products —— */
  .product-grid {
    gap: 0.65rem;
  }

  .card-product {
    border-radius: 12px;
  }

  .card-product-body {
    padding: 0.7rem 0.75rem;
  }

  .card-product h3 {
    font-size: 0.82rem;
  }

  .card-product .desc {
    font-size: 0.72rem;
    -webkit-line-clamp: 2;
  }

  .sku {
    font-size: 0.68rem;
  }

  .text-center-mobile {
    margin-top: 1rem;
  }

  /* —— About —— */
  .about-grid {
    gap: 1.5rem;
  }

  .about-text {
    font-size: 0.9rem;
    margin: 0.75rem 0 1.25rem;
  }

  .features-grid {
    gap: 0.75rem;
    margin: 1rem 0;
  }

  .feature-box {
    padding: 0.65rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .about-copy .btn-outline {
    width: 100%;
    max-width: 20rem;
  }

  /* —— Partner —— */
  .section-partner .hero-actions {
    max-width: 20rem;
  }

  /* —— Contact trio —— */
  .contact-trio {
    gap: 0.75rem;
  }

  .trio-card {
    padding: 1.15rem 1rem;
    border-radius: 12px;
  }

  .trio-main {
    font-size: 0.95rem;
    word-break: break-word;
  }

  .trio-sub {
    font-size: 0.72rem;
  }

  /* —— Footer —— */
  .site-footer {
    margin-top: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 1.75rem 0 1.25rem;
  }

  .footer-brand {
    text-align: center;
    padding-bottom: 1.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.08);
  }

  .footer-col-links,
  .footer-col-categories,
  .footer-col-touch {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    padding: 1.35rem 0;
    margin: 0;
    border-bottom: 1px solid rgba(26, 39, 68, 0.08);
  }

  .footer-col-links {
    padding-top: 1.5rem;
  }

  .footer-col-categories {
    padding-top: 1.35rem;
  }

  .footer-col-touch {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: none;
    margin-top: 0.25rem;
  }

  .footer-brand .logo {
    display: inline-flex;
    justify-content: center;
  }

  .footer-brand .logo img {
    height: 34px;
    width: auto;
    margin: 0 auto;
  }

  .footer-brand > p {
    font-size: 0.85rem !important;
    line-height: 1.55 !important;
    margin-top: 0.85rem !important;
    text-align: center;
  }

  .newsletter-form {
    text-align: left;
    margin-top: 1rem;
  }

  .newsletter-form label {
    color: var(--muted) !important;
    display: block;
    margin-bottom: 0.35rem;
  }

  .newsletter-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .newsletter-row input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }

  .newsletter-row .btn-primary {
    width: 100%;
  }

  .site-footer h4 {
    font-size: 0.9rem;
    margin: 0 0 0.85rem;
    padding-bottom: 0;
    border-bottom: none;
    width: 100%;
    text-align: center;
    letter-spacing: 0.02em;
  }

  .footer-col ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto;
    padding: 0;
  }

  .footer-col-links ul,
  .footer-col-categories ul {
    max-width: 18rem;
  }

  .footer-col ul.contact-list {
    max-width: 20rem;
    align-items: center;
  }

  .footer-col-touch h4 {
    text-align: center;
  }

  .footer-col-touch .contact-list {
    align-items: center;
    margin: 0 auto;
  }

  .footer-col-touch .contact-list li {
    text-align: center;
    width: 100%;
  }

  .footer-col-touch .site-address-text,
  .footer-col-touch .contact-list a {
    font-size: 0.85rem;
    text-align: center;
  }

  .footer-col li {
    margin-bottom: 0;
    width: 100%;
  }

  .footer-col-links a,
  .footer-col-categories a {
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 0.28rem 0.5rem;
    text-align: center;
  }

  .site-footer a {
    font-size: 0.8rem;
    line-height: 1.45;
    display: inline-block;
    padding: 0.15rem 0;
  }

  .footer-col-touch .social-links {
    justify-content: center;
    gap: 0.5rem 0.85rem;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 1rem;
  }

  .footer-bottom {
    padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
    font-size: 0.75rem;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .footer-bottom-inner > p {
    margin: 0;
    line-height: 1.4;
  }

  .footer-legal {
    justify-content: center;
    gap: 0.35rem 0.65rem;
  }

  .footer-legal a {
    margin-left: 0;
    padding: 0.35rem 0.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* —— Inner pages —— */
  .page-hero {
    padding: 1.5rem 0 0.65rem;
  }

  .page-hero h1 {
    font-size: clamp(1.4rem, 5.5vw, 1.85rem);
  }

  .form-card {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .form-card label {
    font-size: 0.85rem;
  }

  .form-card input,
  .form-card select {
    font-size: 16px;
    min-height: 44px;
  }

  .form-card textarea {
    font-size: 16px;
    min-height: 7rem;
    resize: vertical;
  }

  .contact-grid {
    gap: 1.25rem;
  }

  .card-grid,
  .blog-grid,
  .video-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .blog-list-header .section-title {
    font-size: 1.2rem;
  }

  .blog-hero-lead,
  .blog-list-sub {
    font-size: 0.88rem;
  }

  .blog-card-title {
    font-size: 1rem;
  }

  .blog-card-body {
    padding: 0.85rem 1rem 1rem;
  }

  .blog-article-hero h1 {
    font-size: 1.45rem;
  }

  .blog-article-img {
    max-height: 240px;
  }

  .blog-prose p,
  .blog-prose li {
    font-size: 0.95rem;
  }

  .contact-card-static .site-address-text {
    font-size: 0.88rem;
  }

  .section-videos .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .video-card {
    border-radius: 12px;
  }

  .video-embed-wrap {
    padding-bottom: 56.25%;
    min-height: 0;
  }

  .video-card-body {
    padding: 0.85rem 1rem 1rem;
  }

  .video-card-body h3 {
    font-size: 1rem;
  }

  .nav-quote-mobile {
    display: list-item;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .site-modal {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
  }

  .site-modal-panel {
    width: 100%;
    max-width: 100%;
    max-height: min(94dvh, 100%);
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    animation: site-modal-sheet-in 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  @keyframes site-modal-sheet-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  @media (prefers-reduced-motion: reduce) {
    .site-modal-panel {
      animation: none;
    }
  }

  .site-modal-handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0.55rem auto 0;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.35);
    flex-shrink: 0;
  }

  .site-modal-header {
    padding: 0.65rem 1rem 0.85rem;
    align-items: center;
  }

  .site-modal-header h2 {
    font-size: 1.1rem;
  }

  .site-modal-sub {
    font-size: 0.8rem;
  }

  .site-modal-close {
    min-width: 44px;
    padding: 0 0.75rem;
  }

  .site-modal-close-label {
    display: inline;
  }

  .site-modal-body {
    padding: 0.85rem 1rem 1rem;
  }

  .site-modal-footer {
    display: block;
  }

  .quote-form-compact input,
  .quote-form-compact textarea {
    font-size: 16px;
  }

  .quote-page-wrap {
    padding: 0 0.15rem;
  }

  .download-list li {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }

  .product-detail-grid {
    gap: 1.25rem;
  }

  .category-chip {
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
    min-height: 44px;
  }

  .products-active-title {
    font-size: 1.05rem;
  }

  .product-detail-actions {
    flex-direction: column;
  }

  .product-detail-actions .btn,
  .product-detail-actions .btn-whatsapp {
    width: 100%;
    justify-content: center;
  }

  .breadcrumb {
    font-size: 0.8rem;
    overflow-wrap: anywhere;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form input,
  .search-form button {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .flash {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }

  /* —— Mobile polish: all inner pages —— */
  .section {
    padding: 2.5rem 0;
  }

  .page-hero + .section {
    padding-top: 1.5rem;
  }

  .lead {
    font-size: 0.95rem;
  }

  .prose {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
  }

  .prose h2,
  .prose h3 {
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    margin-top: 1.5rem;
  }

  .info-card {
    border-radius: 12px;
    overflow: hidden;
  }

  .info-card img {
    height: 160px;
  }

  .trust-badges {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .trust-badges li {
    text-align: center;
    padding: 0.65rem 0.85rem;
    background: var(--secondary);
    border-radius: 10px;
    font-size: 0.85rem;
  }

  .dealer-hero h1 {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  }

  .contact-trio {
    gap: 0.85rem;
  }

  .trio-card {
    padding: 1.15rem;
    border-radius: 12px;
    min-height: 44px;
  }

  .trio-main {
    font-size: 1rem;
  }

  .products-toolbar {
    gap: 0.75rem;
  }

  .products-toolbar .section-title {
    font-size: 1.1rem;
  }

  .category-strip {
    margin: 0 calc(-1 * clamp(0.75rem, 3.5vw, 1rem));
    padding-left: clamp(0.75rem, 3.5vw, 1rem);
    padding-right: clamp(0.75rem, 3.5vw, 1rem);
    scroll-padding-inline: clamp(0.75rem, 3.5vw, 1rem);
  }

  .product-detail-img {
    width: 100%;
    max-height: min(70vw, 360px);
    object-fit: contain;
    object-position: center;
    background: var(--secondary);
  }

  .product-detail-info h1 {
    font-size: clamp(1.25rem, 5vw, 1.65rem);
  }

  .product-share-hint {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .download-list a.btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .contact-card,
  a.contact-card {
    padding: 1.15rem;
    border-radius: 12px;
    min-height: 44px;
  }

  .contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .about-grid {
    gap: 1.5rem;
  }

  .about-image img {
    border-radius: 12px;
    width: 100%;
  }

  .features-grid {
    gap: 0.75rem;
  }

  .feature-box {
    padding: 0.85rem;
    border-radius: 10px;
  }

  .page-empty {
    padding: 2rem 0.75rem;
  }

  #cursor-bubbles-canvas {
    display: none !important;
  }
}

/* Small phones — keep 2-column category grid */
@media (max-width: 639px) {
  .category-bento {
    gap: 0.5rem;
  }

  .cat-content {
    padding: 0.65rem 0.7rem;
  }

  .cat-content h3 {
    font-size: 0.8rem;
  }

  .cat-content p {
    -webkit-line-clamp: 1;
  }
}

/* Very small */
@media (max-width: 359px) {
  .top-ticker-group a {
    font-size: 0.62rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}
