/**
 * Consolata — site-wide responsive enhancements
 * Loaded after premium.css; complements existing breakpoint rules.
 */

/* ─── Foundations ─── */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: clip;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
}

.container {
    width: min(1240px, calc(100vw - 2rem));
}

@media (max-width: 480px) {
    .container {
        width: min(1240px, calc(100vw - 1.25rem));
    }

    :root {
        --header-h: 68px;
        --section-pad: 2.75rem;
    }
}

/* ─── Header & navigation ─── */
@media (max-width: 1024px) {
    .header-wrap {
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: center;
        gap: 0.5rem 0.65rem;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .header-end {
        grid-column: 2;
        grid-row: 1;
        gap: 0.4rem;
    }

    .nav-toggle {
        grid-column: 3;
        grid-row: 1;
        margin-left: 0;
        flex-shrink: 0;
    }

    .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

    .nav-cta-mobile {
        display: list-item;
        margin-top: 0.35rem;
        padding-top: 0.35rem;
        border-top: 1px solid var(--border);
    }

    .nav-link--cta {
        text-align: center;
        color: var(--white) !important;
        background: var(--brand) !important;
    }

    .nav-link--cta:hover {
        background: var(--brand-dark) !important;
    }

    .header-cta {
        display: none !important;
    }

    .theme-toggle,
    .header-lang,
    .header-account,
    .header-cart {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .brand-logo {
        height: 42px;
    }
}

@media (min-width: 1025px) {
    .nav-cta-mobile {
        display: none;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding: 0.5rem 0;
    }

    .header-end .header-lang-flag {
        font-size: 1.15rem;
    }
}

/* Mobile nav backdrop */
@media (max-width: 1024px) {
    body.nav-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 298;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(2px);
    }
}

/* ─── Hero (static & page) ─── */
@media (max-width: 768px) {
    .hero-static {
        min-height: auto;
        min-height: unset;
    }

    .hero-static__inner {
        padding: clamp(5.5rem, 18vw, 7rem) 0 2rem;
    }

    .hero-static .hero-title {
        font-size: clamp(1.65rem, 7vw, 2.35rem);
    }

    .hero-static .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-static__pills {
        gap: 0.4rem;
    }

    .hero-static__pills li {
        font-size: 0.72rem;
        padding: 0.35rem 0.65rem;
    }

    .hero-info-inner {
        grid-template-columns: 1fr !important;
    }

    .page-hero__content h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .page-hero__content p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero-orb--1 {
        width: 200px;
        height: 200px;
    }

    .hero-orb--2,
    .hero-orb--3 {
        width: 140px;
        height: 140px;
    }
}

/* ─── Sections & grids ─── */
@media (max-width: 1024px) {
    .section {
        padding: var(--section-pad) 0;
    }

    .section-title-row {
        margin-bottom: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .service-cards,
    .cards-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-newsletter-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .trust-strip-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .cta-panel,
    .cta-banner-inner {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .cta-panel .btn,
    .cta-banner-inner .btn {
        width: 100%;
    }

    .service-columns {
        gap: 2rem;
    }

    .check-list li {
        font-size: 0.9rem;
    }
}

/* ─── Catalog & product ─── */
@media (max-width: 768px) {
    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .catalog-toolbar form,
    .catalog-toolbar .catalog-sort {
        width: 100%;
    }

    .catalog-filters-row {
        flex-wrap: wrap;
    }

    .product-detail-gallery {
        margin-bottom: 1.5rem;
    }

    .product-order-form .qty-row,
    .stock-notify-form .qty-row {
        flex-direction: column;
        align-items: stretch;
    }

    .product-order-form .btn,
    .stock-notify-form .btn,
    .product-order-form input,
    .stock-notify-form input {
        width: 100%;
    }

    .qty-stepper {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-card-actions {
        flex-direction: column;
    }

    .product-card-actions .btn {
        width: 100%;
    }
}

/* ─── Cart, checkout, tables ─── */
.cart-table-wrap,
.admin-content .admin-table-wrap,
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.cart-table,
.track-items-table,
.admin-table {
    min-width: 520px;
}

@media (max-width: 768px) {
    .checkout-layout {
        gap: 1.5rem;
    }

    .checkout-panel,
    .checkout-summary {
        padding: 1.25rem;
    }

    .form-row,
    .form-row-2 {
        grid-template-columns: 1fr !important;
    }

    .cart-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-actions .btn {
        width: 100%;
    }
}

/* ─── Forms & search ─── */
@media (max-width: 640px) {
    .contact-form .form-row,
    .search-page-form {
        max-width: none;
    }

    .footer-newsletter-form {
        flex-direction: column;
        width: 100%;
    }

    .footer-newsletter-form input,
    .footer-newsletter-form button {
        width: 100%;
    }

    .btn-lg {
        padding: 0.9rem 1.35rem;
        font-size: 0.95rem;
    }
}

/* ─── Promo, cookie, floating widgets ─── */
@media (max-width: 640px) {
    .promo-banner {
        font-size: 0.8rem;
        padding: 0.55rem 0;
        text-align: center;
    }

    .promo-banner-inner {
        padding: 0 0.25rem;
    }

    .cookie-consent {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 1rem;
        gap: 0.75rem;
    }

    .cookie-consent .btn {
        width: 100%;
    }

    .whatsapp-float {
        right: 1rem;
        bottom: 5rem;
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    .scroll-top-btn {
        right: 1rem;
        bottom: 1.25rem;
    }
}

/* ─── Blog, CMS, misc pages ─── */
@media (max-width: 768px) {
    .blog-list {
        grid-template-columns: 1fr;
    }

    .cert-grid {
        grid-template-columns: 1fr;
    }

    .prose,
    .cms-body,
    .container-narrow {
        max-width: 100%;
    }

    .track-form .btn-block {
        width: 100%;
    }
}

/* ─── Customer auth (login / register) ─── */
@media (max-width: 960px) {
    .customer-auth {
        grid-template-columns: 1fr;
    }

    .customer-auth-showcase {
        min-height: 200px;
        padding: 1.5rem;
    }

    .customer-auth-showcase-features {
        display: none;
    }

    .customer-auth-panel {
        padding: 1.5rem 1.25rem 2rem;
    }

    .customer-auth-card {
        padding: 1.75rem 1.25rem;
    }
}

@media (max-width: 520px) {
    .customer-auth-form .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* ─── Admin extras ─── */
@media (max-width: 900px) {
    .admin-card,
    .admin-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-topbar-inner {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .admin-topbar h1 {
        font-size: 1.15rem;
    }
}

@media (max-width: 560px) {
    .admin-filters,
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-filters input,
    .admin-filters select,
    .admin-toolbar .btn {
        width: 100%;
    }
}

/* Touch targets */
@media (max-width: 1024px) and (pointer: coarse) {
    .nav-link {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
    }
}
