/*
 * NÔNG SẢN TÂY BẮC - Danh Sách Sản Phẩm CSS
 * Tiền tố class: dssp (danh sách sản phẩm)
 */

/* ========================================
   HERO BANNER SECTION
   ======================================== */
.dssp-hero {
    position: relative;
    height: 180px;
    background-image: url('../images/banner-gao-taybac.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 40px;
}

.dssp-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
}

.dssp-hero-content {
    position: relative;
    z-index: 2;
}

.dssp-hero-title {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.dssp-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
}

.dssp-breadcrumb a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dssp-breadcrumb a:hover {
    color: #f5a623;
}

.dssp-breadcrumb i {
    font-size: 10px;
}

.dssp-breadcrumb span {
    color: #f5a623;
}

/* ========================================
   MAIN CONTENT SECTION
   ======================================== */
.dssp-main {
    padding: 0 0 60px 0;
}

/* ========================================
   SIDEBAR
   ======================================== */
.dssp-sidebar {
    position: sticky;
    top: 20px;
}

.dssp-sidebar-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.dssp-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #4a6f28;
}

/* Category List */
.dssp-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dssp-category-item {
    border-bottom: 1px solid #f0f0f0;
}

.dssp-category-item:last-child {
    border-bottom: none;
}

.dssp-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
}

.dssp-category-link:hover {
    color: #4a6f28;
}

.dssp-category-link i {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s ease;
}

.dssp-category-item.active .dssp-category-link i {
    transform: rotate(45deg);
}

/* Subcategory */
.dssp-subcategory {
    display: none;
    list-style: none;
    padding: 0 0 10px 15px;
    margin: 0;
}

.dssp-subcategory li {
    padding: 8px 0;
}

.dssp-subcategory li a {
    color: #666;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dssp-subcategory li a:hover {
    color: #4a6f28;
}

/* Filter Box */
.dssp-filter-box {
    border: 2px dashed #4a6f28;
    background: #fafff5;
}

.dssp-filter-title {
    color: #4a6f28;
    position: relative;
}

.dssp-filter-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #4a6f28, transparent);
}

.dssp-filter-heading {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.dssp-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dssp-filter-list li {
    margin-bottom: 10px;
}

.dssp-filter-list li:last-child {
    margin-bottom: 0;
}

/* Custom Radio Button */
.dssp-radio {
    display: block;
    cursor: pointer;
}

.dssp-radio-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
/*    padding: 8px 0;*/
}

.dssp-radio-link:hover {
    text-decoration: none;
    color: #4a6f28;
}

.dssp-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.dssp-radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.dssp-radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 8px;
    height: 8px;
    background: #4a6f28;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.dssp-radio input:checked ~ .dssp-radio-mark {
    border-color: #4a6f28;
}

.dssp-radio input:checked ~ .dssp-radio-mark::after {
    transform: translate(-50%, -50%) scale(1);
}

.dssp-radio-text {
    font-size: 14px;
    color: #555;
}

.dssp-radio:hover .dssp-radio-mark {
    border-color: #4a6f28;
}

/* Custom radio mark */
.dssp-radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.dssp-radio-mark.checked,
.dssp-radio.active .dssp-radio-mark {
    border-color: #4a6f28;
}

.dssp-radio-mark.checked::after,
.dssp-radio.active .dssp-radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #4a6f28;
    border-radius: 50%;
}

.dssp-radio-link:hover .dssp-radio-mark {
    border-color: #4a6f28;
}

.dssp-radio-text {
    font-size: 14px;
    line-height: 1.4;
}

/* ========================================
   SORTING BAR
   ======================================== */
.dssp-sorting-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.dssp-sorting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.dssp-sorting-label i {
    color: #4a6f28;
}

.dssp-sorting-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dssp-sort-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dssp-sort-btn:hover {
    border-color: #4a6f28;
    color: #4a6f28;
}

.dssp-sort-btn.active {
    background: #4a6f28;
    border-color: #4a6f28;
    color: #fff;
}

/* ========================================
   PRODUCTS GRID
   ======================================== */
.dssp-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* ========================================
   PRODUCT CARD STYLES
   ======================================== */

/* Product Card Base */
.tt-product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.tt-product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.tt-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Product Image */
.tt-product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.tt-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tt-product-card:hover .tt-product-image img {
    transform: scale(1.05);
}

/* Product Discount Badge */
.tt-product-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #4a6f28;
    color: #fff;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

/* Product Actions (Icons) */
.tt-product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.tt-product-card:hover .tt-product-actions {
    opacity: 1;
    transform: translateX(0);
}

.tt-product-action {
    width: 32px;
    height: 32px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.tt-product-action:hover {
    background-color: #4a6f28;
    color: #fff;
}

/* Product Info */
.tt-product-info {
    padding: 15px;
}

.tt-product-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

/* Product Price */
.tt-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tt-product-price-current {
    font-size: 16px;
    font-weight: 700;
    color: #e74c3c;
}

.tt-product-price-old {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

/* Product Progress Bar */
.tt-product-progress {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin: 10px 0 8px;
    overflow: hidden;
}

.tt-product-progress-bar {
    height: 100%;
    background-color: #4a6f28;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Product Sold Text */
.tt-product-sold {
    font-size: 13px;
    color: #888;
}

/* ========================================
   PRODUCT GRID OVERRIDES
   ======================================== */
.dssp-products-grid .tt-product-card {
    flex: none;
    min-width: auto;
}

/* Hidden Products - Only show first 8 */
.dssp-products-grid .tt-product-card:nth-child(n+9) {
    display: none;
}

.dssp-products-grid.show-all .tt-product-card:nth-child(n+9) {
    display: block;
}

/* Hide Load More when all products are shown */
.dssp-load-more.hidden {
    display: none;
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */
.dssp-load-more {
    text-align: center;
    margin-top: 20px;
}

.dssp-load-more-btn {
    display: inline-block;
    padding: 14px 50px;
    background: #4a6f28;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 111, 40, 0.3);
}

.dssp-load-more-btn:hover {
    background: #3d5c21;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 40, 0.4);
}

/* ========================================
   SEO CONTENT SECTION
   ======================================== */
.dssp-seo-section {
    padding: 40px 0 60px;
    background: #f8f9fa;
}

.dssp-seo-content {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.dssp-seo-text {
    text-align: left;
}

.dssp-seo-text h2 {
    font-size: 24px;
    font-weight: 700;
    color: #4a6f28;
    margin-bottom: 15px;
}

.dssp-seo-text h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 25px 0 12px;
}

.dssp-seo-text p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.dssp-seo-text ul {
    list-style: inside;
    padding: 0;
    margin: 0 0 15px 0;
}

.dssp-seo-text ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

/*.dssp-seo-text ul li::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    color: #4a6f28;
    font-size: 12px;
}*/

.dssp-seo-text strong {
    color: #4a6f28;
}

/* Hidden SEO Content */
.dssp-seo-hidden {
    display: none;
    margin-top: 20px;
}

/* SEO Toggle Button */
.dssp-seo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 25px;
    background: transparent;
    border: 2px solid #4a6f28;
    border-radius: 25px;
    color: #4a6f28;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.dssp-seo-toggle:hover {
    background: #4a6f28;
    color: #fff;
}

.dssp-seo-toggle i {
    transition: transform 0.3s ease;
}


.tt-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tt-category-list li {
    border-bottom: 1px solid #e8f0e0;
}

.tt-category-list li:last-child {
    border-bottom: none;
}

.tt-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.tt-category-item:hover {
    color: #4a6f28;
}

.tt-category-item i {
    font-size: 12px;
    color: #aaa;
    transition: color 0.3s ease;
}

.tt-category-item:hover i {
    color: #4a6f28;
}

.dssp-products-grid .tt-product-card {
    display: block !important;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */
@media (max-width: 1199px) {
    .dssp-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .dssp-hero {
        height: 150px;
    }
    
    .dssp-hero-title {
        font-size: 28px;
    }
    
    .dssp-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .dssp-sidebar {
        position: static;
        margin-bottom: 30px;
    }
}

@media (max-width: 767px) {
    .dssp-hero {
        height: 120px;
        margin-bottom: 30px;
    }
    
    .dssp-hero-title {
        font-size: 24px;
    }
    
    .dssp-breadcrumb {
        font-size: 12px;
    }
    
    .dssp-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .dssp-sorting-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dssp-sorting-options {
        width: 100%;
    }
    
    .dssp-sort-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .dssp-seo-content {
        padding: 20px;
    }
    
    .dssp-seo-text h2 {
        font-size: 20px;
    }
    
    .dssp-seo-text h3 {
        font-size: 16px;
    }
    
    .dssp-seo-text p,
    .dssp-seo-text ul li {
        font-size: 14px;
    }
    
    .dssp-load-more-btn {
        padding: 12px 40px;
        font-size: 14px;
    }
}

@media (max-width: 575px) {
    .dssp-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .dssp-products-grid .tt-product-name {
        font-size: 13px;
        min-height: 36px;
    }
    
    .dssp-products-grid .tt-product-info {
        padding: 10px;
    }
    
    .dssp-products-grid .tt-product-price-current {
        font-size: 14px;
    }
    
    .dssp-products-grid .tt-product-price-old {
        font-size: 11px;
    }
    
    .dssp-sidebar-box {
        padding: 15px;
    }
    
    .dssp-sidebar-title {
        font-size: 16px;
    }
}

/* ========================================
   MOBILE FILTER DRAWER
   ======================================== */

/* Filter Toggle Button - ẩn trên desktop */
.dssp-filter-toggle {
    display: none;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    background: #4a6f28;
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 12px 10px;
    cursor: pointer;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    height: auto;
    box-sizing: border-box;
}

.dssp-filter-toggle:hover {
    background: #3d5c21;
}

.dssp-filter-toggle i {
    font-size: 18px;
}

.dssp-filter-toggle span {
    font-size: 11px;
    font-weight: 500;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Filter Overlay */
.dssp-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dssp-filter-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Close Button - ẩn trên desktop */
.dssp-sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: all 0.3s ease;
    z-index: 10;
}

.dssp-sidebar-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* Mobile & Tablet Responsive - Dưới 991px */
@media (max-width: 991px) {
    /* Hiển thị nút filter toggle */
    .dssp-filter-toggle {
        display: flex;
    }
    
    /* Ẩn sidebar column mặc định */
    .dssp-sidebar-col {
        position: fixed;
        top: 0;
        right: -350px;
        width: 300px;
        height: 100vh;
        max-width: 85vw;
        z-index: 1001;
        background: #fff;
        padding: 20px;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    
    .dssp-sidebar-col.active {
        right: 0;
    }
    
    /* Hiển thị nút đóng */
    .dssp-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Reset sidebar style trong drawer */
    .dssp-sidebar-col .dssp-sidebar {
        position: static;
        margin-bottom: 0;
        padding-top: 40px;
    }
    
    .dssp-sidebar-col .dssp-sidebar-box {
        margin-bottom: 15px;
    }
    
    /* Đảm bảo content chiếm toàn bộ */
    .dssp-sidebar-col + .col-lg-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Tablet - 768px đến 991px */
@media (min-width: 768px) and (max-width: 991px) {
    .dssp-sidebar-col {
        width: 350px;
    }
    
    .dssp-filter-toggle {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        right: 0 !important;
        padding: 15px 12px;
    }
    
    .dssp-filter-toggle i {
        font-size: 20px;
    }
}

/* Mobile - Dưới 767px */
@media (max-width: 767px) {
    .dssp-filter-toggle {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        right: 0 !important;
        padding: 10px 8px;
    }
    
    .dssp-filter-toggle i {
        font-size: 16px;
    }
    
    .dssp-filter-toggle span {
        font-size: 9px;
    }
    
    .dssp-sidebar-col {
        width: 280px;
        padding: 15px;
    }
}
