/* ==========================================================================
   Down 2 Earth Organics - Mobile Responsiveness Enhancements
   Strictly scoped to screens <= 900px so desktop remains 100% identical to original template.
   ========================================================================== */

/* Fix horizontal scrolling on small screens */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* --- Mobile Breakpoint (<= 900px) --- */
@media (max-width: 900px) {
    /* Top Announcement Bar */
    .top .w {
        justify-content: center;
        text-align: center;
        padding: 6px 12px;
        font-size: 12px;
        gap: 4px;
    }

    /* Header adjustments */
    header .w {
        flex-wrap: wrap;
        padding: 12px 14px;
        gap: 12px;
    }

    header img.lg {
        height: 42px;
    }

    /* Account, Wishlist, Cart on mobile */
    .accw, .ic.hl {
        font-size: 13px;
        gap: 4px;
    }

    .ic.hl b {
        display: none; /* Hide text label on mobile, keep icon + badge */
    }

    /* Push search bar to full width row on mobile */
    .search {
        order: 10;
        width: 100%;
        margin-top: 4px;
    }

    .search input {
        padding: 9px 12px;
        font-size: 14px;
    }

    .search button {
        padding: 0 14px;
        font-size: 13px;
    }

    /* Navigation horizontal scrolling */
    nav {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 99;
    }

    nav .w {
        gap: 16px;
        padding: 0 12px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    nav .w::-webkit-scrollbar {
        display: none;
    }

    .browse {
        padding: 10px 14px;
        font-size: 13px;
        margin: 6px 0;
    }

    nav > .w > a {
        padding: 12px 0;
        font-size: 13px;
    }

    /* Hero Slider on mobile */
    .sld {
        min-height: 280px;
        border-radius: 16px;
        margin: 12px 0 20px;
    }

    .sld .shade {
        background: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 55%, rgba(255,255,255,0.2) 100%) !important;
    }

    .slt {
        padding: 24px 20px;
        max-width: 100%;
        position: relative;
        z-index: 2;
    }

    .slt h1 {
        font-size: clamp(24px, 6vw, 36px);
        margin: 6px 0;
        color: #253D4E;
    }

    .slt p {
        font-size: 14px;
        margin-bottom: 14px;
        color: #253D4E;
        font-weight: 600;
    }

    .slt .btn {
        padding: 9px 18px;
        font-size: 13px;
    }

    .sfl {
        display: none; /* Hide floating tags that obstruct text on mobile */
    }

    .sar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Categories section */
    .sh.fh {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cat {
        flex: 0 0 120px;
        padding: 10px 10px 14px;
    }

    .cat img {
        height: 75px;
    }

    .cat h4 {
        font-size: 13px;
        min-height: 32px;
    }

    /* Daily Best Sells on mobile */
    .bsh {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .bsh .tabs {
        margin-left: 0 !important;
        overflow-x: auto;
        width: 100%;
        white-space: nowrap;
        padding-bottom: 6px;
    }

    .bs {
        grid-template-columns: 1fr;
    }

    .bsp {
        min-height: 180px;
        padding: 24px;
    }

    .bsp h3 {
        font-size: 22px;
    }

    .bsp .btn {
        margin-top: 24px !important;
    }

    /* Newsletter section */
    #news .nb {
        padding: 30px 18px;
        border-radius: 16px;
    }

    .nbt h2 {
        font-size: 20px;
    }

    .nbf {
        flex-direction: column;
        gap: 10px;
        max-width: 100%;
    }

    .nbf input, .nbf button {
        width: 100%;
        border-radius: 6px;
    }

    .st5 {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 20px;
    }

    /* Footer on mobile */
    .fg {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .pay {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    /* Shop View Filters Mobile Correction */
    .shopwrap {
        grid-template-columns: 1fr;
    }

    .side {
        margin-bottom: 16px;
    }

    .side .box {
        margin-bottom: 12px;
        padding: 16px;
    }

    #fc {
        max-height: 180px;
        overflow-y: auto;
        padding-right: 6px;
    }
}

/* --- Small Mobile Phones (<= 640px) --- */
@media (max-width: 640px) {
    /* 2-column Product Grid for tidy mobile display */
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .card {
        padding: 8px !important;
        border-radius: 10px !important;
    }

    .card .im {
        border-radius: 8px !important;
    }

    .card small {
        font-size: 11px !important;
        margin-top: 6px !important;
    }

    .card h3 {
        font-size: 13px !important;
        line-height: 1.25 !important;
        min-height: 32px !important;
        margin: 2px 0 !important;
    }

    .card .un {
        font-size: 11px !important;
    }

    .pr b {
        font-size: 14px !important;
    }

    .pr s {
        font-size: 11px !important;
    }

    .add {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    .badge {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }

    /* Footer 1 column on very small screens */
    .fg {
        grid-template-columns: 1fr;
    }

    /* Cart drawer */
    .dr {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Login & OTP Form helpers */
.odm {
    margin-top: 14px;
    padding: 10px 12px;
    background: #FFF6DD;
    border: 1px dashed #E5B53A;
    border-radius: 10px;
    font-size: 13px;
    color: #7A5A00;
    text-align: left;
}
.odm b {
    font: 700 17px Quicksand, sans-serif;
    letter-spacing: 3px;
}
.oer {
    min-height: 20px;
    margin-top: 8px;
    color: #E0373B;
    font-size: 13px;
    font-weight: 600;
}
.orsd {
    margin-top: 14px;
    font-size: 13.5px;
    color: var(--mu);
}
.orsd button, .orsd a {
    border: 0;
    background: none;
    color: var(--g);
    font: 700 13.5px Quicksand, sans-serif;
    cursor: pointer;
    padding: 0;
}
.orsd button[disabled] {
    color: #999;
    cursor: default;
}

/* Header Account Widget Dropdown */
.accw {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.accb {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    border: 2px solid #BCE3C9 !important;
    background: #F2FCE4;
    color: var(--gd);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: .25s;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    outline: none !important;
}
.accb:hover, .accw.open .accb {
    background: var(--g) !important;
    color: #fff !important;
    border-color: var(--g) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px #3BB77E55;
}
.accb svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    margin: auto !important;
    flex-shrink: 0;
}



