/* =========================================================
   IranStores — Step 63
   Mobile-first polish
========================================================= */

@media (max-width: 767.98px){

    html,body{
        overflow-x:hidden;
    }

    body{
        font-size:15px;
    }

    .container{
        width:100%;
        max-width:100%;
        padding-right:12px;
        padding-left:12px;
    }

    /* ---------- NAVBAR ---------- */

    .iranstores-brand{
        max-width:68%;
        min-width:0;
    }

    .iranstores-logo{
        max-height:42px;
        width:auto;
    }

    .navbar{
        padding-top:7px;
        padding-bottom:7px;
    }

    .navbar-toggler{
        width:44px;
        height:44px;
        padding:7px;
        border-radius:12px;
        border-color:#e6e0f2;
        background:#faf8ff;
    }

    .navbar-collapse{
        margin-top:9px;
        padding:10px;
        border:1px solid #ece8f4;
        border-radius:16px;
        background:#fff;
        box-shadow:0 14px 34px rgba(15,23,42,.08);
    }

    .navbar-nav .nav-link{
        min-height:42px;
        display:flex;
        align-items:center;
        padding:8px 10px !important;
        border-radius:10px;
        font-size:14px;
        font-weight:800;
    }

    .navbar-nav .nav-link.active{
        background:#f5f3ff;
        color:#6d28d9 !important;
    }

    .navbar-actions{
        display:grid !important;
        grid-template-columns:1fr 1fr;
        gap:7px;
        width:100%;
    }

    .navbar-actions>*{
        min-width:0;
        width:100%;
    }

    /* ---------- LOCAL / PROVINCE PAGE ---------- */

    .local-page{
        overflow:hidden;
    }

    .local-page .container{
        padding-top:18px !important;
        padding-bottom:28px !important;
    }

    .local-hero{
        padding:20px 16px !important;
        border-radius:19px !important;
        gap:14px !important;
    }

    .local-hero h1{
        font-size:25px !important;
        line-height:1.65 !important;
    }

    .local-hero p{
        font-size:12px !important;
        line-height:1.95 !important;
    }

    .local-section{
        margin-top:26px !important;
    }

    .local-heading{
        margin-bottom:12px !important;
    }

    .local-heading h2{
        font-size:19px !important;
        line-height:1.7 !important;
    }

    .local-heading p,
    .local-heading>a{
        font-size:10px !important;
        line-height:1.8 !important;
    }

    /*
     * درخواست اصلی:
     * شهرستان‌های یک استان در موبایل سه‌ستونه
     */
    .local-city-grid{
        display:grid !important;
        grid-template-columns:repeat(3,minmax(0,1fr)) !important;
        gap:7px !important;
    }

    .local-city-card{
        min-width:0 !important;
        min-height:76px !important;
        display:flex !important;
        flex-direction:column !important;
        align-items:center !important;
        justify-content:center !important;
        gap:4px !important;
        padding:8px 5px !important;
        border-radius:12px !important;
        text-align:center !important;
    }

    .local-city-icon{
        width:28px !important;
        height:28px !important;
        flex:0 0 28px !important;
        display:grid !important;
        place-items:center !important;
        border-radius:9px !important;
        font-size:13px !important;
    }

    .local-city-card>span:nth-child(2){
        min-width:0 !important;
        width:100% !important;
    }

    .local-city-card strong{
        display:block !important;
        overflow:hidden !important;
        font-size:10px !important;
        line-height:1.55 !important;
        white-space:nowrap !important;
        text-overflow:ellipsis !important;
    }

    .local-city-card small{
        display:block !important;
        margin-top:2px !important;
        font-size:8px !important;
        line-height:1.5 !important;
        white-space:nowrap !important;
    }

    .local-city-card .arrow,
    .local-city-arrow{
        display:none !important;
    }

    /* ---------- STORE CARDS: TWO COLUMNS ---------- */

    .local-store-grid,
    .stores-grid{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        grid-auto-flow:row !important;
        gap:8px !important;
        overflow:visible !important;
    }

    .local-store-card,
    .store-card{
        min-width:0 !important;
        height:100% !important;
        border-radius:14px !important;
        box-shadow:0 6px 18px rgba(15,23,42,.055) !important;
    }

    .local-store-media,
    .store-card-media{
        height:auto !important;
        aspect-ratio:16/10 !important;
        min-height:0 !important;
    }

    .local-store-media img,
    .store-card-media img{
        width:100% !important;
        height:100% !important;
        object-fit:cover !important;
    }

    .local-store-body,
    .store-card-body{
        padding:9px !important;
    }

    .local-store-meta span,
    .store-card-category{
        font-size:8px !important;
    }

    .local-store-body h3,
    .store-card-title{
        margin:6px 0 4px !important;
        font-size:13px !important;
        line-height:1.65 !important;
    }

    .local-store-location,
    .store-card-meta{
        font-size:9px !important;
    }

    .local-store-body p{
        display:-webkit-box !important;
        min-height:35px !important;
        max-height:35px !important;
        overflow:hidden !important;
        margin:6px 0 8px !important;
        font-size:9px !important;
        line-height:1.8 !important;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
    }

    .local-store-footer,
    .store-card-footer{
        gap:5px !important;
        padding-top:7px !important;
    }

    .local-store-footer>span{
        font-size:8px !important;
    }

    .local-store-btn,
    .store-card-link{
        min-height:34px !important;
        padding:6px 7px !important;
        border-radius:9px !important;
        font-size:9px !important;
        white-space:nowrap !important;
    }

    /* Store directory cards */
    .store-card-heading{
        gap:5px !important;
    }

    .store-card-logo{
        width:38px !important;
        height:38px !important;
        min-width:38px !important;
        border-radius:10px !important;
    }

    .store-card-stats{
        gap:4px !important;
        flex-wrap:wrap !important;
    }

    .store-stat{
        font-size:8px !important;
    }

    .store-meta-row{
        gap:5px !important;
        font-size:9px !important;
    }

    /* ---------- HOME CARDS: TWO COLUMNS, NO HORIZONTAL RAIL ---------- */

    .store-grid,
    .store-rail{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        grid-auto-flow:row !important;
        grid-auto-columns:auto !important;
        gap:8px !important;
        overflow:visible !important;
        scroll-snap-type:none !important;
        padding-bottom:0 !important;
    }

    .home-store-card{
        min-width:0 !important;
        border-radius:14px !important;
    }

    .home-store-card .store-media{
        aspect-ratio:16/10 !important;
    }

    .home-store-card .store-copy{
        padding:9px !important;
    }

    .home-store-card .store-copy h3{
        font-size:13px !important;
        line-height:1.65 !important;
    }

    .home-store-card .store-copy>p{
        font-size:9px !important;
    }

    .home-store-excerpt{
        min-height:35px !important;
        max-height:35px !important;
        font-size:9px !important;
        line-height:1.8 !important;
    }

    .home-store-logo{
        right:8px !important;
        bottom:7px !important;
        width:38px !important;
        height:38px !important;
        border-width:2px !important;
        border-radius:10px !important;
    }

    .home-store-meta-row{
        gap:4px !important;
        margin:5px 0 7px !important;
        font-size:8px !important;
    }

    .home-store-cta{
        min-height:34px !important;
        padding:6px 8px !important;
        font-size:9px !important;
        border-radius:9px !important;
    }

    /* ---------- SEARCH RESULTS: TWO COLUMNS ---------- */

    .search-page .row.g-4{
        --bs-gutter-x:8px !important;
        --bs-gutter-y:8px !important;
    }

    .search-page .row.g-4 > .col-xl-4.col-lg-4.col-md-6{
        flex:0 0 auto !important;
        width:50% !important;
        max-width:50% !important;
    }

    .search-v2-store-card{
        height:100% !important;
        border-radius:14px !important;
    }

    .search-v2-store-media{
        height:auto !important;
        aspect-ratio:16/10 !important;
    }

    .search-v2-store-body{
        padding:9px !important;
    }

    .search-v2-store-body h3{
        font-size:13px !important;
        line-height:1.65 !important;
    }

    .search-v2-store-body p{
        display:-webkit-box !important;
        overflow:hidden !important;
        font-size:9px !important;
        line-height:1.8 !important;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
    }

    .search-v2-store-footer{
        gap:5px !important;
    }

    .search-v2-store-btn{
        min-height:34px !important;
        padding:6px 7px !important;
        font-size:9px !important;
    }

    /* ---------- PROMOTED CARDS ---------- */

    .local-promoted-grid{
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        grid-auto-flow:row !important;
        grid-auto-columns:auto !important;
        gap:8px !important;
        overflow:visible !important;
        scroll-snap-type:none !important;
    }

    .local-promoted-card{
        min-width:0 !important;
        border-radius:14px !important;
    }

    .local-promoted-media{
        height:auto !important;
        aspect-ratio:16/10 !important;
    }

    .local-promoted-body{
        padding:9px !important;
    }

    .local-promoted-body h3{
        font-size:13px !important;
    }

    .local-promoted-body p{
        display:-webkit-box;
        overflow:hidden;
        min-height:34px !important;
        max-height:34px !important;
        font-size:9px !important;
        line-height:1.8 !important;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
    }

    .local-promoted-cta{
        min-height:34px !important;
        padding:6px 7px !important;
        font-size:9px !important;
    }

    /* ---------- FILTERS / FORMS ---------- */

    .stores-filter-grid,
    .search-v2-filter-grid{
        grid-template-columns:1fr !important;
        gap:8px !important;
    }

    input,
    select,
    textarea{
        font-size:16px;
    }

    /* ---------- FOOTER ---------- */

    footer{
        margin-top:32px !important;
    }

    footer .container{
        padding-top:34px !important;
        padding-bottom:28px !important;
    }

    footer .row>div{
        margin-bottom:22px !important;
    }

    footer h4,
    footer h5{
        font-size:16px !important;
    }

    footer p,
    footer li,
    footer a{
        font-size:12px;
        line-height:1.9;
    }

    .footer-social{
        width:38px;
        height:38px;
        margin-right:4px;
        font-size:16px;
    }
}


/*
 * روی موبایل‌های بسیار باریک همچنان دو ستون کارت حفظ می‌شود،
 * اما padding و فونت کمی فشرده‌تر است.
 */
@media (max-width: 380px){

    .local-city-grid{
        gap:5px !important;
    }

    .local-city-card{
        min-height:70px !important;
        padding:7px 3px !important;
    }

    .local-city-card strong{
        font-size:9px !important;
    }

    .local-store-grid,
    .stores-grid,
    .store-grid,
    .store-rail,
    .local-promoted-grid{
        gap:6px !important;
    }

    .local-store-body,
    .store-card-body,
    .home-store-card .store-copy,
    .search-v2-store-body,
    .local-promoted-body{
        padding:7px !important;
    }

    .local-store-body h3,
    .store-card-title,
    .home-store-card .store-copy h3,
    .search-v2-store-body h3,
    .local-promoted-body h3{
        font-size:12px !important;
    }
}
/* IranStores mobile header register button */
.mobile-nav-tools {
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

.mobile-store-register {
    min-height: 42px;
    padding: 8px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 12px;
    color: #fff !important;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 7px 18px rgba(109, 40, 217, 0.24);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-store-register:hover,
.mobile-store-register:focus-visible {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(109, 40, 217, 0.32);
}

.mobile-store-register > span:first-child {
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 991.98px) {
    /* نسخه داخل منوی بازشونده مخفی شود تا دکمه تکراری نباشد */
    #mainMenu .store-register-nav {
        display: none !important;
    }

    .navbar > .container {
        flex-wrap: wrap;
    }

    #mainMenu {
        flex-basis: 100%;
    }
}

@media (max-width: 380px) {
    .mobile-store-register {
        padding-inline: 9px;
        font-size: 12px;
    }

    .mobile-nav-tools {
        gap: 5px;
    }
}
/* IranStores mobile header controls — v2 */
@media (max-width: 991.98px) {
    .navbar > .container {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        column-gap: 8px;
    }

    .mobile-nav-tools {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        margin-inline-start: auto;
    }

    .mobile-store-register {
        width: auto !important;
        min-width: 0 !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        padding: 0 13px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        border: 1px solid rgba(255, 255, 255, 0.28) !important;
        border-radius: 13px !important;
        color: #fff !important;
        background: linear-gradient(135deg, #8b3dff 0%, #6d28d9 55%, #5b21b6 100%) !important;
        box-shadow:
            0 7px 16px rgba(91, 33, 182, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        line-height: 1 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        transition:
            transform 0.18s ease,
            box-shadow 0.18s ease,
            filter 0.18s ease !important;
    }

    .mobile-store-register > span:first-child {
        width: 23px;
        height: 23px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 23px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.17);
        color: #fff;
        font-size: 18px !important;
        font-weight: 500;
        line-height: 1;
    }

    .mobile-store-register:hover,
    .mobile-store-register:focus-visible {
        color: #fff !important;
        filter: brightness(1.05);
        transform: translateY(-1px);
        box-shadow:
            0 9px 20px rgba(91, 33, 182, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
    }

    .mobile-store-register:active {
        transform: translateY(0) scale(0.98);
    }

    .mobile-nav-tools .navbar-toggler {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px;
        margin: 0 !important;
        padding: 7px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #e4ddf2 !important;
        border-radius: 13px !important;
        background: #fff !important;
        box-shadow: 0 5px 14px rgba(31, 41, 55, 0.08);
    }

    .mobile-nav-tools .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
    }

    /*
     * حذف قطعی دکمه تکراری از منوی همبرگری.
     * فقط دکمه‌ای که داخل navbar-collapse است مخفی می‌شود.
     */
    #mainMenu .navbar-actions > a.store-register-nav,
    #mainMenu a.store-register-nav,
    .navbar-collapse .store-register-nav {
        display: none !important;
    }

    #mainMenu {
        flex-basis: 100%;
        width: 100%;
    }
}

@media (max-width: 390px) {
    .mobile-nav-tools {
        gap: 5px;
    }

    .mobile-store-register {
        height: 40px !important;
        min-height: 40px !important;
        padding-inline: 9px !important;
        gap: 4px !important;
        border-radius: 12px !important;
        font-size: 12px !important;
    }

    .mobile-store-register > span:first-child {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
        font-size: 16px !important;
    }

    .mobile-nav-tools .navbar-toggler {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px;
        border-radius: 12px !important;
    }
}

/* در کامپیوتر دکمه جدید موبایل کاملاً مخفی بماند */
@media (min-width: 992px) {
    .mobile-nav-tools {
        display: none !important;
    }
}
/* Always-visible nearby button in mobile header */
@media (max-width: 991.98px) {
    .navbar .mobile-nearby-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 0;
        height: 40px;
        min-height: 40px;
        margin: 0;
        padding: 0 10px;
        border: 1px solid #c4b5fd;
        border-radius: 12px;
        background: #f5f3ff;
        color: #6d28d9;
        font-size: 10px;
        font-weight: 900;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
    }

    .navbar .mobile-nearby-link > span:first-child {
        font-size: 17px;
        line-height: 1;
    }

    .navbar .mobile-nearby-link:hover,
    .navbar .mobile-nearby-link:focus-visible {
        border-color: #8b5cf6;
        background: #ede9fe;
        color: #5b21b6;
        text-decoration: none;
    }
}

@media (max-width: 430px) {
    .navbar .mobile-nearby-link {
        width: 38px;
        min-width: 38px;
        padding: 0;
    }

    .navbar .mobile-nearby-text {
        display: none;
    }
}
