/* ═══════════════════════════════════════════════════════════════
   MOBILE FIXES CSS - COMPLETE FILE
   Replace your entire mobile-fixes.css with this
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   MOBILE MENU - BULLETPROOF VERSION
   Uses minimal CSS - JavaScript handles everything with inline styles
   ═══════════════════════════════════════════════════════════════ */

/* Mobile toggle button - Show on mobile only */
.mobile-menu-toggle {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
        position: relative;
        background: transparent;
        border: none;
        width: 40px;
        height: 40px;
        cursor: pointer;
        z-index: 1001;
        padding: 0;
        flex-shrink: 0;
    }
    
    .mobile-menu-toggle .hamburger-line {
        display: block;
        width: 25px;
        height: 3px;
        background-color: #333;
        margin: 5px auto;
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    /* Hamburger animation (optional - looks nice) */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    #mobileOverlay {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   GENERAL MOBILE FIXES
   ═══════════════════════════════════════════════════════════════ */

/* Ensure proper box-sizing on mobile */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    /* Prevent horizontal scroll on mobile */
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Make images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix container padding on mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Improve touch targets */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better font rendering on mobile */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ═══════════════════════════════════════════════════════════════
   NAVBAR FIXES FOR MOBILE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .navbar {
        position: relative;
        z-index: 100;
    }
    
    .nav-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
    }
    
    /* Ensure logo stays visible */
    .logo {
        z-index: 1001;
        position: relative;
    }
    
    /* Style menu items when visible */
    .nav-menu a {
        color: white !important;
        text-decoration: none;
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: background 0.3s ease;
    }
    
    .nav-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    /* Dropdown styling in mobile menu */
    .dropdown-menu {
        position: static !important;
        box-shadow: none !important;
        background: rgba(0, 0, 0, 0.2) !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .dropdown-menu li a {
        padding-left: 40px !important;
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 14px;
    }
    
    .dropdown-toggle {
        position: relative;
    }
    
    .dropdown-toggle .fa-chevron-down {
        float: right;
        transition: transform 0.3s;
    }
    
    .dropdown.active .dropdown-toggle .fa-chevron-down {
        transform: rotate(180deg);
    }
}

/* ═══════════════════════════════════════════════════════════════
   RECIPE PAGE MOBILE FIXES
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Recipe header */
    .recipe-header {
        padding: 20px 15px;
    }
    
    .recipe-title {
        font-size: 24px;
        line-height: 1.3;
    }
    
    /* Recipe meta (time, servings, etc.) */
    .recipe-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .recipe-meta-item {
        width: 100%;
        justify-content: center;
    }
    
    /* Recipe image */
    .recipe-image {
        width: 100%;
        height: auto;
        max-height: 300px;
        object-fit: cover;
    }
    
    /* Ingredients section */
    .ingredients-section {
        padding: 20px 15px;
    }
    
    .ingredient-item {
        padding: 12px;
        font-size: 15px;
    }
    
    /* Steps section */
    .steps-section {
        padding: 20px 15px;
    }
    
    .step-item {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .step-number {
        font-size: 18px;
        width: 35px;
        height: 35px;
    }
    
    /* Shopping list button */
    .add-to-shopping-list {
        width: 100%;
        margin-top: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FORM FIXES FOR MOBILE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        width: 100%;
    }
    
    button, .btn {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
        margin-bottom: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   GRID FIXES FOR MOBILE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .category-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER FIXES FOR MOBILE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .footer {
        padding: 30px 15px;
        text-align: center;
    }
    
    .footer-columns {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-column {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TABLET (481px - 768px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 481px) and (max-width: 768px) {
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   VERY SMALL PHONES (max 320px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 320px) {
    .recipe-title {
        font-size: 20px;
    }
    
    .recipe-card {
        padding: 10px;
    }
    
    .btn {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LANDSCAPE ORIENTATION FIXES
   ═══════════════════════════════════════════════════════════════ */

@media (max-height: 500px) and (orientation: landscape) {
    .recipe-image {
        max-height: 200px;
    }
    
    .navbar {
        padding: 10px 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   END OF FILE
   ═══════════════════════════════════════════════════════════════ */
