/**
 * Mobile Homepage Fix
 * Comprehensive fix for homepage mobile responsiveness issues
 * Targets: Hero section, spacing, layout optimization for all mobile devices
 */

/* ==========================================
   HERO SECTION MOBILE FIX
   ========================================== */

/* Tablets and below */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 40px 0 !important;
        min-height: auto !important;
    }
    
    .hero-content {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .hero-title {
        font-size: 32px !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 13px !important;
        margin-bottom: 12px;
    }
    
    .hero-description {
        font-size: 14px !important;
        margin-bottom: 20px;
        line-height: 1.6;
    }
    
    .hero-description br {
        display: none;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        animation: none !important;
        margin-top: 20px;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
        border-radius: 16px !important;
    }
    
    /* Hide floating icons on tablets and below */
    .hero-icon {
        display: none !important;
    }
}

/* Mobile phones */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 30px 0 !important;
    }
    
    .hero-title {
        font-size: 28px !important;
        line-height: 1.25;
        margin-bottom: 12px;
    }
    
    .hero-subtitle {
        font-size: 12px !important;
        margin-bottom: 10px;
    }
    
    .hero-description {
        font-size: 13px !important;
        margin-bottom: 18px;
        padding: 0 10px;
    }
    
    .hero-buttons .btn {
        padding: 11px 24px !important;
        font-size: 14px !important;
    }
    
    .hero-image {
        margin-top: 15px;
    }
}

/* Extra small phones */
@media (max-width: 575.98px) {
    .hero-section {
        padding: 25px 0 !important;
    }
    
    .hero-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-title {
        font-size: 24px !important;
        line-height: 1.3;
        margin-bottom: 10px;
        padding: 0 5px;
    }
    
    .hero-subtitle {
        font-size: 11px !important;
        margin-bottom: 8px;
    }
    
    .hero-description {
        font-size: 13px !important;
        margin-bottom: 16px;
        padding: 0 5px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px !important;
        align-items: center;
        width: 100%;
        padding: 0 10px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        padding: 12px 20px !important;
        font-size: 14px !important;
        justify-content: center;
    }
}

/* ==========================================
   OFFERS BANNER MOBILE FIX
   ========================================== */
@media (max-width: 991.98px) {
    .offers-banner-section {
        padding: 20px 0 !important;
    }
    
    .offers-banner {
        padding: 20px !important;
        border-radius: 16px !important;
    }
    
    .offers-content h3 {
        font-size: 20px !important;
        margin-bottom: 10px;
    }
    
    .offers-content p {
        font-size: 13px !important;
    }
    
    .offers-badge {
        font-size: 11px !important;
        padding: 5px 12px !important;
    }
}

@media (max-width: 767.98px) {
    .offers-banner-section {
        padding: 15px 0 !important;
    }
    
    .offers-banner {
        padding: 18px 15px !important;
        text-align: center;
    }
    
    .offers-banner .row {
        flex-direction: column;
        gap: 15px;
    }
    
    .offers-banner .col-lg-8,
    .offers-banner .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .offers-banner .col-lg-4 {
        text-align: center !important;
        margin-top: 10px;
    }
    
    .offers-content h3 {
        font-size: 18px !important;
        line-height: 1.4;
    }
    
    .offers-content p {
        font-size: 12px !important;
        line-height: 1.5;
    }
}

@media (max-width: 575.98px) {
    .offers-banner {
        padding: 16px 12px !important;
    }
    
    .offers-content h3 {
        font-size: 17px !important;
    }
    
    .offers-content p {
        font-size: 12px !important;
    }
    
    .offers-badge {
        font-size: 10px !important;
        padding: 4px 10px !important;
    }
}

/* ==========================================
   CATEGORIES SECTION MOBILE FIX
   ========================================== */
@media (max-width: 991.98px) {
    .categories-section {
        padding: 50px 0 !important;
    }
    
    .section-header {
        margin-bottom: 35px !important;
    }
    
    .section-title {
        font-size: 28px !important;
    }
    
    .section-subtitle {
        font-size: 14px !important;
    }
}

@media (max-width: 767.98px) {
    .categories-section {
        padding: 40px 0 !important;
    }
    
    .section-header {
        margin-bottom: 30px !important;
    }
    
    .section-title {
        font-size: 24px !important;
    }
    
    .section-subtitle {
        font-size: 13px !important;
    }
}

@media (max-width: 575.98px) {
    .categories-section {
        padding: 35px 0 !important;
    }
    
    .categories-section .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .section-header {
        margin-bottom: 25px !important;
    }
    
    .section-title {
        font-size: 22px !important;
    }
    
    .section-subtitle {
        font-size: 12px !important;
    }
    
    .categories-section .row {
        --bs-gutter-x: 12px;
        --bs-gutter-y: 12px;
    }
    
    .categories-section .col-sm-6 {
        padding-left: 6px;
        padding-right: 6px;
        margin-bottom: 12px;
    }
}

/* ==========================================
   FEATURED PRODUCTS SECTION MOBILE FIX
   ========================================== */
@media (max-width: 991.98px) {
    .featured-products-section,
    .best-sellers-section {
        padding: 50px 0 !important;
    }
}

@media (max-width: 767.98px) {
    .featured-products-section,
    .best-sellers-section {
        padding: 40px 0 !important;
    }
}

@media (max-width: 575.98px) {
    .featured-products-section,
    .best-sellers-section {
        padding: 35px 0 !important;
    }
    
    .featured-products-section .container,
    .best-sellers-section .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .featured-products-section .row,
    .best-sellers-section .row {
        --bs-gutter-x: 12px;
        --bs-gutter-y: 15px;
    }
    
    .featured-products-section .col-sm-6,
    .best-sellers-section .col-sm-6 {
        padding-left: 6px;
        padding-right: 6px;
        margin-bottom: 15px;
    }
}

/* ==========================================
   PROMOTIONAL BANNER MOBILE FIX
   ========================================== */
@media (max-width: 991.98px) {
    .promo-banner-section {
        padding: 50px 0 !important;
    }
    
    .promo-card {
        padding: 35px !important;
        min-height: 250px !important;
    }
    
    .promo-title {
        font-size: 26px !important;
    }
    
    .promo-text {
        font-size: 14px !important;
    }
    
    .promo-side-image {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .promo-banner-section {
        padding: 40px 0 !important;
    }
    
    .promo-card {
        padding: 30px 20px !important;
        min-height: 220px !important;
        text-align: center;
    }
    
    .promo-title {
        font-size: 22px !important;
        margin-bottom: 12px;
    }
    
    .promo-text {
        font-size: 13px !important;
        margin-bottom: 20px;
    }
}

@media (max-width: 575.98px) {
    .promo-banner-section {
        padding: 35px 0 !important;
    }
    
    .promo-banner-section .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .promo-card {
        padding: 25px 18px !important;
        min-height: 200px !important;
    }
    
    .promo-title {
        font-size: 20px !important;
        margin-bottom: 10px;
    }
    
    .promo-text {
        font-size: 12px !important;
        margin-bottom: 18px;
    }
    
    .promo-card .btn {
        width: 100%;
        max-width: 220px;
    }
}

/* ==========================================
   SUSTAINABILITY & CUSTOM SKINCARE SECTIONS
   ========================================== */
@media (max-width: 991.98px) {
    .sustainability-section,
    .custom-skincare-section {
        padding: 50px 0 !important;
    }
    
    .sustainability-section h2,
    .custom-skincare-section h2 {
        font-size: 28px !important;
        margin-bottom: 20px;
    }
    
    .sustainability-section p,
    .custom-skincare-section p {
        font-size: 14px !important;
        margin-bottom: 18px;
    }
    
    .sustainability-list li {
        font-size: 14px !important;
        padding: 8px 0;
    }
}

@media (max-width: 767.98px) {
    .sustainability-section,
    .custom-skincare-section {
        padding: 40px 0 !important;
    }
    
    .sustainability-section .row,
    .custom-skincare-section .row {
        flex-direction: column-reverse;
    }
    
    .sustainability-section .col-lg-6,
    .custom-skincare-section .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 30px;
    }
    
    .sustainability-section h2,
    .custom-skincare-section h2 {
        font-size: 24px !important;
        text-align: center;
    }
    
    .sustainability-section p,
    .custom-skincare-section p {
        font-size: 13px !important;
        text-align: center;
    }
    
    .sustainability-list {
        text-align: left;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .sustainability-list li {
        font-size: 13px !important;
    }
    
    .sustainability-section img,
    .custom-skincare-section img {
        max-width: 100%;
        margin: 0 auto 20px;
    }
    
    .custom-skincare-section .btn {
        display: block;
        margin: 0 auto;
    }
}

@media (max-width: 575.98px) {
    .sustainability-section,
    .custom-skincare-section {
        padding: 35px 0 !important;
    }
    
    .sustainability-section h2,
    .custom-skincare-section h2 {
        font-size: 22px !important;
        margin-bottom: 18px;
    }
    
    .sustainability-section p,
    .custom-skincare-section p {
        font-size: 13px !important;
        margin-bottom: 16px;
    }
}

/* ==========================================
   GENERAL SECTION SPACING FIX
   ========================================== */
@media (max-width: 991.98px) {
    .section-padding {
        padding: 50px 0 !important;
    }
}

@media (max-width: 767.98px) {
    .section-padding {
        padding: 40px 0 !important;
    }
}

@media (max-width: 575.98px) {
    .section-padding {
        padding: 35px 0 !important;
    }
    
    /* Remove excessive container padding */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Fix row gutters */
    .row {
        --bs-gutter-x: 15px;
        --bs-gutter-y: 15px;
    }
}

/* ==========================================
   TEXT READABILITY ON MOBILE
   ========================================== */
@media (max-width: 767.98px) {
    body {
        font-size: 15px;
        line-height: 1.6;
    }
    
    h1 { font-size: 28px !important; }
    h2 { font-size: 24px !important; }
    h3 { font-size: 20px !important; }
    h4 { font-size: 18px !important; }
    h5 { font-size: 16px !important; }
    h6 { font-size: 15px !important; }
}

@media (max-width: 575.98px) {
    h1 { font-size: 24px !important; }
    h2 { font-size: 22px !important; }
    h3 { font-size: 18px !important; }
}

/* ==========================================
   BUTTONS MOBILE OPTIMIZATION
   ========================================== */
@media (max-width: 767.98px) {
    .btn {
        padding: 11px 20px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 13px 28px;
        font-size: 15px;
    }
    
    .btn i {
        font-size: 14px;
    }
}

@media (max-width: 575.98px) {
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* ==========================================
   VIEW ALL BUTTONS FIX
   ========================================== */
@media (max-width: 767.98px) {
    .text-center.mt-5 {
        margin-top: 30px !important;
    }
    
    .text-center.mt-5 .btn {
        width: auto;
        min-width: 200px;
    }
}

@media (max-width: 575.98px) {
    .text-center.mt-5 {
        margin-top: 25px !important;
    }
    
    .text-center.mt-5 .btn {
        width: 90%;
        max-width: 280px;
    }
}

/* ==========================================
   REMOVE EXCESSIVE ANIMATIONS ON MOBILE
   ========================================== */
@media (max-width: 767.98px) {
    /* Disable float animation on mobile to save performance */
    .hero-image {
        animation: none !important;
    }
    
    /* Simplify product card hover */
    .product-card:hover {
        transform: translateY(-5px) !important;
    }
    
    /* Simplify category card hover */
    .category-card:hover {
        transform: translateY(-5px) scale(1.01) !important;
    }
}

/* ==========================================
   iOS SPECIFIC FIXES
   ========================================== */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 767.98px) {
        .hero-section {
            -webkit-overflow-scrolling: touch;
        }
        
        /* Fix iOS viewport height issues */
        .hero-section,
        .section-padding {
            min-height: auto !important;
        }
        
        /* Prevent zoom on input focus */
        input, select, textarea {
            font-size: 16px !important;
        }
    }
}

/* ==========================================
   ANDROID SPECIFIC FIXES
   ========================================== */
@media (max-width: 767.98px) {
    /* Fix Chrome mobile rendering */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================
   PREVENT HORIZONTAL SCROLL
   ========================================== */
@media (max-width: 991.98px) {
    body {
        overflow-x: hidden !important;
    }
    
    .container, .container-fluid {
        overflow-x: hidden;
    }
    
    .row {
        margin-left: 0;
        margin-right: 0;
    }
}

/* ==========================================
   SAFE AREA INSETS FOR NOTCH DEVICES
   ========================================== */
@supports (padding: env(safe-area-inset-left)) {
    @media (max-width: 767.98px) {
        .hero-section,
        .section-padding {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
    }
}
