/*
 * DoDoBazar – phone & tablet fixes for the whole public site.
 * Loaded last in layouts/user/app.blade.php so it wins over the theme (style.css) and page styles.
 * The site header is fixed only from 992px up; below that it scrolls with the page.
 */

/* ---------- never wider than the screen ---------- */
/* clip (not hidden): keeps position:sticky working */
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe { max-width: 100%; }
input, select, textarea { max-width: 100%; }

@media (max-width: 991px) {
    /* pages that leave room for the (desktop) fixed header: not needed here */
    section.s-space-bottom-full.bg-accent-shadow-body[style*="padding-top"] { padding-top: 16px !important; }
    .blog-page { padding-top: 16px !important; }
    .lp { padding-top: 16px !important; }
    .error-404-area { padding-top: 32px !important; }
    .service-layout1.s-space-custom3 { padding-top: 16px !important; }
}

/* ---------- header: one slim row on phones ---------- */
@media (max-width: 767px) {
    .nav-padding { padding-top: 8px !important; padding-bottom: 8px !important; flex-wrap: nowrap !important; margin-left: 0 !important; margin-right: 0 !important; }
    #header-three .logo-area img { height: 38px; width: auto; }
    #header-three .nav-padding > .d-flex { margin: 0 !important; flex: 0 1 auto; }
    /* "Post your ad" lives in the bottom bar on phones */
    #header-three .d-lg-none > .cp-default-btn { display: none !important; }
    #header-three .d-lg-none { gap: 4px; }
    #header-three .hdr-ql { padding: 8px 7px; font-size: 19px; }
    #header-three .d-lg-none .signin-icon { width: 34px; height: 34px; font-size: 16px; margin-left: 4px; }

    /* the bottom bar covers the last 60px of every page */
    body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
    footer { margin-bottom: 0; }
    /* the theme's "back to top" button sat on top of the bottom bar and the call buttons */
    #scrollUp { display: none !important; }
}

/* ---------- home: compact search and category tiles ---------- */
@media (max-width: 767px) {
    .dd-hero { margin-bottom: 12px !important; }
    .dd-hero-form { padding: 8px !important; }
    .dd-hero-form input { flex: 1 1 100% !important; min-width: 0 !important; height: 46px; }
    .dd-hero-form select { flex: 1 1 auto !important; min-width: 0 !important; height: 44px; }
    .dd-hero-near { height: 44px; flex: 0 0 44px; }
    .dd-hero-go { height: 44px; flex: 0 0 auto; padding: 0 16px !important; }

    .service-layout1 .row > [class*="col-"].item-mb { flex: 0 0 33.333%; max-width: 33.333%; padding-left: 5px; padding-right: 5px; margin-bottom: 10px; }
    .service-layout1 .container > .row { margin-left: -5px; margin-right: -5px; }
    .service-box1 { padding: 14px 6px 10px !important; border-radius: 10px; height: 100%; }
    .service-box1 img { width: 44px; height: 44px; object-fit: contain; margin: 0 auto 8px !important; }
    .service-box1 h3, .service-box1 .title-medium-dark { font-size: 13px !important; line-height: 1.3; word-break: break-word; }
    .service-box1 .view { font-size: 12px; margin-bottom: 0 !important; }
    .title-bold-dark { font-size: 20px !important; line-height: 1.35; }
}

/* ---------- search page: filters behind a button on phones ---------- */
.dd-sp-toggle { display: none; }
@media (max-width: 767px) {
    .dd-sp-main input { min-width: 0; }
    .dd-sp-main .btn { white-space: nowrap; }
    .dd-sp-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; border: 1.5px solid #16a085; color: #16a085; background: #fff; border-radius: 8px; padding: 7px 14px; font-weight: 600; }
    .dd-sp-toggle b { background: #16a085; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; }
    .dd-sp-form:not(.open) .dd-sp-filters { display: none !important; }
    .dd-sp-filters { grid-template-columns: 1fr 1fr !important; }
    .dd-sp-filters > select[name="category"], .dd-sp-filters > .dd-sp-loc, .dd-sp-filters > .dd-sp-check { grid-column: 1 / -1; }
}

/* ---------- blog list ---------- */
@media (max-width: 992px) {
    .blog-page .header-filters { flex-wrap: wrap; gap: 8px; }
    .blog-page .select-dropdown { min-width: 0; flex: 1 1 140px; max-width: 100%; }
}
@media (max-width: 767px) {
    .blog-page .blog-container { padding: 0 14px !important; }
    .blog-page .filters-sidebar { order: 1 !important; } /* posts first, the category list after them */
    .blog-page .filter-item-reset { flex: 0 0 100%; text-align: center; }
}

/* ---------- pricing on very small phones ---------- */
@media (max-width: 360px) {
    .pl-box { min-width: 0 !important; width: 100% !important; }
    .pr-page .container { padding-left: 12px; padding-right: 12px; }
}

/* ---------- general readability on phones ---------- */
@media (max-width: 767px) {
    .container { padding-left: 14px; padding-right: 14px; }
    input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], select, textarea { font-size: 16px; } /* iPhone: no zoom on focus */
    .breadcrumbs-area ul { flex-wrap: wrap; }
    table { max-width: 100%; }
    .gradient-wrapper .gradient-title h2, .gradient-wrapper .gradient-title h1 { font-size: 18px !important; }
}

/* ---------- shop page: products first, shorter banner ---------- */
@media (max-width: 767px) {
    .business-page-wrapper .shop-banner { height: 140px !important; }
    .business-page-wrapper .content-grid > div:last-child { order: -1; } /* products before About / Contact / Hours */
    .business-page-wrapper .content-grid { display: flex !important; flex-direction: column; gap: 14px; }
}

/* ---------- header when signed in: Saved / Chat are already in the bottom bar ---------- */
@media (max-width: 767px) {
    #header-three .nav-padding, #header-three .d-flex { flex-direction: row !important; } /* some pages turn every .row / .d-flex into a column */
    #header-three .d-lg-none .hdr-ql[href*="/user/favourites"],
    #header-three .d-lg-none .hdr-ql[href*="/user/messages"] { display: none !important; }
}

/* ---------- user panel ---------- */
@media (max-width: 991px) {
    .up-wrap { padding-top: 16px !important; }
}

/* ---------- old "My account" page (profile, business page, password): menu as a swipeable strip ---------- */
@media (max-width: 767px) {
    .my-account-title { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px; padding: 8px !important; scrollbar-width: none; }
    .my-account-title::-webkit-scrollbar { display: none; }
    .my-account-title > li { flex: 0 0 auto; border: 0 !important; margin: 0 !important; }
    .my-account-title > li > a { white-space: nowrap; border: 1px solid #e3e9eb !important; border-radius: 18px !important; padding: 7px 12px !important; display: block; font-size: 13px; }
    .my-account-title > li > a.active { background: #16a085 !important; color: #fff !important; border-color: #16a085 !important; }
    .my-account-title > li > a.active i { color: #fff !important; }
    .my-account-title > li > a:before { display: none !important; }
}
