/* =========================================================
   HOZTORG PLUS — Mobile / PWA Styles
   Breakpoint: max-width 768px
   ========================================================= */

@media (max-width: 768px) {

    /* ── Hide desktop elements ── */
    .topbar { display: none !important; }
    .header form.search { display: none !important; }
    .header .btn-catalog { display: none !important; }
    .header__actions .header-action span { display: none !important; }
    .header__actions .header-action:not(:last-child) { display: none !important; }
    footer.footer { display: none !important; }
    .footer { display: none !important; }

    /* ── Body padding for bottom nav ── */
    body { padding-bottom: 70px; }

    /* =========================================================
       MOBILE HEADER
       ========================================================= */
    .header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff;
        box-shadow: 0 1px 8px rgba(0,0,0,.08);
        padding: 0;
    }

    .header .container { padding: 0 16px; }

    .header__inner {
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }

    /* Hamburger */
    .mobile-hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        padding: 0;
        color: var(--gray-700);
    }

    /* Logo compact */
    .logo { gap: 8px; }
    .logo__icon { width: 28px; height: 28px; }
    .logo__title { font-size: 13px; }
    .logo__sub { font-size: 10px; }

    /* Mobile header actions */
    .header__actions {
        display: flex !important;
        align-items: center;
        gap: 4px;
    }

    .header-action {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        padding: 0;
        color: var(--gray-700);
        position: relative;
    }

    /* ── Mobile Search Bar ── */
    .mobile-search {
        display: flex !important;
        padding: 8px 16px 10px;
        background: #fff;
        border-bottom: 1px solid var(--gray-100);
    }

    .mobile-search__form {
        display: flex;
        align-items: center;
        width: 100%;
        background: var(--gray-100);
        border-radius: 12px;
        padding: 0 14px;
        gap: 8px;
        height: 42px;
    }

    .mobile-search__form svg { color: var(--gray-500); flex-shrink: 0; }

    .mobile-search__input {
        flex: 1;
        border: none;
        background: none;
        font-size: 15px;
        color: var(--gray-900);
        outline: none;
    }

    .mobile-search__input::placeholder { color: var(--gray-500); }

    /* =========================================================
       HERO — MOBILE
       ========================================================= */
    .hero {
        border-radius: 16px;
        margin: 12px 16px;
        overflow: hidden;
        min-height: 200px;
        position: relative;
        background: linear-gradient(135deg, #EEF2FF 0%, #C7D2FE 100%);
        display: flex;
        flex-direction: column;
        padding: 24px 20px 20px;
    }

    .hero__image {
        position: absolute;
        inset: 0;
        z-index: 0;
    }

    .hero__image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: .35;
    }

    .hero__content {
        position: relative;
        z-index: 1;
        max-width: 100%;
    }

    .hero__label {
        display: inline-block;
        background: var(--primary);
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        padding: 4px 10px;
        border-radius: 20px;
        margin-bottom: 10px;
    }

    .hero__title {
        font-size: 22px;
        font-weight: 700;
        color: var(--dark);
        line-height: 1.25;
        margin-bottom: 8px;
    }

    .hero__desc {
        font-size: 13px;
        color: var(--gray-700);
        margin-bottom: 16px;
        max-width: 260px;
    }

    .hero__content .btn {
        font-size: 13px;
        padding: 10px 18px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--primary);
        color: #fff;
        font-weight: 600;
        border: none;
        width: fit-content;
    }

    .hero__dots {
        margin-top: 16px;
        display: flex;
        gap: 6px;
    }

    .hero__dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(42,92,255,.25);
        border: none;
        padding: 0;
    }

    .hero__dot.active {
        background: var(--primary);
        width: 20px;
        border-radius: 4px;
    }

    /* =========================================================
       BENEFITS — MOBILE
       ========================================================= */
    .benefits {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 0 16px;
        margin: 16px 0;
    }

    .benefit {
        background: var(--gray-100);
        border-radius: 12px;
        padding: 12px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .benefit__icon {
        width: 36px;
        height: 36px;
        background: var(--primary-light);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--primary);
        flex-shrink: 0;
    }

    .benefit__title { font-size: 12px; font-weight: 600; color: var(--dark); }
    .benefit__sub { font-size: 11px; color: var(--gray-500); }

    /* =========================================================
       SECTION HEADERS — MOBILE
       ========================================================= */
    .section-header {
        padding: 0 16px;
        margin-bottom: 12px;
    }

    .section-title { font-size: 18px; }

    /* =========================================================
       CATEGORIES — MOBILE
       ========================================================= */
    .categories { padding: 0; margin: 20px 0; }

    .categories__grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        padding: 0 16px;
        overflow-x: auto;
        grid-auto-flow: column;
        grid-template-columns: unset;
        grid-auto-columns: 80px;
        padding-bottom: 4px;
    }

    .category-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
        min-width: 80px;
    }

    .category-card__img {
        width: 72px;
        height: 72px;
        border-radius: 14px;
        background: var(--gray-100);
        overflow: hidden;
        flex-shrink: 0;
    }

    .category-card__img img { width: 100%; height: 100%; object-fit: cover; }

    .category-card__placeholder {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
    }

    .category-card__name {
        font-size: 11px;
        font-weight: 500;
        color: var(--gray-700);
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* =========================================================
       PRODUCTS — MOBILE
       ========================================================= */
    .products { padding: 0; margin: 20px 0; }

    .products__grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 16px;
    }

    /* Product card mobile */
    .product-card {
        border-radius: 14px;
        padding: 10px;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--gray-100);
        position: relative;
    }

    .product-card__img-wrap {
        border-radius: 10px;
        overflow: hidden;
        aspect-ratio: 1;
        background: var(--gray-100);
        margin-bottom: 8px;
    }

    .product-card__img-wrap img { width: 100%; height: 100%; object-fit: cover; }

    .product-card__badge {
        position: absolute;
        top: 8px;
        left: 8px;
        font-size: 10px;
        font-weight: 700;
        padding: 3px 8px;
        border-radius: 6px;
        z-index: 1;
    }

    .product-card__badge--hit { background: #F59E0B; color: #fff; }
    .product-card__badge--new { background: #22C55E; color: #fff; }
    .product-card__badge--sale { background: #EF4444; color: #fff; }

    .product-card__wish {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
        background: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        box-shadow: var(--shadow-sm);
        color: var(--gray-500);
    }

    .product-card__name {
        font-size: 12px;
        font-weight: 500;
        color: var(--dark);
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
    }

    .product-card__reviews {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-bottom: 8px;
        font-size: 11px;
        color: var(--gray-500);
    }

    .product-card__stars { color: #F59E0B; font-size: 11px; }

    .product-card__price {
        font-size: 15px;
        font-weight: 700;
        color: var(--dark);
        margin-bottom: 8px;
    }

    .product-card__price-old {
        font-size: 12px;
        color: var(--gray-500);
        text-decoration: line-through;
        margin-right: 4px;
    }

    .product-card__btn {
        width: 100%;
        background: var(--primary);
        color: #fff;
        border: none;
        border-radius: 10px;
        padding: 9px 0;
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        transition: background var(--transition);
    }

    .product-card__btn:hover { background: var(--primary-dark); }

    /* =========================================================
       CONTAINER — MOBILE
       ========================================================= */
    .container { padding: 0; }

    /* =========================================================
       BOTTOM NAVIGATION
       ========================================================= */
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: #fff;
        border-top: 1px solid var(--gray-100);
        box-shadow: 0 -4px 16px rgba(0,0,0,.06);
        z-index: 200;
        align-items: center;
        justify-content: space-around;
        padding: 0 8px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 6px 12px;
        color: var(--gray-500);
        background: none;
        border: none;
        text-decoration: none;
        transition: color var(--transition);
        position: relative;
        min-width: 56px;
    }

    .mobile-nav__item.active { color: var(--primary); }

    .mobile-nav__item svg { flex-shrink: 0; }

    .mobile-nav__label {
        font-size: 10px;
        font-weight: 500;
        white-space: nowrap;
    }

    .mobile-nav__badge {
        position: absolute;
        top: 2px;
        right: 8px;
        background: var(--primary);
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
    }

    /* =========================================================
       CATALOG PAGE — MOBILE
       ========================================================= */
    .catalog-mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        font-size: 18px;
        font-weight: 700;
        color: var(--dark);
    }

    .catalog-mobile-header__actions {
        display: flex;
        gap: 4px;
    }

    .catalog-mobile-header__btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--gray-700);
    }

    /* Category list (catalog page mobile) */
    .mobile-category-list {
        display: flex !important;
        flex-direction: column;
        padding: 0 16px;
        gap: 2px;
    }

    .mobile-category-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 12px;
        background: #fff;
        border-radius: 12px;
        text-decoration: none;
        color: var(--dark);
        font-size: 15px;
        font-weight: 500;
        border: 1px solid transparent;
        transition: all var(--transition);
    }

    .mobile-category-item:hover,
    .mobile-category-item:active {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }

    .mobile-category-item__icon {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: var(--gray-100);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        flex-shrink: 0;
        overflow: hidden;
    }

    .mobile-category-item__icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-category-item__name { flex: 1; }

    .mobile-category-item__arrow { color: var(--gray-400); }

    /* Promo banners */
    .mobile-promo {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        padding: 16px;
        margin-top: 8px;
    }

    .mobile-promo__card {
        border-radius: 14px;
        padding: 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        overflow: hidden;
        position: relative;
        min-height: 100px;
    }

    .mobile-promo__card--purple { background: linear-gradient(135deg, #EEF2FF, #C7D2FE); }
    .mobile-promo__card--green { background: linear-gradient(135deg, #F0FDF4, #BBF7D0); }

    .mobile-promo__content { flex: 1; }

    .mobile-promo__tag {
        font-size: 11px;
        font-weight: 600;
        color: var(--primary);
        margin-bottom: 4px;
    }

    .mobile-promo__title {
        font-size: 15px;
        font-weight: 700;
        color: var(--dark);
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .mobile-promo__btn {
        background: var(--primary);
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 8px 14px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        display: inline-block;
        text-decoration: none;
    }

    .mobile-promo__img {
        width: 80px;
        height: 80px;
        border-radius: 10px;
        object-fit: cover;
        flex-shrink: 0;
    }

    /* Hide desktop catalog grid on mobile */
    .catalog-grid,
    .catalog-sidebar { display: none !important; }

    /* Show mobile catalog only on mobile */
    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }

} /* end @media */

/* Hide mobile-only elements on desktop */
.mobile-nav { display: none; }
.mobile-search { display: none; }
.mobile-hamburger { display: none; }
.mobile-only { display: none; }
.desktop-only { display: block; }
