/* Mobile Optimization CSS - Sama Electec */
/* Add this to styles.css or link as separate mobile.css */

/* ============================================
   MOBILE-FIRST RESPONSIVE STYLES
   ============================================ */

/* Base mobile styles (320px+) */
@media (max-width: 768px) {

    /* ===== TYPOGRAPHY ===== */
    body {
        font-size: 16px;
        /* Never below 16px to prevent iOS zoom */
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }

    h1 {
        font-size: 2rem;
        /* 32px */
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.5rem;
        /* 24px */
        margin-bottom: 0.8rem;
    }

    h3 {
        font-size: 1.25rem;
        /* 20px */
        margin-bottom: 0.6rem;
    }

    p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    /* ===== TOUCH TARGETS ===== */
    .btn,
    button,
    a.cta-button {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 20px;
        font-size: 16px;
    }

    /* ===== HEADER & NAVIGATION ===== */
    header {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
    }

    body {
        padding-top: 70px;
        padding-bottom: 100px;
        /* Space for floating buttons */
    }

    .logo img {
        max-height: 40px;
    }

    .menu-toggle {
        display: block;
        padding: 12px;
        min-width: 48px;
        min-height: 48px;
        background: none;
        border: none;
        cursor: pointer;
    }

    nav ul {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: calc(100vh - 70px);
        background: #fff;
        transition: right 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    nav ul.active {
        right: 0;
    }

    nav ul li {
        margin: 0;
        border-bottom: 1px solid #eee;
    }

    nav ul li a {
        padding: 18px 20px;
        font-size: 18px;
        display: block;
    }

    /* ===== HERO SECTION ===== */
    .hero {
        min-height: 300px;
        padding: 60px 0 40px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* ===== CONTAINER & SPACING ===== */
    .container {
        width: 100%;
        padding: 0 15px;
    }

    .section {
        padding: 40px 0;
    }

    .content-section {
        padding: 20px;
        margin: 20px 0;
    }

    /* ===== GRIDS TO SINGLE COLUMN ===== */
    .services-grid,
    .areas-grid,
    .service-links,
    .posts-grid,
    .image-gallery,
    .nearby-locations ul {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* ===== FORMS ===== */
    form {
        width: 100%;
    }

    .form-group {
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        width: 100%;
        font-size: 16px;
        /* Prevent iOS zoom */
        padding: 14px;
        border: 2px solid #ddd;
        border-radius: 5px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }

    input:focus,
    textarea:focus,
    select:focus {
        border-color: #0c4da2;
        outline: none;
        box-shadow: 0 0 0 3px rgba(12, 77, 162, 0.1);
    }

    button[type="submit"],
    input[type="submit"] {
        width: 100%;
        font-size: 18px;
        padding: 16px;
        min-height: 56px;
    }

    label {
        font-size: 16px;
        margin-bottom: 8px;
        display: block;
        font-weight: 600;
    }

    /* ===== IMAGES ===== */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    .featured-image,
    .service-image {
        width: 100%;
        height: auto;
        max-height: 250px;
        object-fit: cover;
    }

    /* ===== FLOATING ACTION BUTTONS ===== */
    .floating-buttons {
        bottom: 20px;
        padding: 0 15px;
    }

    .floating-btn {
        width: 60px;
        height: 60px;
        font-size: 26px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .floating-btn.call {
        right: 15px;
    }

    .floating-btn.whatsapp {
        left: 15px;
    }

    /* ===== PHONE LINKS ===== */
    .phone-link {
        display: inline-block;
        padding: 15px 25px;
        background: #0c4da2;
        color: white;
        text-align: center;
        border-radius: 8px;
        text-decoration: none;
        font-size: 18px;
        font-weight: bold;
        margin: 10px 0;
        width: 100%;
    }

    .phone-link:active {
        background: #ffc107;
        color: #333;
    }

    /* ===== CTA SECTIONS ===== */
    .cta-section {
        padding: 30px 20px;
        margin: 30px 0;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }

    .cta-section .btn {
        width: 100%;
        margin: 10px 0;
    }

    /* ===== FOOTER ===== */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    .footer-section {
        text-align: center;
    }

    /* ===== SERVICE CARDS ===== */
    .service-card {
        padding: 20px;
    }

    .service-card i {
        font-size: 2.5rem;
    }

    /* ===== BREADCRUMB ===== */
    .breadcrumb {
        margin-top: 0;
        padding: 10px 0;
    }

    .breadcrumb ol {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    /* ===== TABLES ===== */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ===== RELATED POSTS/SERVICES ===== */
    .related-services {
        padding: 20px;
    }

    .service-link {
        padding: 12px;
        font-size: 15px;
    }

    /* ===== VIDEO CARDS ===== */
    .video-grid {
        grid-template-columns: 1fr !important;
    }

    .video-card {
        margin-bottom: 20px;
    }

    /* ===== REVIEW CARDS ===== */
    .review-card {
        padding: 20px;
    }

    /* ===== HIDE ON MOBILE ===== */
    .desktop-only {
        display: none !important;
    }

    /* ===== SHOW ON MOBILE ===== */
    .mobile-only {
        display: block !important;
    }
}

/* Small mobile devices (320px - 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .hero {
        min-height: 250px;
        padding: 40px 0 30px;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .btn {
        font-size: 15px;
        padding: 10px 16px;
    }
}

/* Tablet (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {

    .services-grid,
    .posts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 200px;
        padding: 40px 0;
    }

    nav ul {
        height: calc(100vh - 60px);
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {

    input,
    textarea,
    select {
        -webkit-appearance: none;
        border-radius: 0;
    }

    .btn {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Android-specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {

    input[type="date"],
    input[type="time"],
    input[type="datetime-local"] {
        line-height: normal;
    }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {

    input:focus,
    select:focus,
    textarea:focus {
        font-size: 16px !important;
    }
}

/* Sticky mobile CTA bar (optional) */
@media (max-width: 768px) {
    .mobile-cta-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        z-index: 998;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        background: white;
    }

    .mobile-cta-bar .cta-btn {
        padding: 16px;
        text-align: center;
        text-decoration: none;
        color: white;
        font-weight: bold;
        font-size: 16px;
        border: none;
    }

    .mobile-cta-bar .call-btn {
        background: #0c4da2;
    }

    .mobile-cta-bar .whatsapp-btn {
        background: #25d366;
    }

    .mobile-cta-bar .cta-btn:active {
        opacity: 0.8;
    }
}

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
}

/* Remove tap highlight on links */
a {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
}

/* Improve button click feedback */
.btn:active,
button:active,
a:active {
    transform: scale(0.98);
}