/* ========================================
   N&D's Air Conditioning & Refrigeration
   Unified Premium Production-Ready Stylesheet
   ======================================== */

:root {
    --primary: #0A66C2;
    --primary-dark: #084B8A;
    --secondary: #1E3A5F;
    --accent: #F4A261;
    --success: #2A9D8F;
    --danger: #E63946;
    --light: #F8F9FA;
    --dark: #1A1A2E;
    --gray: #6C757D;
    --white: #FFFFFF;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-width: 0;
}

html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    font-family: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: #333;
    background: #fff;
    min-width: 0;
    overflow-x: hidden;
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    overflow-wrap: anywhere;
}

a:hover {
    color: var(--primary-dark);
}

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

img,
svg,
video {
    height: auto;
    display: block;
}

table {
    width: 100%;
    max-width: 100%;
}

p,
li,
h1,
h2,
h3,
h4,
h5,
h6,
span,
strong,
td,
th {
    overflow-wrap: break-word;
}

/* Container */
.container {
    width: 100%;
    max-width: min(1280px, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-emergency, .btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
    gap: 8px;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(10, 102, 194, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 102, 194, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-emergency {
    background: var(--danger);
    color: white;
    font-weight: 700;
}

.btn-emergency:hover {
    background: #C53030;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.875rem;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.15rem;
}

/* Header & Navigation */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    min-height: 70px;
}

.logo img {
    max-height: 56px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 8px;
}

.nav-menu li a {
    padding: 10px 16px;
    font-weight: 600;
    color: var(--secondary);
    border-radius: 6px;
    transition: var(--transition);
    position: relative;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--primary);
    background: #f0f7ff;
}

.nav-menu li a.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    width: calc(100% - 32px);
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.cart-link {
    position: relative;
    padding: 10px 14px !important;
}

.cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 9999px;
    min-width: 16px;
    text-align: center;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--secondary);
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #0A66C2 0%, #1E3A5F 100%);
    color: white;
    padding: 80px 0 70px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><circle cx=%2250%22 cy=%2250%22 r=%223%22 fill=%22rgba(255,255,255,0.06)%22/></svg>') repeat;
    background-size: 60px 60px;
    opacity: 0.4;
}

.hero-content {
    max-width: 780px;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.1rem;
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 800;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 32px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 50px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    text-align: left;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.85;
}

/* Trust Bar */
.trust-bar {
    background: #f8f9fa;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
}

.trust-logos {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-weight: 600;
    color: var(--gray);
    font-size: 0.95rem;
}

/* Services Overview */
.services-overview {
    padding: 100px 0;
    background: #fff;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 14px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 28px;
}

.service-card {
    background: white;
    padding: 36px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #f1f1f1;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.service-icon {
    width: 68px;
    height: 68px;
    background: #f0f7ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.85rem;
    margin-bottom: 22px;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.service-card p {
    color: #555;
    margin-bottom: 24px;
    line-height: 1.65;
}

.learn-more {
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    min-width: 0;
    max-width: 100%;
}

.learn-more:hover {
    border-bottom-color: var(--primary);
}

/* Featured Products */
.featured-products {
    padding: 100px 0;
    background: #f8f9fa;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 26px;
}

.product-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-6px);
}

.product-image {
    height: 180px;
    background: linear-gradient(135deg, #f0f7ff, #e6f0ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.product-info {
    padding: 22px;
}

.product-category {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: #f0f7ff;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 8px;
}

.product-info h4 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 12px;
}

.product-rating {
    color: #f4a261;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

/* Why Us */
.why-us {
    padding: 100px 0;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 30px;
}

.why-item {
    text-align: center;
    padding: 30px 20px;
}

.why-item i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.why-item h4 {
    margin-bottom: 12px;
    font-size: 1.25rem;
}

/* Testimonials */
.testimonials-preview {
    padding: 100px 0;
    background: #f8f9fa;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 28px;
}

.testimonial-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.testimonial-content p {
    font-style: italic;
    color: #444;
    line-height: 1.75;
    margin-bottom: 24px;
}

.testimonial-author {
    border-top: 1px solid #eee;
    padding-top: 18px;
}

.testimonial-author strong {
    display: block;
    color: var(--secondary);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--accent), #f4a261);
    padding: 80px 0;
    text-align: center;
    color: white;
}

.cta-section h2 {
    font-size: 2.6rem;
    margin-bottom: 14px;
    color: white;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 32px;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.site-footer {
    background: var(--secondary);
    color: #c8d6e5;
    padding: 80px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 50px;
    margin-bottom: 60px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo {
    max-height: 42px;
}

.footer-column h3 {
    color: white;
    font-size: 1.15rem;
    margin-bottom: 22px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #c8d6e5;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #3d4f6b;
    padding-top: 26px;
    text-align: center;
    font-size: 0.9rem;
    color: #8ba3c0;
}

/* Page Header */
.page-header {
    background: var(--secondary);
    color: white;
    padding: 90px 0 70px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    color: white;
    margin-bottom: 12px;
}

/* Product Filters */
.product-filters {
    background: white;
    padding: 30px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10,102,194,0.1);
}

/* Responsive */
@media (max-width: 992px) {
    .nav-toggle { display: block; }
    .hero h1 { font-size: 2.4rem; }
    .section-title { font-size: 2.1rem; }
}

@media (max-width: 768px) {
    .hero { padding: 80px 0 70px; }
    .services-grid, .products-grid, .why-grid { grid-template-columns: 1fr; }
    .hero-buttons { flex-direction: column; }
    .btn-primary, .btn-secondary, .btn-emergency { width: 100%; }
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

/* Product Detail & Other Pages */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

@media (max-width: 900px) {
    .product-detail-grid { grid-template-columns: 1fr; }
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
}

.gallery-item img {
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Booking & Contact */
.appointment-section {
    padding: 80px 0;
}

/* Animation helpers */
.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ========================================
   Production mobile/performance hardening
   ======================================== */
:root {
    --header-height: 70px;
    --header-height-mobile: 64px;
}

html,
body {
    max-width: 100%;
}

body.menu-open {
    overflow: hidden;
}

.site-header {
    min-height: var(--header-height);
    backdrop-filter: saturate(180%) blur(10px);
}

.header-content {
    min-height: var(--header-height);
    padding: 7px 0;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    min-width: 0;
}

.logo a {
    display: inline-flex;
    align-items: center;
}

.logo img,
.site-logo {
    max-height: 54px;
    width: auto;
    flex-shrink: 0;
}

.nav-toggle {
    position: relative;
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle:focus-visible,
.nav-menu a:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-emergency:focus-visible,
.floating-action:focus-visible {
    outline: 3px solid rgba(244, 162, 97, 0.75);
    outline-offset: 3px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    position: absolute;
    left: 50%;
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: var(--secondary);
    transform: translateX(-50%);
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
    content: '';
}

.hamburger { top: 50%; }
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

.nav-toggle.active .hamburger {
    transform: translateX(-50%) rotate(45deg);
}

.nav-toggle.active .hamburger::before {
    top: 0;
    opacity: 0;
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: translateX(-50%) rotate(-90deg);
}

.hero {
    min-height: auto;
    padding: clamp(56px, 8vw, 90px) 0 clamp(48px, 7vw, 78px);
    background:
        linear-gradient(135deg, rgba(5, 42, 82, 0.94) 0%, rgba(10, 102, 194, 0.90) 48%, rgba(30, 58, 95, 0.96) 100%);
}

.hero-content {
    animation: fadeInUp 0.7s ease both;
}

.hero h1 {
    color: var(--white);
    font-size: clamp(2.15rem, 5vw, 3.4rem);
    letter-spacing: -0.035em;
    text-wrap: balance;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.22);
}

.hero p {
    color: var(--white);
    font-size: clamp(1.05rem, 2.5vw, 1.28rem);
    max-width: 680px;
    opacity: 0.98;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.hero .btn-secondary {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.08);
}

.hero .btn-secondary:hover {
    background: var(--white);
    color: var(--primary-dark);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-emergency:hover,
.btn-sm:hover {
    color: var(--white);
}

.services-overview,
.featured-products,
.why-us,
.testimonials-preview,
.appointment-section {
    padding: clamp(56px, 8vw, 100px) 0;
}

.page-header {
    padding: clamp(54px, 7vw, 90px) 0 clamp(42px, 6vw, 70px);
}

.section-header {
    margin-bottom: clamp(32px, 5vw, 60px);
}

.section-title,
.page-header h1,
.cta-section h2 {
    font-size: clamp(1.85rem, 4.8vw, 3rem);
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.services-grid,
.products-grid,
.why-grid,
.testimonials-grid,
.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.product-actions,
.product-info [style*="display:flex"],
.hero-buttons,
.cta-buttons {
    align-items: stretch;
}

.product-actions .btn-primary,
.product-actions .btn-secondary,
.product-info [style*="display:flex"] .btn-primary,
.product-info [style*="display:flex"] .btn-secondary {
    min-width: 0;
}

.form-group input.field-error,
.form-group select.field-error,
.form-group textarea.field-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.12);
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.floating-actions {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.floating-action {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 999px;
    color: var(--white);
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.floating-action:hover {
    color: var(--white);
    transform: translateY(-2px);
}

.whatsapp-action { background: #25D366; }
.phone-action { background: var(--primary); }

@media (max-width: 992px) {
    .site-header {
        min-height: var(--header-height-mobile);
    }

    .header-content {
        min-height: var(--header-height-mobile);
        padding: 5px 0;
    }

    .logo img,
    .site-logo {
        max-height: 48px;
        max-width: min(64vw, 235px);
        object-fit: contain;
        object-position: left center;
    }

    .main-nav {
        margin-left: auto;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 9px;
        right: max(14px, env(safe-area-inset-right));
        z-index: 1201;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height-mobile);
        right: 0;
        left: auto;
        width: min(100%, 420px);
        max-width: 100%;
        max-height: calc(100dvh - var(--header-height-mobile));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
        box-shadow: 0 18px 40px rgba(10, 33, 60, 0.18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.24s ease, visibility 0.24s ease;
        z-index: 1200;
    }

    .nav-menu.active {
        left: auto;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 14px 16px;
        width: 100%;
        text-align: center;
        border-radius: 10px;
    }

    .nav-menu li a.active::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 44px 0 42px;
    }

    .hero h1 {
        margin-bottom: 16px;
    }

    .hero p {
        margin-bottom: 24px;
        line-height: 1.6;
    }

    .hero-buttons,
    .cta-buttons,
    .product-actions,
    .product-info [style*="display:flex"] {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    .btn-emergency,
    .hero-buttons a,
    .cta-buttons a,
    .product-actions a,
    .product-actions button,
    .product-info [style*="display:flex"] a,
    .product-info [style*="display:flex"] button {
        width: 100% !important;
        min-height: 48px;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 8px;
    }

    .stat {
        padding: 14px 16px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.1);
        text-align: center;
    }

    .trust-bar {
        padding: 14px 0;
    }

    .trust-logos {
        gap: 10px;
        text-align: center;
        font-size: 0.9rem;
    }

    .service-card,
    .testimonial-card {
        padding: 26px 22px;
    }

    .filters-header,
    [style*="justify-content:space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .floating-actions {
        right: 12px;
        bottom: 12px;
        left: 12px;
        flex-direction: row;
    }

    .floating-action {
        flex: 1;
        min-height: 48px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .logo img,
    .site-logo {
        max-height: 44px;
        max-width: 100%;
    }

    .nav-toggle {
        top: calc((var(--header-height-mobile, 64px) - 40px) / 2);
        right: clamp(16px, 4.5vw, 20px);
    }

    .hero {
        padding: 36px 0 36px;
    }

    .hero h1 {
        font-size: 2rem;
        margin-bottom: 12px;
    }

    .hero p {
        margin-bottom: 20px;
    }

    .hero-buttons {
        width: 90%;
        margin: 0 auto;
        gap: 12px !important;
    }

    .hero-stats {
        margin-top: 16px;
        gap: 12px;
    }

    .stat {
        padding: 10px 12px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .service-card {
        padding: 24px 16px;
    }

    body {
        padding-bottom: 80px;
    }

    .floating-action span {
        display: none;
    }

    .btn-primary,
    .btn-secondary,
    .btn-emergency {
        padding-left: 18px;
        padding-right: 18px;
    }
}


/* ========================================
   Responsive overflow hardening
   Root-cause fixes for narrow viewports
   ======================================== */
main,
section,
header,
footer,
.container,
.header-content,
.footer-content,
.product-card,
.service-card,
.testimonial-card,
.form-group,
.product-info,
.product-detail-content,
.product-detail-content > *,
.related-product-card,
.gallery-item {
    min-width: 0;
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
    min-width: 0;
}

.footer-content {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.footer-brand {
    flex-wrap: wrap;
}

[style*="repeat(auto-fit,minmax(320px"],
[style*="repeat(auto-fit, minmax(320px"] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
}

[style*="repeat(auto-fit,minmax(260px"],
[style*="repeat(auto-fit, minmax(260px"] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important;
}

[style*="repeat(auto-fit,minmax(240px"],
[style*="repeat(auto-fit, minmax(240px"] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
}

[style*="repeat(auto-fit,minmax(220px"],
[style*="repeat(auto-fit, minmax(220px"] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

.product-detail-section,
.products-section,
.related-products,
.service-overview,
.installation-process,
.system-types,
.installation-gallery,
.detailed-services,
.walkin-types,
.components-serviced,
.common-issues,
.our-services,
.gallery-section {
    padding: clamp(48px, 7vw, 80px) 0;
}

.product-detail-content,
.service-content,
.systems-grid,
.benefits-grid,
.features-grid,
.types-grid,
.components-grid,
.issues-grid,
.related-products-grid,
.stats-grid,
.problems-grid,
.tips-grid,
.applications-grid,
.zones-grid,
.specialties-grid,
.emergency-grid,
.preparedness-grid,
.maintenance-grid,
.plans-grid,
.seasonal-grid,
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(20px, 4vw, 40px);
    align-items: start;
}

.service-hero,
.installation-benefits,
.products-header,
.products-pagination,
.products-sort,
.product-meta,
.thumbnail-slider,
.tab-buttons,
.services-tabs,
.process-steps,
.intervals-grid {
    max-width: 100%;
    min-width: 0;
}

.products-header,
.products-pagination,
.products-sort,
.product-meta,
.tab-buttons,
.intervals-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.products-header {
    justify-content: space-between;
    margin-bottom: 28px;
}

.products-pagination {
    justify-content: center;
    margin-top: 32px;
}

.product-detail-content {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.product-gallery,
.main-image,
.product-specs,
#productSpecificationsTable,
#checkoutSummary,
#cartContent {
    max-width: 100%;
    min-width: 0;
}

.main-image {
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.main-image img,
.related-product-card img,
.placeholder-image {
    width: 100%;
    max-width: 100%;
    object-fit: contain;
}

.main-image img {
    aspect-ratio: 4 / 3;
    padding: 20px;
}

.thumbnail-slider {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

#productSpecificationsTable {
    border-collapse: collapse;
    table-layout: fixed;
}

#productSpecificationsTable td,
#productSpecificationsTable th {
    padding: 12px;
    border-bottom: 1px solid #e8eef5;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.related-product-card {
    background: var(--white);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.related-product-card .btn-secondary {
    margin-top: 12px;
}

.product-actions {
    flex-wrap: wrap;
}

.product-actions input[type="number"] {
    width: 92px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#checkoutSummary [style*="display:flex"],
#checkoutSummary [style*="display: flex"] {
    flex-wrap: wrap !important;
    gap: 10px !important;
}

#checkoutSummary span,
#cartContent td,
#cartContent th {
    min-width: 0;
    overflow-wrap: anywhere;
}

.toast {
    max-width: calc(100% - 32px);
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .product-detail-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .product-actions input[type="number"] {
        width: 100% !important;
        min-height: 48px;
    }

    .products-header,
    .products-sort,
    .products-pagination,
    .tab-buttons,
    .intervals-grid {
        align-items: stretch;
    }

    .products-header > *,
    .products-sort > *,
    .products-pagination > *,
    .tab-buttons > *,
    .intervals-grid > * {
        max-width: 100%;
    }

    .product-specs table,
    #productSpecificationsTable,
    #productSpecificationsTable tbody,
    #productSpecificationsTable tr,
    #productSpecificationsTable td,
    #productSpecificationsTable th {
        display: block;
        width: 100% !important;
    }

    #productSpecificationsTable tr {
        padding: 10px 0;
        border-bottom: 1px solid #e8eef5;
    }

    #productSpecificationsTable td,
    #productSpecificationsTable th {
        border-bottom: 0;
        padding: 6px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .service-card,
    .testimonial-card,
    .product-info,
    .related-product-card {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    [style*="grid-template-columns:1fr 380px"],
    [style*="grid-template-columns: 1fr 380px"] {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }

    #cartContent table,
    #cartContent thead,
    #cartContent tbody,
    #cartContent th,
    #cartContent td,
    #cartContent tr {
        display: block;
        width: 100% !important;
    }

    #cartContent table {
        border-collapse: separate !important;
        border-spacing: 0 14px !important;
    }

    #cartContent thead {
        position: absolute;
        width: 1px !important;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    #cartContent tr {
        background: var(--white);
        border: 1px solid #e8eef5 !important;
        border-radius: 14px;
        padding: 12px;
        box-shadow: var(--shadow);
    }

    #cartContent td {
        padding: 8px 4px !important;
        text-align: left !important;
    }

    #cartContent td:nth-child(2)::before { content: 'Price: '; font-weight: 700; }
    #cartContent td:nth-child(3)::before { content: 'Quantity: '; font-weight: 700; }
    #cartContent td:nth-child(4)::before { content: 'Total: '; font-weight: 700; }

    #cartContent input[type="number"] {
        width: 86px !important;
        min-height: 42px;
    }

    #cartContent [style*="text-align:right"] {
        text-align: center !important;
    }
}

/* Website Content Manager — dynamic elements */
.emergency-banner{background:#b91c1c;color:#fff;padding:10px 0;font-weight:600}
.emergency-banner .container{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.emergency-banner a{color:#fff;text-decoration:underline;margin-left:auto;font-weight:700}
.emergency-banner[hidden]{display:none}
[data-emergency-banner][hidden]{display:none}
.testimonial-photo img{width:44px;height:44px;border-radius:50%;object-fit:cover;display:block;margin-top:6px}
.testimonial-rating{color:#f59e0b;margin-top:6px}
.gallery-item{display:block;position:relative;border-radius:10px;overflow:hidden}
.gallery-item img{width:100%;height:220px;object-fit:cover;display:block}
.gallery-caption{position:absolute;left:0;right:0;bottom:0;background:rgba(0,0,0,.55);color:#fff;padding:6px 10px;font-size:.85rem}
.faq-item{border:1px solid #e2e8f0;border-radius:10px;padding:16px;margin-bottom:12px}
.faq-item h3{margin:0 0 6px}
.promo-card{border:1px solid #e2e8f0;border-radius:12px;padding:20px;position:relative;overflow:hidden}
.promo-badge{position:absolute;top:12px;right:12px;background:#0e7490;color:#fff;padding:3px 10px;border-radius:99px;font-size:.72rem;font-weight:700}
.team-card{text-align:center;border:1px solid #e2e8f0;border-radius:12px;padding:20px}
.team-photo img{width:96px;height:96px;border-radius:50%;object-fit:cover}
.team-role{color:#0e7490;font-weight:600;margin:4px 0}
