/* Responsive Enhancements for Imidzh Website
   Targeting breakpoints: 320px, 375px, 414px, 768px, 1024px
   Created: 2025-07-21
*/

/* Base responsive improvements for all screen sizes */
html {
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

body {
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* Improve touch targets for all interactive elements */
button, 
.btn,
.nav-link,
a[role="button"],
.carousel-control-prev,
.carousel-control-next,
input[type="checkbox"],
input[type="radio"],
.dropdown-item,
.social-icons a,
.social-contact a,
.whatsapp-button a {
    min-height: 48px;
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

/* Adjust padding for better touch targets without changing appearance */
.nav-link, .dropdown-item {
    padding: 0.5rem 1rem;
}

/* Ensure form controls are large enough for touch */
.form-control {
    min-height: 48px;
    padding: 0.75rem 1rem;
}

/* Responsive navbar improvements */
.navbar-toggler {
    min-height: 48px;
    min-width: 48px;
    padding: 0.5rem;
}

/* Ensure dropdown menus don't overflow screen */
.dropdown-menu {
    max-width: 100vw;
}

/* Responsive improvements for hero section */
.hero-section .lead {
    max-width: 100%; /* Override the 70% max-width for mobile */
}

/* Responsive map container */
.map-container iframe {
    width: 100%;
    max-width: 100%;
    border: 0;
}

/* Adjust WhatsApp button position on mobile */
.whatsapp-button {
    bottom: 20px;
    right: 20px;
    z-index: 1050; /* Ensure it's above cookie consent */
}

/* Responsive cookie consent banner */
.cookie-consent-banner {
    width: 100%;
    max-width: 100%;
}

/* Responsive card improvements */
.card-img-top {
    width: 100%;
    object-fit: cover;
}

/* Ensure buttons don't overflow their containers */
.btn {
    white-space: normal;
    text-align: center;
}

/* Extra Small Devices (phones, 320px and up) */
@media (min-width: 320px) {
    /* Adjust font sizes for very small screens */
    html {
        font-size: 12px;
    }
    
    h1, .display-4 {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    /* Adjust button spacing on very small screens */
    .hero-section .btn {
        margin: 0.5rem 0.25rem;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Adjust card layouts for very small screens */
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    /* Adjust step items for very small screens */
    .step-number {
        width: 3rem;
        height: 3rem;
        font-size: 1.2rem;
        margin-right: 1rem;
    }
    
    .step-content h3 {
        font-size: 1.1rem;
    }
    
    /* Adjust review content for very small screens */
    .review-content {
        padding: 1.5rem;
    }
    
    /* Adjust footer for very small screens */
    .footer-brand h4 {
        font-size: 1.5rem;
    }
    
    /* Ensure cookie consent buttons stack properly */
    .cookie-buttons .btn {
        margin-bottom: 0.5rem;
    }
}

/* Small Devices (phones, 375px and up) */
@media (min-width: 375px) {
    html {
        font-size: 13px;
    }
    
    h1, .display-4 {
        font-size: 2.2rem;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .hero-section .lead {
        font-size: 1.05rem;
    }
    
    .hero-section {
        padding: 70px 0;
    }
}

/* Medium Small Devices (phones, 414px and up) */
@media (min-width: 414px) {
    html {
        font-size: 14px;
    }
    
    h1, .display-4 {
        font-size: 2.4rem;
    }
    
    .hero-section h1 {
        font-size: 2.4rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    /* Adjust button spacing */
    .hero-section .btn {
        margin: 0.5rem 0.5rem;
        padding: 0.7rem 1.2rem;
    }
}

/* Small to Medium Devices (tablets, 576px and up) */
@media (min-width: 576px) {
    html {
        font-size: 14px;
    }
    
    h1, .display-4 {
        font-size: 2.8rem;
    }
    
    .hero-section h1 {
        font-size: 2.8rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.2rem;
        max-width: 90%; /* Slightly wider than mobile but still constrained */
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-section {
        padding: 100px 0;
    }
    
    /* Adjust step items */
    .step-number {
        width: 4rem;
        height: 4rem;
        font-size: 1.5rem;
    }
    
    /* Adjust review content */
    .review-content {
        padding: 2rem;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
    
    h1, .display-4 {
        font-size: 3.2rem;
    }
    
    .hero-section h1 {
        font-size: 3.2rem;
    }
    
    .hero-section .lead {
        font-size: 1.3rem;
        max-width: 80%;
    }
    
    .hero-section {
        padding: 120px 0;
    }
    
    /* Restore original step items */
    .step-number {
        width: 5rem;
        height: 5rem;
        font-size: 1.8rem;
        margin-right: 2rem;
    }
    
    .step-content h3 {
        font-size: 1.3rem;
    }
    
    /* Restore original review content */
    .review-content {
        padding: 3rem;
    }
    
    /* Adjust cookie consent for larger screens */
    .cookie-content {
        flex-direction: row;
        align-items: center;
    }
    
    .cookie-buttons {
        justify-content: flex-end;
    }
    
    .cookie-buttons .btn {
        margin-bottom: 0;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .hero-section h1 {
        font-size: 3.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.4rem;
        max-width: 70%;
    }
    
    .hero-section {
        padding: 150px 0;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-section h1 {
        font-size: 3.8rem;
    }
}

/* Fix for horizontal scrolling issues */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
}

/* Ensure images don't cause overflow */
.card-img-container {
    overflow: hidden;
}

/* Responsive improvements for social icons */
.social-icons a,
.social-contact a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Improve carousel controls for touch */
.carousel-control-prev,
.carousel-control-next {
    opacity: 0.9;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--highlight-color);
    width: 48px;
    height: 48px;
}

/* Ensure carousel indicators are touch-friendly */
.carousel-indicators button {
    width: 12px;
    height: 12px;
    margin: 0 8px;
}

/* Ensure newsletter form is responsive using Flexbox */
.newsletter-form-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.newsletter-input-group {
    display: flex;
    flex: 1;
    min-width: 0;
}

.newsletter-input {
    flex: 1;
    border-radius: 4px 0 0 4px !important;
}

.newsletter-button {
    white-space: nowrap;
    border-radius: 0 4px 4px 0 !important;
}

.newsletter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 10px;
}

@media (min-width: 576px) {
    .newsletter-form-container {
        flex-wrap: wrap;
    }
}

@media (min-width: 768px) {
    .newsletter-form-container {
        flex-direction: row;
        align-items: center;
    }
    
    .newsletter-checkbox {
        margin-top: 0;
    }
}

/* Fix for language and currency dropdowns on mobile */
.language-switcher .dropdown-menu,
.currency-switcher .dropdown-menu {
    min-width: 180px;
    right: 0;
    left: auto;
}

/* Ensure navbar dropdown doesn't overflow on mobile */
.navbar-collapse {
    max-height: 80vh;
    overflow-y: auto;
}

/* Improve spacing in footer on mobile */
@media (max-width: 767px) {
    .footer .col-md-6 {
        margin-bottom: 2rem;
    }
}