/* Adaptación automática: phone · phablet · tablet · desktop */

:root {
    --site-gutter: 1rem;
    --site-gutter-safe-l: max(var(--site-gutter), env(safe-area-inset-left, 0px));
    --site-gutter-safe-r: max(var(--site-gutter), env(safe-area-inset-right, 0px));
}

html[data-device="phone"],
html[data-device="phablet"] {
    --site-gutter: 0.85rem;
}

html[data-device="tablet"] {
    --site-gutter: 0.95rem;
}

html[data-device="desktop"],
html[data-device="desktop-lg"] {
    --site-gutter: 1rem;
}

/* Contenedores y base */
.public-site .container,
.public-site .container-fluid {
    padding-left: var(--site-gutter-safe-l);
    padding-right: var(--site-gutter-safe-r);
}

html[data-device="phone"] .public-site,
html[data-device="phablet"] .public-site {
    overflow-x: clip;
}

html[data-device="phone"] .site-main,
html[data-device="phablet"] .site-main {
    min-width: 0;
}

/* Topbar — teléfono */
html[data-device="phone"] .public-topbar {
    font-size: 0.74rem;
}

html[data-device="phone"] .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.45rem 0;
}

html[data-device="phone"] .topbar-contact {
    justify-content: center;
    gap: 0.35rem 0.55rem;
}

html[data-device="phone"] .topbar-link span {
    max-width: 9.5rem;
}

html[data-device="phone"] .topbar-link.topbar-text {
    display: none;
}

html[data-device="phone"] .topbar-social {
    justify-content: center;
    margin-left: 0;
}

html[data-device="phablet"] .topbar-link span {
    max-width: 11rem;
}

/* Nav — móvil y tablet */
@media (max-width: 991.98px) {
    .public-nav .container {
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.35rem;
    }

    .public-nav .nav-brand-group {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 3.25rem);
        margin-left: 0;
        margin-right: 0.35rem;
    }

    .public-nav .navbar-toggler {
        flex-shrink: 0;
        margin-left: auto;
        padding: 0.4rem 0.55rem;
    }

    .public-nav #publicNav {
        flex: 0 0 100%;
        width: 100%;
    }
}

html[data-device="phone"] .logo-tech-nav .site-logo {
    height: 44px;
    max-width: min(58vw, 168px);
}

html[data-device="phablet"] .logo-tech-nav .site-logo {
    height: 48px;
    max-width: min(50vw, 185px);
}

html[data-device="phone"] .logo-tech-nav .logo-pcb-layer,
html[data-device="phone"] .logo-tech-nav .logo-pcb-vert,
html[data-device="phone"] .logo-tech-nav .logo-pcb-node {
    display: none;
}

html[data-device="phone"] .public-nav .nav-link-pill,
html[data-device="phablet"] .public-nav .nav-link-pill {
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem !important;
}

html[data-device="phone"] .public-nav .btn-nav-glow {
    width: 100%;
    justify-content: center;
    margin-top: 0.35rem;
}

html[data-device="phone"] .nav-tagline-mobile {
    margin-top: 0.35rem;
    padding-top: 0.65rem;
}

html[data-device="phone"] .nav-tagline-mobile .nav-tagline {
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: normal;
}

html[data-device="phone"] .public-site-header {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Secciones y títulos */
html[data-device="phone"] .public-section {
    padding: 2.35rem 0;
}

html[data-device="phablet"] .public-section {
    padding: 2.75rem 0;
}

html[data-device="tablet"] .public-section {
    padding: 3.25rem 0;
}

html[data-device="phone"] .public-page-header {
    padding: 2rem 0 1.5rem;
}

html[data-device="phone"] .public-page-header h1 {
    font-size: clamp(1.4rem, 6.5vw, 1.85rem);
    line-height: 1.2;
}

html[data-device="phone"] .public-page-header p {
    font-size: 0.92rem;
    padding: 0 0.25rem;
}

html[data-device="phone"] .public-cta {
    padding: 2.5rem 0;
}

html[data-device="phone"] .public-cta h2 {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
}

html[data-device="phone"] .public-cta .btn-lg {
    width: 100%;
    max-width: 320px;
}

/* Sobre nosotros */
html[data-device="phone"] .about-content-panel {
    padding: 1.35rem 1rem 1.35rem 1.45rem;
    border-radius: 14px;
}

html[data-device="phone"] .about-content-panel::before {
    left: 0.95rem;
}

html[data-device="phone"] .about-paragraph {
    font-size: 0.98rem;
    line-height: 1.65;
}

html[data-device="phone"] .about-lead {
    font-size: 1.05rem;
}

html[data-device="phablet"] .about-content-panel {
    padding: 1.65rem 1.35rem 1.65rem 1.85rem;
}

/* Footer */
html[data-device="phone"] .footer-main {
    padding: 1.75rem 0 1.25rem;
}

html[data-device="phone"] .footer-main .col-6 {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

html[data-device="phone"] .footer-logo {
    max-height: 76px;
    max-width: min(72vw, 220px);
}

html[data-device="phone"] .footer-company-name {
    font-size: 1.1rem;
}

html[data-device="phone"] .footer-tagline {
    font-size: 0.88rem;
}

html[data-device="phone"] .footer-bottom {
    text-align: center;
}

html[data-device="phone"] .footer-bottom .d-flex {
    flex-direction: column;
    align-items: center !important;
}

html[data-device="phone"] .public-footer {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Home */
html[data-device="phone"] .home-hero-carousel,
html[data-device="phone"] .home-hero-carousel .carousel-item,
html[data-device="phone"] .carousel-caption-wrap {
    min-height: 360px;
}

html[data-device="phone"] .carousel-caption-wrap {
    padding: 4.5rem 0 3.25rem;
}

html[data-device="phone"] .carousel-caption-wrap h2 {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
}

html[data-device="phone"] .carousel-caption-wrap p {
    font-size: 0.92rem;
}

html[data-device="phone"] .home-page .section-head-glass {
    padding: 1.35rem 1.15rem;
    border-radius: 16px;
}

html[data-device="phone"] .stat-pill {
    min-width: calc(50% - 0.35rem);
    font-size: 0.82rem;
}

html[data-device="phablet"] .home-hero-carousel,
html[data-device="phablet"] .home-hero-carousel .carousel-item,
html[data-device="phablet"] .carousel-caption-wrap {
    min-height: 390px;
}

/* Catálogo, formularios, tarjetas */
html[data-device="phone"] .public-product-card .card-body,
html[data-device="phone"] .feature-box,
html[data-device="phone"] .public-form-card,
html[data-device="phone"] .contact-info-card {
    padding: 1.25rem 1rem;
}

html[data-device="phone"] .catalog-filter {
    padding: 1rem !important;
}

html[data-device="phone"] .catalog-filter .row > [class*="col-"] {
    margin-bottom: 0.35rem;
}

/* Loader */
html[data-device="phone"] .page-loader-inner {
    padding: 0 1rem;
}

html[data-device="phone"] .page-loader-brand {
    font-size: clamp(1.2rem, 5.5vw, 1.55rem) !important;
}

html[data-device="phone"] .loader-circuit-r {
    width: min(28vw, 120px);
}

html[data-device="phablet"] .loader-circuit-r {
    width: min(32vw, 160px);
}

/* Tablet intermedio */
html[data-device="tablet"] .public-nav .nav-brand-group {
    max-width: min(360px, 42vw);
}

html[data-device="tablet"] .footer-main .col-6 {
    flex: 0 0 50%;
    width: 50%;
}
