/* ============================================
   CATALOG STYLES - View Mode Switching
   ============================================ */

/* View Mode Switcher Buttons */
.catalog-view-switcher {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.catalog-view-switcher .btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
    transition: all 0.3s ease;
    cursor: pointer;
}

.catalog-view-switcher .btn:hover {
    background: #e9e9e9;
    color: #333;
}

.catalog-view-switcher .btn.active {
    background: #00509d;
    color: #fff;
    border-color: #00509d;
}

.catalog-view-switcher .btn i {
    font-size: 16px;
}

/* Product Layout Base Styles */
.product-layout {
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.product-layout .product-thumb {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.product-layout .product-thumb:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #00509d;
}

/* ============================================
   GRID VIEW MODE
   ============================================ */
.product-layout.product-grid {
    display: flex;
}

.product-layout.product-grid .product-thumb {
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
}

.product-layout.product-grid .image {
    padding: 0;
    margin-bottom: 10px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-layout.product-grid .image img {
    max-height: 100%;
    object-fit: contain;
    width: auto;
}

.product-layout.product-grid .caption {
    padding: 0 !important;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: unset !important;
}

.product-layout.product-grid .caption h4 {
    font-size: 14px;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    min-height: 60px;
}

.product-layout.product-grid .caption p.fs-12,
.product-layout.product-grid br:not(.k-quantity br) {
    display: none !important;
}

.product-layout.product-grid .caption .text-secondary {
    font-size: 11px !important;
    display: block !important;
    margin-bottom: 10px;
}

.product-layout.product-grid .caption .stock-status,
.product-layout.product-grid .caption span[style*="color"] {
    display: block !important;
    font-size: 12px;
    margin-bottom: 15px;
}

.product-layout.product-grid .price {
    font-weight: bold;
    color: #00509d;
    font-size: 18px;
    margin-top: auto;
    margin-bottom: 10px;
}

.product-layout.product-grid .button-group {
    padding: 0;
    border: none;
    margin: 0 !important;
    display: block !important;
}

.product-layout.product-grid .button-group .btn {
    width: 100%;
    font-size: 14px;
    padding: 8px;
}

/* ============================================
   LIST VIEW MODE
   ============================================ */
.product-layout.product-list {
    width: 100%;
}

.product-layout.product-list .product-thumb {
    flex-direction: row;
    padding: 15px;
    display: flex;
    width: 100%;
}

.product-layout.product-list .image {
    width: 200px;
    min-width: 200px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.product-layout.product-list .image img {
    max-height: 180px;
    max-width: 180px;
}

.product-layout.product-list>div {
    display: flex;
    width: 100%;
}

.product-layout.product-list .caption {
    flex: 1;
    padding: 0 20px;
    text-align: left;
}

.product-layout.product-list .caption h4 {
    font-size: 18px;
    margin-bottom: 10px;
}

.product-layout.product-list .caption p.fs-12 {
    display: block;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0;
}

.product-layout.product-list .caption .price {
    font-size: 20px;
    margin: 10px 0;
    font-weight: bold;
    color: #00509d;
}

.product-layout.product-list .button-group {
    width: 180px;
    min-width: 180px;
    border-top: none;
    border-left: 1px solid #eee;
    padding-left: 15px;
    display: flex;
    align-items: center;
}

/* ============================================
   TABLE VIEW MODE
   ============================================ */
.product-layout.product-table {
    width: 100%;
    margin-bottom: 2px;
}

.product-layout.product-table .product-thumb {
    flex-direction: row;
    align-items: center;
    padding: 5px 15px;
    border-radius: 0;
    min-height: 50px;
}

.product-layout.product-table .image {
    width: 50px;
    min-width: 50px;
    padding: 0;
    margin-right: 15px;
}

.product-layout.product-table .image img {
    max-height: 40px;
    width: auto;
}

.product-layout.product-table>div {
    display: flex;
    width: 100%;
    align-items: center;
}

.product-layout.product-table .caption {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 !important;
    min-height: unset !important;
    margin: 0 !important;
}

.product-layout.product-table .caption h4 {
    flex: 3;
    font-size: 14px;
    margin: 0;
}

.product-layout.product-table .caption .text-secondary {
    flex: 1.5;
    font-size: 12px;
    margin: 0;
}

.product-layout.product-table .caption .price {
    flex: 1.5;
    font-size: 16px;
    margin: 0;
    text-align: right;
    font-weight: bold;
    color: #00509d;
}

.product-layout.product-table .caption .stock-status {
    flex: 1;
    font-size: 12px;
    text-align: right;
    margin: 0 15px;
}

.product-layout.product-table .button-group {
    width: 130px;
    min-width: 130px;
    border-top: none;
    border-left: 1px solid #eee;
    padding: 0 0 0 15px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
/* ============================================
   SIDEBAR & SUBCATEGORY REFINEMENT
   ============================================ */

/* Sidebar Category Panel */
.sidebar-cat-panel {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden;
    margin-top: 20px !important;
    background: #fff;
}

.cat-nav-heading {
    background: #f8f8f8 !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid #ddd !important;
    font-weight: bold !important;
    color: #333 !important;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-list-group {
    border: none !important;
    margin: 0 !important;
}

.sidebar-item {
    border: none !important;
    border-bottom: 1px solid #eee !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    color: #00509d !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: block !important;
}

.sidebar-item:last-child {
    border-bottom: none !important;
}

.sidebar-item:hover {
    background: #f0f7fd !important;
    color: #d9534f !important;
    padding-left: 25px !important;
}

.sidebar-item i {
    float: right;
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.4;
}

/* Subcategory Grid (Card Style) */
.subcategories-grid-new {
    margin-top: 20px;
}

.subcategory-item-new {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.subcategory-item-new:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: #00509d;
    transform: translateY(-2px);
}

.subcategory-item-img {
    flex: 0 0 100px;
    margin-right: 15px;
}

.subcategory-item-img img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 4px;
}

.subcategory-item-info {
    flex: 1;
}

.subcategory-item-title {
    margin: 0 0 8px 0 !important;
    font-size: 16px !important;
    font-weight: bold !important;
}

.subcategory-item-title a {
    color: #00509d;
    text-decoration: none;
}

.subcategory-item-title a:hover {
    color: #d9534f;
}

.subcategory-item-children {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}

.subcategory-item-children a {
    color: #555;
    text-decoration: none;
    display: inline;
}

.subcategory-item-children a:hover {
    color: #d9534f;
    text-decoration: underline;
}

@media (max-width: 767px) {

    .product-layout.product-list .product-thumb,
    .product-layout.product-table .product-thumb {
        flex-direction: column;
    }

    .product-layout.product-list .image,
    .product-layout.product-table .image {
        width: 100%;
        min-width: auto;
        min-height: 150px;
    }

    .product-layout.product-list .caption,
    .product-layout.product-table .caption {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 15px;
    }

    .product-layout.product-table .caption h4,
    .product-layout.product-table .caption .text-secondary,
    .product-layout.product-table .caption .price,
    .product-layout.product-table .caption .stock-status {
        flex: auto;
        width: 100%;
        text-align: left;
    }
}

/* Quantity Selector Styles - Horizontal Layout */
.quantity-selector {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    height: 38px;
    background: #fff;
    vertical-align: middle;
}

.quantity-selector button {
    width: 30px;
    height: 100%;
    border: none;
    background: #f8f9fa;
    color: #333;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-selector button:hover {
    background: #e9ecef;
}

.quantity-selector .qty-input {
    width: 40px !important;
    height: 100% !important;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    text-align: center !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font-size: 14px;
}

.button-group-wrap {
    gap: 10px;
}

/* GRID VIEW MODE - Vertical button layout */
.product-layout.product-grid .button-group-wrap {
    flex-direction: column;
    align-items: stretch;
}

.product-layout.product-grid .quantity-selector {
    margin-right: 0;
    margin-bottom: 10px;
    width: 100%;
}

.product-layout.product-grid .quantity-selector .qty-input {
    width: 100% !important;
    flex-grow: 1;
    font-size: 16px;
    font-weight: bold;
}

.product-layout.product-grid .quantity-selector button {
    font-size: 20px;
    height: 42px;
}

.product-layout.product-grid .btn-add-cart-new {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    padding: 10px;
}

.btn-add-cart-new.added {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

/* Enhanced Clickability */
.caption h4 a,
.caption .text-secondary {
    display: inline-block;
    width: 100%;
}

.subcategory-item-title a {
    display: block;
}

/* ============================================
   MARKETPLACE WIDGET STYLES
   ============================================ */

/* Premium Marketplace Widget - Solid CTA Style */
.marketplace-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 15px;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

.marketplace-widget .widget-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777;
    margin-bottom: 5px;
    font-weight: 700;
    text-align: left;
}

.btn-market-premium {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 4px;
    text-decoration: none !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 15px;
    transition: opacity 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none !important;
    margin-bottom: 0;
}

.btn-market-premium:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
}

/* Icons */
.market-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.market-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: #fff;
}

.market-icon i {
    font-size: 16px;
    color: #fff;
    line-height: 1;
}

/* Label */
.market-label {
    font-size: 15px;
    font-weight: 600;
    color: #fff !important;
    white-space: nowrap;
}

.brand-name {
    font-weight: 700;
    color: #fff !important;
}

/* Brand Specifics */
.btn-avito-p {
    background-color: #00AAFF !important;
}

.btn-ozon-p {
    background-color: #005BFF !important;
}

.btn-yandex-p {
    background-color: #FC3F1D !important;
}

.btn-wb-p {
    background-color: #CB11AB !important;
}

/* ============================================================
   TABLET CATALOG RESPONSIVE (768px - 991px)
   ============================================================ */

@media (min-width: 768px) and (max-width: 991px) {

    /* Sidebar category panel */
    .sidebar-cat-panel {
        margin-top: 15px !important;
    }

    .cat-nav-heading {
        padding: 10px 15px !important;
        font-size: 13px;
    }

    .sidebar-item {
        padding: 10px 15px !important;
        font-size: 13px !important;
    }

    /* Product grid - 2 columns on tablet */
    .product-layout.product-grid {
        width: 50% !important;
        flex: 0 0 50%;
        max-width: 50%;
    }

    .product-layout.product-grid .image {
        height: 130px;
    }

    .product-layout.product-grid .caption h4 {
        font-size: 13px;
        min-height: 50px;
    }

    .product-layout.product-grid .price {
        font-size: 16px;
    }

    /* List view adjustments */
    .product-layout.product-list .image {
        width: 150px;
        min-width: 150px;
    }

    .product-layout.product-list .image img {
        max-height: 140px;
        max-width: 140px;
    }

    .product-layout.product-list .caption h4 {
        font-size: 15px;
    }

    /* Table view adjustments */
    .product-layout.product-table .image {
        width: 40px;
        min-width: 40px;
    }

    .product-layout.product-table .caption h4 {
        font-size: 13px;
    }

    /* Subcategory grid - 2 columns */
    .subcategories-grid-new .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .subcategory-item-img {
        flex: 0 0 80px;
    }

    .subcategory-item-img img {
        width: 80px;
        height: 80px;
    }

    .subcategory-item-title {
        font-size: 14px !important;
    }

    /* Category settings bar */
    .cat-settings {
        flex-wrap: wrap;
        gap: 10px;
    }

    .catalog-view-switcher .btn {
        padding: 5px 10px;
    }
}