/* ============================================
   MOBILE UI/UX FIXES
   v1.0 - 2026-01-20
   ============================================ */

/* ============================================
   1. PRODUCT CARD - PRICE VISIBLE
   Fix: Remove fixed height, let content flow
   ============================================ */
@media (max-width: 768px) {

    /* Remove fixed heights that cause content clipping */
    .product-card {
        height: auto !important;
        min-height: unset !important;
        display: flex;
        flex-direction: column;
    }

    .product-card-link {
        height: auto !important;
        display: flex;
        flex-direction: column;
    }

    /* Ensure image has proper aspect ratio */
    .product-card-image {
        width: 100%;
        height: auto !important;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
    }

    .product-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Info section - must be visible */
    .product-card-info {
        flex: 0 0 auto !important;
        padding: 10px 8px !important;
        min-height: 60px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    /* Product name - 2 lines max */
    .product-card-name {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        min-height: 2.6em;
    }

    /* Price - always visible */
    .product-card-price {
        font-size: 0.7rem !important;
        font-weight: 700 !important;
        color: #16a34a !important;
        white-space: nowrap;
        overflow: visible !important;
    }
}

/* ============================================
   2. GRID LAYOUT - 2 COLUMNS MOBILE
   ============================================ */
@media (max-width: 768px) {

    .products-grid,
    .product-grid,
    .grid-4,
    .grid-3,
    .section .grid-4 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 8px !important;
    }
}

/* ============================================
   3. FLOATING BUTTONS - ALWAYS VISIBLE
   ============================================ */
.hamburger-float,
.whatsapp-float-mobile {
    position: fixed !important;
    z-index: 99999 !important;
    transform: none !important;
    backface-visibility: visible !important;
}

.hamburger-float {
    bottom: 24px !important;
    right: 24px !important;
}

.whatsapp-float-mobile {
    bottom: 24px !important;
    right: 24px !important;
}

/* Safe area for iPhones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {

    .hamburger-float,
    .whatsapp-float-mobile {
        bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    }
}

/* ============================================
   4. NAVBAR MOBILE FIXES
   ============================================ */
@media (max-width: 768px) {

    /* Hide desktop nav links */
    .nav-links {
        display: none !important;
    }

    /* Compact header */
    .nav-container {
        padding: 8px 12px !important;
    }

    /* Header row layout - logo left, social right */
    .header-row-top {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
    }

    /* Logo and tagline - fixed left */
    .header-brand {
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
    }

    /* Logo size */
    .header-brand img,
    .nav-logo img {
        height: 36px !important;
        width: auto !important;
    }

    /* Tagline mobile - desktop version hidden, mobile version full display */
    .header-tagline-desktop {
        display: none !important;
    }

    .header-tagline-mobile {
        display: block !important;
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        max-width: none !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        margin: 4px 0 2px 0 !important;
        padding: 0 !important;
        color: #1F2937 !important;
        order: 2 !important;
        width: 100% !important;
    }
}

/* ============================================
   5. SECTION SPACING MOBILE
   ============================================ */
@media (max-width: 768px) {
    .section {
        padding: 24px 0 !important;
    }

    .section-header {
        margin-bottom: 16px !important;
        padding: 0 12px !important;
    }

    .section-title {
        font-size: 1.1rem !important;
    }

    .container {
        padding: 0 8px !important;
    }
}

/* ============================================
   6. FOOTER SPACING (room for floating btns)
   ============================================ */
@media (max-width: 768px) {

    footer,
    .footer {
        padding-bottom: 70px !important;
    }
}

/* ============================================
   7. BANNER CAROUSEL MOBILE
   ============================================ */
@media (max-width: 768px) {

    .banner-carousel,
    .hero--fullbleed {
        height: auto !important;
        min-height: 180px !important;
    }

    .hero-carousel-slide img {
        height: auto !important;
        min-height: 180px;
        object-fit: cover;
    }
}

/* ============================================
   8. PROMO BAR MOBILE
   ============================================ */
@media (max-width: 768px) {
    .promo-bar {
        font-size: 0.75rem !important;
        padding: 8px 12px !important;
    }
}

/* ============================================
   9. SEARCH BAR MOBILE
   ============================================ */
@media (max-width: 768px) {
    .search-container {
        margin: 0 8px !important;
    }

    .search-input {
        font-size: 14px !important;
        padding: 10px 40px 10px 14px !important;
    }
}

/* ============================================
   10. CATEGORY BAR MOBILE
   ============================================ */
@media (max-width: 768px) {
    .category-bar--fullbleed {
        padding: 16px 0 !important;
    }

    .category-list {
        gap: 12px !important;
    }

    .category-item {
        min-width: 70px !important;
    }

    .category-item span,
    .category-item .category-name {
        font-size: 0.65rem !important;
    }
}

/* ============================================
   11. PAYMENT ICONS MOBILE FIX
   ============================================ */
@media (max-width: 768px) {

    .payment-icons img,
    .footer-payment img {
        max-height: 24px !important;
        width: auto !important;
    }
}

/* ============================================
   12. SOCIAL MEDIA ICONS - 2 ROW GRID MOBILE
   When more than 3 icons, display as 2 rows
   ============================================ */
@media (max-width: 768px) {

    /* Header social icons - 1 row */
    .header-social-icons {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .header-social-icons .social-icon,
    .header-social-icons a {
        width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        background: var(--primary-cyan, #0891B2) !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }

    .header-social-icons .social-icon svg,
    .header-social-icons a svg,
    .header-social-icons .social-icon i,
    .header-social-icons a i {
        width: 14px !important;
        height: 14px !important;
        font-size: 14px !important;
        color: white !important;
        fill: white !important;
    }

    /* Footer social icons - same 2 row grid */
    .footer-social-icons {
        display: grid !important;
        grid-template-columns: repeat(3, auto) !important;
        gap: 8px !important;
        justify-content: center !important;
    }

    .footer-social-icons .social-icon-btn,
    .footer-social-icons a {
        width: 32px !important;
        height: 32px !important;
    }
}