/* ================================
   Home Cam & Alarm Services
   Responsive Styles
   ================================ */

/* ================================
   Tablet (768px and below)
   ================================ */
@media (max-width: 768px) {
    /* Typography */
    :root {
        --font-size-h1: 36px;
        --font-size-h2: 28px;
        --font-size-h3: 22px;
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--color-secondary);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: var(--spacing-lg);
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

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

    .nav-menu a {
        display: block;
        padding: var(--spacing-md);
        font-size: 18px;
    }

    .btn-nav {
        width: 80%;
        margin: var(--spacing-sm) auto;
    }

    .hamburger {
        display: flex;
    }

    /* Hero Section */
    .hero {
        min-height: 500px;
        padding: var(--spacing-lg) 0;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
        justify-content: center;
        display: flex;
        align-items: center;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Area Grid */
    .area-grid {
        grid-template-columns: 1fr;
    }

    /* Trust Grid */
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Gallery Preview */
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* About Page */
    .about-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Contact Page */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-info-sidebar {
        order: -1;
    }

    /* Quote Page */
    .quote-form-wrapper {
        grid-template-columns: 1fr;
    }

    .quote-sidebar {
        order: -1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Lightbox */
    .lightbox-prev,
    .lightbox-next {
        display: none;
    }

    /* Contact Details */
    .contact-details {
        grid-template-columns: 1fr;
    }

    /* Steps Grid */
    .steps-grid {
        grid-template-columns: 1fr;
    }

    /* Quote Benefits */
    .quote-benefits {
        flex-direction: column;
        align-items: center;
    }
}

/* ================================
   Mobile (480px and below)
   ================================ */
@media (max-width: 480px) {
    /* Typography */
    :root {
        --font-size-h1: 32px;
        --font-size-h2: 24px;
        --font-size-h3: 20px;
        --spacing-lg: 32px;
        --spacing-xl: 48px;
    }

    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Hero */
    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    /* Buttons */
    .btn-large {
        padding: 14px 24px;
        font-size: 16px;
    }

    /* Service Cards */
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    /* Trust Grid */
    .trust-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery */
    .preview-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        width: 100%;
    }

    /* Forms */
    .contact-form-container,
    .quote-form {
        padding: var(--spacing-md);
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px 12px;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }

    .footer-col {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    /* Logo */
    .logo span {
        font-size: 16px;
    }

    /* Page Header */
    .page-header {
        padding: var(--spacing-lg) 0;
    }

    /* CTA Buttons */
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    /* Section Headers */
    .section-header h2 {
        font-size: 28px;
    }

    .section-header p {
        font-size: 16px;
    }

    /* Info Cards */
    .info-card {
        flex-direction: column;
        text-align: center;
    }

    .info-icon {
        margin: 0 auto var(--spacing-sm);
    }

    /* Lightbox */
    .lightbox-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        font-size: 24px;
    }

    /* Area Detail Card */
    .area-detail-card ul {
        padding-left: var(--spacing-sm);
    }

    /* Quote Intro */
    .quote-intro h2 {
        font-size: 28px;
    }

    /* Step Cards */
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    /* Help Box */
    .help-box i {
        font-size: 36px;
    }
}

/* ================================
   Sticky CTA Bar - show on mobile only
   ================================ */
@media (max-width: 768px) {
    .sticky-cta-bar {
        display: block;
    }

    /* Add padding to body bottom so content isn't hidden behind sticky bar */
    body {
        padding-bottom: 70px;
    }

    .floating-cta {
        bottom: 80px;
    }

    .hero-mini-form {
        max-width: 100%;
    }

    .mini-form-fields {
        flex-direction: column;
    }

    .mini-form-fields input,
    .mini-form-fields select {
        min-width: 100%;
    }

    .exit-popup {
        padding: 28px 20px;
    }
}

@media (min-width: 769px) {
    .floating-btn .floating-label {
        display: block;
        position: absolute;
        right: 64px;
        background: #333;
        color: #fff;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 13px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .floating-btn:hover .floating-label {
        opacity: 1;
    }
}

/* ================================
   Landscape Mobile (max-height: 500px)
   ================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }

    .nav-menu {
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .page-header {
        padding: var(--spacing-md) 0;
    }
}

/* ================================
   Print Styles
   ================================ */
@media print {
    .header,
    .hamburger,
    .hero-cta,
    .cta-section,
    .footer,
    .lightbox,
    .gallery-filters,
    .filter-btn,
    .btn,
    form {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .container {
        max-width: 100%;
    }

    a {
        text-decoration: underline;
    }
}

/* ================================
   Reduced Motion Support
   ================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}
