/* ==============================================
   HEA Diamonds — Targeted Mobile Fixes
   Based on actual 390×844 viewport screenshots
   Add AFTER styles.css: <link rel="stylesheet" href="css/mobile-fixes.css">
   ============================================== */

/* ---- FIX 1: My Account floating button ---- */
/* Currently fixed at bottom:100px right:30px — overlaps content everywhere */
@media (max-width: 768px) {
    .portal-floating-btn {
        bottom: 20px !important;
        right: 16px !important;
        padding: 8px 16px !important;
        font-size: 0.75rem !important;
        border-radius: 20px !important;
        opacity: 0.85 !important;
        z-index: 9990 !important;
    }

    /* Move Tidio chat above My Account on mobile */
    #tidio-chat-iframe,
    #tidio-chat,
    iframe[title="Tidio Chat"] {
        bottom: 70px !important;
    }
}

/* ---- FIX 2: Hero section — remove dead space below buttons ---- */
/* There are conflicting min-height declarations (70vh, 85vh, 90vh, 50vh).
   On mobile, content fits in ~70vh but min-height forces extra whitespace. */
@media (max-width: 768px) {
    .hero-section {
        min-height: auto !important;
        padding-top: 3.5rem !important;
        padding-bottom: 3rem !important;
        margin-top: 0 !important;
    }
}

/* ---- FIX 3: Product card images — constrain height on mobile ---- */
/* Currently aspect-ratio:1 makes each image ~370px tall = almost full viewport */
@media (max-width: 768px) {
    .setting-image {
        aspect-ratio: 4 / 3 !important;
        max-height: 280px;
    }
}

@media (max-width: 480px) {
    .setting-image {
        aspect-ratio: 4 / 3 !important;
        max-height: 240px;
    }
}

/* ---- FIX 4: Setting CTA buttons — ensure they don't overflow on small screens ---- */
@media (max-width: 480px) {
    .setting-cta-row {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 0.5rem;
    }

    .setting-cta {
        display: block;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
}

/* ---- FIX 5: Navbar logo — ensure it renders properly on mobile ---- */
@media (max-width: 768px) {
    .nav-logo .logo {
        height: 56px !important;
        max-width: 140px;
        object-fit: contain;
    }
}

/* ---- FIX 6: Inline-style section spacing refinements ---- */
/* The "Secure Payment" flex row wraps awkwardly on mobile */
@media (max-width: 480px) {
    section [style*="display: flex"][style*="justify-content: center"][style*="gap: 2rem"] {
        gap: 1.25rem !important;
    }

    /* Warranty cards — ensure SVG icons don't overflow */
    section [style*="text-align: center"] svg[width="40"] {
        width: 32px;
        height: 32px;
    }
}

/* ---- FIX 7: "Explore all" link — reduce surrounding whitespace ---- */
@media (max-width: 768px) {
    .settings-section .text-center {
        margin-top: 1rem;
        margin-bottom: 0;
    }
}

/* ---- FIX 8: Footer newsletter — ensure subscribe button visible ---- */
@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .newsletter-form .email-input,
    .newsletter-form input[type="email"] {
        width: 100% !important;
        box-sizing: border-box;
    }

    .newsletter-form button,
    .newsletter-form .subscribe-btn {
        width: 100% !important;
    }
}

/* ---- FIX 9: Comparison diamond images — prevent overflow ---- */
@media (max-width: 768px) {
    .diamond-image {
        max-height: 200px;
        overflow: hidden;
    }

    .diamond-img {
        max-height: 200px;
        object-fit: contain;
    }
}

/* ---- FIX 10: Body bottom padding for floating elements ---- */
/* Prevent My Account + Tidio from covering footer content */
@media (max-width: 768px) {
    .footer-bottom {
        padding-bottom: 60px !important;
    }
}
