/**
 * Roach My Ex - Mobile-First Responsive Styles
 * Developed by AppWT LLC
 * Ensures perfect display on all mobile devices
 */

/* ================================================
   MOBILE VIEWPORT FIX
   ================================================ */
@viewport {
    width: device-width;
    zoom: 1;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* ================================================
   MOBILE TOUCH IMPROVEMENTS
   ================================================ */
button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: rgba(185, 28, 28, 0.2);
}

/* Improve touch target sizes */
button,
.btn,
a.btn,
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* ================================================
   MOBILE NAVIGATION
   ================================================ */
@media (max-width: 768px) {
    .main-nav .container {
        padding: 0.75rem 1rem;
    }

    .logo img {
        height: 40px;
        width: auto;
    }

    .menu-toggle {
        display: block;
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        z-index: 1001;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .hamburger span {
        display: block;
        width: 28px;
        height: 3px;
        background: var(--dark-color);
        transition: var(--transition-base);
        border-radius: 2px;
    }

    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: white;
        padding: 2rem 1rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        z-index: 1000;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid var(--gray-200);
    }

    .nav-menu a {
        display: block;
        width: 100%;
        padding: 1rem;
        font-size: 1.125rem;
    }

    .cart-icon {
        justify-content: center;
        margin-top: 1rem;
    }
}

/* ================================================
   MOBILE HERO SECTION
   ================================================ */
@media (max-width: 768px) {
    .hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.75rem !important;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 1.5rem;
    }

    .trust-badges {
        flex-direction: column;
        gap: 0.75rem;
    }

    .trust-badges .badge-item {
        width: 100%;
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .btn-large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* ================================================
   MOBILE FORMS
   ================================================ */
@media (max-width: 768px) {
    input,
    textarea,
    select,
    button {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 1rem;
        font-size: 16px;
    }
}

/* ================================================
   MOBILE PRODUCTS GRID
   ================================================ */
@media (max-width: 768px) {
    .products-grid,
    .products-grid-full {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .product-card,
    .product-full {
        padding: 1.5rem;
    }

    .product-card.featured {
        transform: scale(1);
    }

    .roach-emoji {
        font-size: 2.5rem;
    }
}

/* ================================================
   MOBILE SECTIONS
   ================================================ */
@media (max-width: 768px) {
    .section-padding {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }

    .steps-grid,
    .features-grid,
    .testimonials-grid,
    .faq-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

/* ================================================
   MOBILE CART
   ================================================ */
@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr !important;
    }

    .cart-item {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 1rem;
    }

    .cart-item-quantity {
        justify-content: center;
    }

    .cart-sidebar {
        position: static;
    }
}

/* ================================================
   MOBILE FOOTER
   ================================================ */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .footer-badges {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-badges .badge-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* ================================================
   MOBILE BUTTONS & CTAs
   ================================================ */
@media (max-width: 768px) {
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .btn-block {
        width: 100%;
    }
}

/* ================================================
   MOBILE ACCESSIBILITY WIDGET
   ================================================ */
@media (max-width: 768px) {
    .accessibility-widget {
        right: 10px;
        bottom: 70px;
    }

    .accessibility-widget > button {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .accessibility-panel {
        right: 0;
        left: auto;
        min-width: 250px;
        max-width: calc(100vw - 20px);
    }

    .back-to-top {
        right: 10px;
        bottom: 10px;
        width: 45px;
        height: 45px;
    }
}

/* ================================================
   MOBILE COOKIE BANNER
   ================================================ */
@media (max-width: 768px) {
    .cookie-banner .container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cookie-buttons button {
        width: 100%;
    }
}

/* ================================================
   MOBILE TABLES (if any)
   ================================================ */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ================================================
   MOBILE STATS & NUMBERS
   ================================================ */
@media (max-width: 768px) {
    .michigan-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem;
    }

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

/* ================================================
   LANDSCAPE MOBILE
   ================================================ */
@media (max-width: 896px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }

    .section-padding {
        padding: 1.5rem 0;
    }

    .nav-menu {
        top: 50px;
        padding: 1rem;
    }
}

/* ================================================
   VERY SMALL SCREENS (< 375px)
   ================================================ */
@media (max-width: 374px) {
    .hero-title {
        font-size: 1.5rem !important;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .product-price .price {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ================================================
   LARGE MOBILE / TABLET (481px - 768px)
   ================================================ */
@media (min-width: 481px) and (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .steps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .michigan-stats {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ================================================
   TABLET (769px - 1024px)
   ================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 0 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cart-layout {
        grid-template-columns: 1fr 350px;
    }
}

/* ================================================
   FORCE MOBILE LAYOUT
   ================================================ */
.force-mobile-layout {
    max-width: 100% !important;
    width: 100% !important;
}

/* ================================================
   PREVENT HORIZONTAL SCROLL
   ================================================ */
body {
    overflow-x: hidden;
}

* {
    max-width: 100%;
}

/* ================================================
   IMPROVE READABILITY ON MOBILE
   ================================================ */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.6;
    }

    p {
        margin-bottom: 1rem;
    }

    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }
}

/* ================================================
   MOBILE SPECIFIC UTILITIES
   ================================================ */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    .mobile-full-width {
        width: 100% !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}
