/* ============================================
   Marketplace Product Cards - Mobile-First
   Modern, conversion-focused eCommerce design
   ============================================ */

/* --- Hide legacy mobile cart icon globally --- */
.tp-product-mobile-cart-icon {
    display: none !important;
}

/* ============================================
   MOBILE STYLES (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {

    /* --- Page background --- */
    body,
    main,
    .tp-product-area,
    .tp-product-arrival-area {
        background: #f5f5f5 !important;
    }

    /* --- Section spacing --- */
    body .tp-product-area,
    body .tp-product-arrival-area {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    body .tp-product-area .container,
    body .tp-product-arrival-area .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* --- Grid: 2 columns, tight gutters --- */
    body .row.row-cols-2,
    body .row[class*="row-cols-"] {
        --bs-gutter-x: 8px !important;
        --bs-gutter-y: 8px !important;
        margin-bottom: 0 !important;
    }

    /* --- Product card --- */
    body .tp-product-item,
    body .tp-product-item.transition-3,
    .row-cols-2 .col .tp-product-item {
        margin-bottom: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        background: #fff !important;
        border: none !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    }

    /* --- Product image --- */
    body .tp-product-item .tp-product-thumb,
    .row-cols-2 .tp-product-item .tp-product-thumb {
        border-radius: 12px 12px 0 0 !important;
        overflow: hidden !important;
        border-bottom: none !important;
    }

    body .tp-product-item .tp-product-thumb img,
    .row-cols-2 .tp-product-item .tp-product-thumb img {
        aspect-ratio: 1 / 1 !important;
        object-fit: cover !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        transform: none !important;
        transition: none !important;
    }

    /* --- Content area --- */
    body .tp-product-item .tp-product-content,
    .row-cols-2 .tp-product-item .tp-product-content,
    .swiper-wrapper .tp-product-item .tp-product-content {
        padding: 10px 10px 12px !important;
        position: relative !important;
    }

    /* --- Product title: 2-line clamp --- */
    body .tp-product-item .tp-product-title,
    body .tp-product-item .tp-product-title-clamp,
    main .tp-product-item .tp-product-title,
    .row-cols-2 .tp-product-item .tp-product-title {
        font-size: 12.5px !important;
        font-weight: 400 !important;
        line-height: 1.4 !important;
        margin-bottom: 6px !important;
        -webkit-line-clamp: 2 !important;
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        white-space: normal !important;
        text-overflow: ellipsis !important;
        min-height: 35px !important;
        color: #333 !important;
    }

    body .tp-product-item .tp-product-title a,
    main .tp-product-item .tp-product-title a {
        font-size: inherit !important;
        font-weight: inherit !important;
        color: inherit !important;
        text-decoration: none !important;
    }

    /* --- Category label pill --- */
    body .tp-product-category-label,
    .tp-product-category-label {
        display: block !important;
        margin-bottom: 6px !important;
    }

    body .tp-product-category-label span {
        font-size: 10px !important;
        color: #fff !important;
        background: linear-gradient(135deg, #ff6a00, #ee4400) !important;
        padding: 2px 8px !important;
        border-radius: 10px !important;
        font-weight: 600 !important;
        display: inline-block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        line-height: 1.5 !important;
    }

    /* --- Price display --- */
    body .tp-product-item .tp-product-price-wrapper {
        display: flex !important;
        align-items: baseline !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        margin-bottom: 0 !important;
    }

    body .tp-product-item .tp-product-price.new-price {
        font-size: 17px !important;
        font-weight: 800 !important;
        color: #1a1a1a !important;
        letter-spacing: -0.5px !important;
    }

    body .tp-product-item .tp-product-price.old-price {
        font-size: 11px !important;
        text-decoration: line-through !important;
        color: #b0b0b0 !important;
        font-weight: 400 !important;
    }

    /* --- Price + Cart row mobile: stack price above cart --- */
    body .tp-product-price-cart-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
    }

    body .tp-product-price-col {
        width: 100% !important;
    }

    /* --- Floating cart button → full-width pill on mobile --- */
    body .tp-product-floating-cart-btn,
    .tp-product-floating-cart-btn {
        display: flex !important;
        width: 100% !important;
        height: 34px !important;
        border-radius: 8px !important;
        border: none !important;
        background: var(--tp-theme-primary, #ff6a00) !important;
        color: #fff !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        cursor: pointer !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        letter-spacing: 0.2px !important;
        box-shadow: none !important;
        opacity: 1 !important;
        transform: none !important;
        -webkit-tap-highlight-color: transparent !important;
        transition: filter 0.15s ease !important;
        padding: 0 !important;
        outline: none !important;
    }

    body .tp-product-floating-cart-btn:active {
        filter: brightness(0.88) !important;
    }

    body .tp-product-floating-cart-btn svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }

    /* --- Rating + Sold count (inline) --- */
    body .tp-product-rating-sold,
    .tp-product-rating-sold {
        display: flex !important;
        align-items: center !important;
        margin-top: 2px !important;
    }

    body .tp-product-rating-inline,
    .tp-product-rating-inline {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        font-size: 11px !important;
        color: #999 !important;
        line-height: 1 !important;
    }

    body .tp-product-rating-inline svg {
        width: 11px !important;
        height: 11px !important;
        flex-shrink: 0 !important;
    }

    body .tp-rating-num {
        font-size: 11px !important;
        font-weight: 600 !important;
        color: #333 !important;
    }

    body .tp-rating-divider {
        font-size: 10px !important;
        color: #ddd !important;
        margin: 0 1px !important;
    }

    body .tp-reviews-count {
        font-size: 11px !important;
        color: #999 !important;
    }

    /* --- HIDE old rating styles on mobile --- */
    body .tp-product-item .tp-product-rating,
    body .tp-product-item .tp-product-rating-ozon,
    body .tp-product-item .tp-product-rating-simple,
    body .tp-product-item .tp-product-price-review {
        display: none !important;
    }

    /* --- HIDE hover action buttons on mobile --- */
    body .tp-product-item .tp-product-action,
    .row-cols-2 .tp-product-item .tp-product-action,
    .swiper-wrapper .tp-product-item .tp-product-action {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    /* --- SHOW full-width Add To Cart bar on mobile --- */
    body .tp-product-item .tp-product-add-cart-btn-large-wrapper,
    .row-cols-2 .tp-product-item .tp-product-add-cart-btn-large-wrapper,
    .swiper-wrapper .tp-product-item .tp-product-add-cart-btn-large-wrapper {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
    }

    body .tp-product-item .tp-product-add-cart-btn-large,
    .row-cols-2 .tp-product-item .tp-product-add-cart-btn-large {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        width: 100% !important;
        padding: 10px 8px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        background: var(--tp-theme-primary, #ff6a00) !important;
        color: #fff !important;
        border: none !important;
        border-radius: 0 0 12px 12px !important;
        letter-spacing: 0.2px !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        transition: filter 0.15s ease !important;
    }

    body .tp-product-item .tp-product-add-cart-btn-large:active {
        filter: brightness(0.88) !important;
    }

    body .tp-product-item .tp-product-add-cart-btn-large svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }

    /* --- Badges: sale/hot pills --- */
    body .tp-product-item .tp-product-badge,
    .row-cols-2 .tp-product-item .tp-product-badge {
        top: 8px !important;
        left: 8px !important;
        right: auto !important;
    }

    body .tp-product-item .tp-product-badge span {
        font-size: 10px !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
        font-weight: 700 !important;
        letter-spacing: 0.2px !important;
    }

    body .tp-product-item .tp-product-badge .product-sale {
        background: linear-gradient(135deg, #ff4747, #e62e2e) !important;
        color: #fff !important;
    }

    /* --- Section titles --- */
    body .tp-product-area .section-title-wrapper,
    body .tp-product-arrival-area .section-title-wrapper {
        margin-bottom: 10px !important;
    }

    body .tp-product-area .tp-section-title__pre,
    body .tp-product-arrival-area .tp-section-title__pre {
        display: none !important;
    }

    body .tp-product-area .tp-section-title,
    body .tp-product-arrival-area .tp-section-title {
        font-size: 16px !important;
        font-weight: 700 !important;
    }

    /* --- Hide sidebar on mobile --- */
    body .tp-product-arrival-area .col-xl-4,
    body .tp-product-arrival-area .col-lg-5 {
        display: none !important;
    }

    body .tp-product-arrival-area .col-xl-8,
    body .tp-product-arrival-area .col-lg-7 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    body .mb-40 {
        margin-bottom: 12px !important;
    }

    /* ---- Hide non-essential homepage sections on mobile ---- */
    body .tp-feature-area,
    body section[class*="tp-feature"] {
        display: none !important;
    }

    body .tp-banner-area,
    body .tp-product-banner-area,
    body section[class*="tp-banner"] {
        display: none !important;
    }

    body .tp-blog-area,
    body section[class*="tp-blog"] {
        display: none !important;
    }

    body .tp-instagram-area,
    body div[class*="tp-instagram"] {
        display: none !important;
    }

    body .tp-product-sm-area {
        display: none !important;
    }

    /* ---- Category tabs: horizontal pill scroll ---- */
    body .ozon-categories-section {
        padding: 8px 0 !important;
        background: #fff !important;
    }

    body .ozon-categories-section .container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    body .ozon-categories-section .tp-product-categories-slider {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 0 10px !important;
    }

    body .ozon-categories-section .tp-product-categories-slider::-webkit-scrollbar {
        display: none !important;
    }

    body .ozon-categories-section .swiper-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }

    body .ozon-categories-section .swiper-slide {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    body .ozon-categories-section .tp-product-category-item {
        margin-bottom: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 6px 14px !important;
        background: #f5f5f5 !important;
        border-radius: 20px !important;
        white-space: nowrap !important;
        transition: background 0.2s ease !important;
    }

    body .ozon-categories-section .tp-product-category-item:active {
        background: var(--tp-theme-primary, #ff6a00) !important;
    }

    body .ozon-categories-section .tp-product-category-item:active .tp-product-category-title a {
        color: #fff !important;
    }

    body .ozon-categories-section .tp-product-category-thumb {
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    body .ozon-categories-section .tp-product-category-thumb img {
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }

    body .ozon-categories-section .tp-product-category-title {
        font-size: 12px !important;
        font-weight: 500 !important;
        margin: 0 !important;
    }

    body .ozon-categories-section .tp-product-category-title a {
        color: #333 !important;
        white-space: nowrap !important;
    }

    body .ozon-categories-section .tp-product-category-content p {
        display: none !important;
    }

    /* ---- Trending tabs: pill style ---- */
    body .tp-product-area .tp-product-tab {
        justify-content: flex-start !important;
    }

    body .tp-product-area .nav-tabs {
        border-bottom: none !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 8px !important;
        padding-bottom: 4px !important;
        justify-content: flex-start !important;
    }

    body .tp-product-area .nav-tabs::-webkit-scrollbar {
        display: none !important;
    }

    body .tp-product-area .nav-tabs .nav-item {
        flex-shrink: 0 !important;
    }

    body .tp-product-area .nav-tabs .nav-link {
        padding: 7px 16px !important;
        border-radius: 20px !important;
        border: none !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #666 !important;
        background: #f0f0f0 !important;
        white-space: nowrap !important;
        transition: all 0.2s ease !important;
    }

    body .tp-product-area .nav-tabs .nav-link.active {
        background: #222 !important;
        color: #fff !important;
    }

    body .tp-product-area .nav-tabs .nav-link .tp-product-tab-line {
        display: none !important;
    }

    /* Section title + tabs layout */
    body .tp-product-area .row.align-items-center.mb-40 {
        flex-direction: column !important;
        align-items: flex-start !important;
        margin-bottom: 10px !important;
        gap: 8px !important;
    }

    body .tp-product-area .row.align-items-center.mb-40 > div {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* ---- Flash sale ---- */
    body .tp-product-offer {
        background: #fff !important;
        padding: 12px 0 !important;
    }

    body .tp-product-offer .swiper-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    body .tp-product-offer .tp-product-offer-item {
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    /* ---- Slider area ---- */
    body .ozon-slider-area {
        padding: 6px 0 0 !important;
    }

    /* --- Remove hover effects on mobile --- */
    body .tp-product-item:hover {
        border-color: transparent !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
        transform: none !important;
    }

    body .tp-product-item:hover .tp-product-thumb img {
        transform: none !important;
    }

    body .tp-product-item:hover .tp-product-action {
        display: none !important;
    }

    /* --- Store / category link --- */
    body .tp-product-item .tp-product-category {
        margin-bottom: 2px !important;
    }

    body .tp-product-item .tp-product-category a {
        font-size: 10px !important;
        color: #999 !important;
    }

    /* --- mb-25 product items --- */
    body .tp-product-item.mb-25 {
        margin-bottom: 0 !important;
    }

    .row.mb-30 {
        margin-bottom: 8px !important;
    }
}

/* ============================================
   SMALL PHONES (max-width: 380px)
   ============================================ */
@media (max-width: 380px) {
    body .tp-product-item .tp-product-content {
        padding: 8px 8px 10px !important;
    }

    body .tp-product-item .tp-product-title,
    body .tp-product-item .tp-product-title-clamp {
        font-size: 11.5px !important;
        min-height: 32px !important;
    }

    body .tp-product-item .tp-product-price.new-price {
        font-size: 15px !important;
    }

    body .tp-product-category-label span {
        font-size: 9px !important;
        padding: 1px 6px !important;
    }

    body .tp-product-floating-cart-btn {
        width: 28px !important;
        height: 28px !important;
    }

    body .tp-product-floating-cart-btn svg {
        width: 13px !important;
        height: 13px !important;
    }
}
