/* Design2Renovate - Responsive Stylesheet */

/* Prevent horizontal scroll on all devices */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Responsive styles for services grid */
@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
}

/* Mobile Gallery Adjustments */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .gallery-item {
        aspect-ratio: 4/3;
    }
    
    .gallery-overlay {
        transform: translateY(0);
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    }
    
    .gallery-title {
        font-size: 1.2rem;
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* FAQ Cards Responsive */
@media (max-width: 767px) {
    .faq-cards {
        grid-template-columns: 1fr;
    }
    
    .faq-card {
        margin-bottom: var(--spacing-sm);
    }
    
    .faq-card:last-child {
        margin-bottom: 0;
    }
}

/* Main Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Keep header fixed on mobile but optimize it */
    header {
        position: fixed !important;
        z-index: 99999999 !important;
        height: 70px !important;
    }
    
    /* Maintain body padding for fixed header */
    body {
        padding-top: 70px !important;
    }
    
    .header-container {
        height: 40px !important;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Disable hover effects on mobile for better touch experience */
    .service-card:hover,
    .process-step:hover,
    .feature-item:hover,
    .about-image:hover,
    .about-image:hover img {
        transform: none;
        box-shadow: var(--box-shadow);
    }
    
    /* Active state for mobile touches */
    .service-card:active,
    .process-step:active,
    .feature-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Apply styles immediately without hover on mobile */
    .service-card {
        border-top: 3px solid var(--primary-color);
    }
    
    /* Header phone number responsive styles */
    .header-contact {
        display: none !important;
    }
    
    .hero {
        padding: 80px 0 80px;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero-badges {
        justify-content: center;
    }
    
    .hero-btns {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-btns .btn {
        width: 100%;
        text-align: center;
    }
    
    .countdown-timer {
        flex-direction: column;
    }
    
    .stat-item {
        min-width: 150px;
    }
    
    .hero-btns {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .nav-toggle {
        display: block;
        font-size: 1.5rem;
        color: var(--text-light);
        cursor: pointer;
    }
    
    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--secondary-color);
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav ul li {
        margin: 10px 0;
        text-align: center;
    }
    
    /* About section mobile styling */
    .about-content {
        flex-direction: column;
    }
    
    .about-text {
        order: 2;
        margin-top: var(--spacing-md);
    }
    
    .about-image {
        order: 1;
        transform: rotate(0);
        margin-bottom: var(--spacing-md);
        flex: 0 0 250px;
        max-width: 250px;
        align-self: center;
    }
    
    /* Process steps mobile styling */
    .process-step {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .step-number {
        margin-bottom: var(--spacing-sm);
    }
    
    .process-step:not(:last-child)::after {
        left: 30px;
        top: 110px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents iOS zoom on input focus */
    }
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        height: 70px;
        overflow: visible;
    }
    
    .logo-section {
        gap: 15px;
        flex-shrink: 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .phone-container {
        display: none;
    }
    
    .nav-toggle {
        display: block;
        position: relative;
        z-index: 1001;
        margin-left: 15px;
        padding: 10px;
        border-radius: 6px;
        background-color: transparent;
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
    }
    
    .nav-toggle:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--secondary-color);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
        z-index: 99999999 !important;
        align-items: flex-start;
        gap: 20px;
        border-top: 3px solid var(--primary-color);
        border-radius: 0 0 12px 12px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        margin-top: 0;
        border-left: none;
        border-right: none;
        width: 100%;
        margin-left: 0;
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu .nav-link {
        padding: 15px 0;
        display: block;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-weight: 600;
        transition: all 0.3s ease;
        text-align: center;
        width: 100%;
    }
    
    .nav-menu li:last-child .nav-link {
        border-bottom: none;
    }
    
    .cta-button {
        text-align: center;
        width: 100%;
        margin-top: 10px;
        background-color: #28a745 !important;
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3) !important;
    }
    
    .cta-button:hover {
        background-color: #22a43d !important;
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
    }
    
    /* Mobile Hero Badge Adjustments */
    .hero-badge:first-child {
        display: none !important;
    }
    
    .hero-badges {
        justify-content: flex-start !important;
    }
    
    .hero-badge:last-child {
        float: left;
        margin-right: auto;
    }
    
    /* Hide guarantee section on mobile */
    .hero-guarantee {
        display: none !important;
    }
    
    /* Hide stats counter section on mobile */
    .stats-counter {
        display: none !important;
    }
    
    /* Mobile Contact Section Reordering */
    .contact-content {
        display: flex;
        flex-direction: column;
    }
    
    .contact-form-container {
        order: 1;
        margin-bottom: 2rem;
    }
    
    .contact-info {
        order: 2;
    }
    
    /* Dropdown adjustments for mobile */
    .dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1) !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
        margin-top: 10px !important;
        border-top: none !important;
        border-radius: 8px !important;
        padding: 0 !important;
        border-left: 3px solid var(--primary-color) !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-left: 15px !important;
        z-index: 99999999 !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        min-width: auto !important;
        width: calc(100% - 15px) !important;
    }
    
    .dropdown-menu.show {
        max-height: 500px;
        padding: 10px 0 !important;
    }
    
    .dropdown-link {
        padding: 12px 15px;
        border-left: none;
        font-size: 0.9rem;
        text-transform: none;
        font-weight: 500;
        display: block;
        color: rgba(255, 255, 255, 0.9);
        transition: all 0.2s ease;
    }
    
    .dropdown-link:hover,
    .dropdown-link:focus {
        background-color: rgba(255, 255, 255, 0.15);
        border-left: none;
        color: var(--primary-color);
        padding-left: 20px;
    }
    
    .dropdown-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        background-color: transparent;
        transition: background-color 0.2s ease;
    }
    
    .dropdown-toggle:hover,
    .dropdown-toggle:focus {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-toggle.mobile-active {
        background-color: rgba(255, 255, 255, 0.15);
        color: var(--primary-color);
    }
    
    .dropdown-toggle i {
        transition: transform 0.3s ease, color 0.2s ease;
        font-size: 0.8rem;
        margin-left: 8px;
    }
    
    .dropdown-toggle.mobile-active i {
        transform: rotate(180deg);
        color: var(--primary-color);
    }
    
    /* Add visual separator between dropdown items */
    .dropdown-link:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .header-container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .nav-menu {
        padding: 15px;
        gap: 12px;
    }
    
    .nav-menu .nav-link {
        padding: 15px 0;
        font-size: 1.1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-link {
        padding: 12px 15px;
        min-height: 44px;
        display: flex;
        align-items: center;
        font-size: 1rem;
    }
    
    .dropdown-menu.mobile-open,
    .dropdown-menu.show {
        border-left: 3px solid var(--primary-color);
        background-color: rgba(255, 255, 255, 0.08) !important;
    }
    
    .nav-toggle {
        font-size: 1.8rem;
        padding: 10px;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet responsiveness */
@media (max-width: 992px) and (min-width: 769px) {
    header {
        position: fixed;
        z-index: 99999999 !important;
    }
    
    body {
        padding-top: 70px;
    }
    
    .header-container {
        padding: 0 15px;
        height: 70px;
    }
    
    .logo-section {
        gap: 20px;
    }
    
    .logo {
        font-size: 1.6rem;
    }
    
    .nav-menu {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .dropdown-menu {
        z-index: 99999999 !important;
        min-width: 200px;
    }
}

/* Tablet Responsive Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Large Desktop Adjustments */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    .hero-bg,
    .hero-overlay,
    .nav-toggle,
    .btn {
        display: none !important;
    }
    
    .hero {
        padding: 40px 0;
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    section {
        page-break-inside: avoid;
        padding: 20px 0;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* High DPI / Retina Display Adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-bg {
        image-rendering: -webkit-optimize-contrast;
    }
    
    .gallery-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-bg {
        transform: none !important;
    }
    
    .gallery-item:hover .gallery-image img {
        transform: none !important;
    }
    
    .service-card:hover {
        transform: none !important;
    }
    
    /* Architectural CTA responsive */
    .architectural-cta h2 {
        font-size: 2rem;
    }
    
    .architectural-cta p {
        font-size: 1rem;
    }
    
    .architectural-cta .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

/* iPhone Specific Optimizations */
@media (max-width: 414px) {
    /* iPhone 6/7/8 Plus and similar */
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .hero p {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    /* Ensure touch targets are at least 44px */
    .btn, .faq-question, .nav-toggle {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 375px) {
    /* iPhone X/11/12/13 and similar */
    .hero {
        padding: 120px 0 60px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
    
    .hero-guarantee span {
        font-size: 0.8rem;
    }
    
    .stats-counter {
        margin-top: -20px !important;
        padding-top: 40px !important;
    }
    
    .stats-counter div[style*="font-size: 3rem"] {
        font-size: 2.5rem !important;
    }
    
    .stats-counter div[style*="font-size: 1rem"] {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 320px) {
    /* iPhone SE and very small screens */
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .hero h2 {
        font-size: 1.2rem;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .stats-counter div[style*="font-size: 3rem"] {
        font-size: 2rem !important;
    }
    
    .stats-counter div[style*="min-width: 160px"] {
        min-width: 120px !important;
        padding: 10px 12px !important;
    }
} 