/* =========================================================
   URWA Industry — Global responsive overrides
   Loaded last on all public + admin pages
   Breakpoints: 991 (tablet) · 767 (mobile) · 480 (small)
   ========================================================= */

/* ── Global tokens — mobile ─────────────────────────── */

@media (max-width: 991px) {
    :root {
        --page-hero-min-height: clamp(420px, 68vh, 580px);
        --page-hero-padding-top: calc(var(--site-header-height) + 48px);
        --page-hero-padding-bottom: 48px;
        --page-hero-padding-x: clamp(20px, 5vw, 40px);
    }

    body.has-editorial-header {
        --site-header-height: 72px;
    }
}

@media (max-width: 767px) {
    :root {
        --page-hero-min-height: clamp(360px, 62vh, 520px);
        --page-hero-padding-top: calc(var(--site-header-height) + 32px);
        --page-hero-padding-bottom: 40px;
        --page-hero-padding-x: 20px;
    }

    body.is-home-page {
        --site-header-height: 0px;
    }

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

/* ── Overflow / width safety ──────────────────────────── */

@media (max-width: 767px) {
    .site-header,
    .editorial-header,
    .editorial-header__inner,
    .header-detail-drawer {
        max-width: 100%;
    }

    .contact-hero__content,
    .contact-channels__grid,
    .contact-main__grid,
    .contact-banner__inner {
        width: 100% !important;
        max-width: 100% !important;
    }

    .catalog-toolbar,
    .blog-toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .catalog-toolbar input,
    .catalog-toolbar select,
    .catalog-toolbar button,
    .blog-toolbar input,
    .blog-toolbar select,
    .blog-toolbar button {
        min-width: 0 !important;
        flex: 1 1 100%;
        width: 100%;
    }
}

/* ── Header & drawer ──────────────────────────────────── */

@media (max-width: 767px) {
    .editorial-search-overlay__inner {
        padding-inline: 20px;
    }

    .editorial-search-form {
        flex-wrap: wrap;
        gap: 10px;
    }

    .editorial-search-form input {
        min-width: 0;
        flex: 1 1 auto;
        width: 100%;
    }

    .header-detail-drawer {
        width: min(100%, 100vw);
    }

    .header-detail-drawer__catalog-sub {
        grid-template-columns: 1fr;
    }

    .editorial-drawer__actions .catalog-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Home hero ───────────────────────────────────────── */

@media (max-width: 991px) {
    .home-section--hero .editorial-hero-copy {
        top: 50%;
        transform: translateY(-50%);
        padding-top: calc(36px + 64px);
    }
}

@media (max-width: 767px) {
    .home-section--hero .editorial-hero-copy {
        top: auto;
        bottom: clamp(72px, 14vh, 120px);
        transform: none;
        padding-top: 0;
    }

    .home-section--hero .editorial-hero-title {
        font-size: clamp(2rem, 11vw, 3.25rem);
        line-height: 0.95;
    }

    .home-section--hero .editorial-hero-tagline {
        font-size: 0.9rem;
        line-height: 1.55;
    }

    .home-section--process .home-manufacturing-flow {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    .home-flow-card {
        scroll-snap-align: start;
    }
}

@media (max-width: 480px) {
    .lp-product-grid,
    .lp-hero-strip {
        grid-template-columns: 1fr !important;
    }

    .home-category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Category split heroes ───────────────────────────── */

@media (max-width: 767px) {
    .cat-hub-hero--split {
        --cat-banner-height: clamp(320px, 58vw, 420px);
    }

    .cat-hub-hero--split .cat-hub-hero__content-panel {
        padding: 0 16px 20px;
        align-items: flex-end;
    }

    .cat-hub-hero--split .cat-hub-hero__content-panel .cat-hub-hero__content {
        padding-left: 18px;
        width: 100%;
    }

    .cat-hub-hero--split .cat-hub-hero__title--sport {
        font-size: clamp(1.5rem, 9vw, 2rem);
    }

    .cat-hub-hero--split .cat-hub-hero__lead {
        font-size: 0.88rem;
        line-height: 1.55;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .cat-hub-hero--split .cat-hub-hero__chips {
        gap: 6px;
        margin-bottom: 12px;
    }

    .cat-hub-hero--split .cat-hub-hero__chips li {
        font-size: 9px;
        padding: 6px 10px;
    }

    .cat-hub-hero--split .cat-hub-hero__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .cat-hub-hero--split .cat-hub-hero__actions .catalog-btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        text-align: center;
    }

    .cat-hub-hero:not(.cat-hub-hero--split) .cat-hub-hero__title {
        max-width: none !important;
    }

    .cat-hub-subnav__inner {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .cat-hub-subnav__item {
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .cat-hub-hero--split {
        --cat-banner-height: clamp(280px, 72vw, 360px);
    }

    .cat-hub-hero--split .cat-hub-hero__home-back {
        font-size: 0.68rem;
    }
}

/* ── Catalog / product grids ─────────────────────────── */

@media (max-width: 767px) {
    .catalog-grid,
    .catalog-grid--4,
    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .catalog-card--pro .catalog-card__actions {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .catalog-card--pro .catalog-card__actions .catalog-btn {
        width: auto;
        flex: 1 1 0;
    }

    .catalog-hero,
    .catalog-hero--split {
        padding-inline: 20px;
    }

    .pd-content {
        padding-inline: 20px;
    }

    .pd-specs div,
    .pd-specs--inline div {
        grid-template-columns: 1fr !important;
        gap: 4px;
    }

    .pd-specs dt,
    .pd-specs--inline dt {
        margin-bottom: 2px;
    }

    .pd-gallery {
        gap: 10px;
    }

    .pd-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pd-actions .catalog-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 600px) and (max-width: 991px) {
    .catalog-grid--4,
    .catalog-subcat-grid,
    .catalog-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* ── Inner page heroes (contact, faq, gallery, etc.) ─── */

@media (max-width: 767px) {
    body.has-editorial-header .page-hero h1,
    .contact-hero h1,
    .gallery-hero h1,
    .faq-hero h1,
    .mfg-hero h1,
    .blog-hero h1,
    .terms-hero h1,
    .privacy-hero h1 {
        max-width: none !important;
        font-size: clamp(1.85rem, 8.5vw, 2.5rem) !important;
        line-height: 1.05;
    }

    body.has-editorial-header .page-hero p,
    .contact-hero p,
    .gallery-hero p,
    .faq-hero p,
    .mfg-hero p,
    .blog-hero p {
        max-width: 100%;
        font-size: 0.92rem;
        line-height: 1.6;
    }

    .about-hero h1 {
        font-size: clamp(1.85rem, 8vw, 2.45rem);
    }

    .about-hero__inner {
        padding-inline: 0;
    }
}

/* ── Contact & forms ─────────────────────────────────── */

@media (max-width: 767px) {
    .contact-form__row,
    .nx-form-grid {
        grid-template-columns: 1fr !important;
    }

    .contact-form input,
    .contact-form select,
    .contact-form textarea,
    .nx-form-grid input,
    .nx-form-grid select,
    .nx-form-grid textarea {
        width: 100%;
        min-height: 44px;
    }

    .contact-channels__grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Blog ────────────────────────────────────────────── */

@media (max-width: 767px) {
    .blog-card__body {
        padding: 16px;
    }

    .blog-detail-hero h1,
    .article-pro h1 {
        font-size: clamp(1.65rem, 7vw, 2.2rem);
        line-height: 1.1;
    }

    .article-pro__content {
        padding: 20px 16px;
        font-size: 1rem;
        line-height: 1.75;
    }
}

/* ── Gallery ─────────────────────────────────────────── */

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .gallery-card__caption {
        font-size: 0.85rem;
    }
}

/* ── Manufacturing page ────────────────────────────── */

@media (max-width: 767px) {
    .mfg-process__track {
        gap: 20px;
    }

    .mfg-card {
        grid-template-columns: 1fr !important;
    }

    .mfg-intro__grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Home lower / premium sections ───────────────────── */

@media (max-width: 767px) {
    .premium-tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .premium-tab,
    .premium-tabs-nav button {
        flex: 0 0 auto;
    }

    .nx-why-track {
        padding-bottom: 8px;
    }

    .nx-faq-item summary {
        padding: 14px 16px;
        font-size: 0.92rem;
    }
}

/* ── Footer & floating actions ─────────────────────── */

@media (max-width: 767px) {
    .urwa-footer__grid {
        gap: 28px;
    }

    .urwa-footer__subscribe {
        grid-template-columns: 1fr !important;
    }

    .urwa-footer__subscribe input,
    .urwa-footer__subscribe button {
        width: 100%;
        min-height: 44px;
    }

    .urwa-footer__cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .urwa-footer__cta-actions .catalog-btn {
        width: 100%;
        justify-content: center;
    }

    .whatsapp-float {
        right: 14px;
        bottom: 14px;
        width: 48px;
        height: 48px;
    }
}

/* ── Admin panel ─────────────────────────────────────── */

@media (max-width: 991px) {
    .admin-toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .admin-toolbar input,
    .admin-toolbar select,
    .admin-search {
        min-width: 0 !important;
        flex: 1 1 100%;
        width: 100%;
    }

    .admin-catalog-layout {
        grid-template-columns: 1fr !important;
    }

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

@media (max-width: 767px) {
    .admin-content {
        padding: 16px;
    }

    .admin-card {
        padding: 16px;
    }

    .admin-table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-table-actions .admin-btn,
    .admin-table-actions a {
        width: 100%;
        text-align: center;
    }
}

/* ── Touch targets & accessibility ───────────────────── */

@media (max-width: 767px) {
    .catalog-btn,
    .editorial-hero-btn,
    .about-btn,
    .admin-btn,
    button,
    .cat-hub-subnav__item {
        min-height: 44px;
    }

    .home-section-dot {
        min-width: 28px;
        min-height: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-manufacturing-flow,
    .home-flow-track,
    .home-category-panel-row {
        animation: none !important;
        scroll-behavior: auto;
    }
}
