@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700;800&display=swap');


:root {
    --primary-color: #2E86AB;
    --secondary-color: #A23B72;
    --accent-color: #F18F01;
    --text-primary: #19457B;
    --text-secondary: #666666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'SVN-Gilroy', sans-serif;
}

/* Page Header - REVISED */
.page-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Center align items vertically */
    margin-bottom: 40px;
    padding: 20px 0;
}

.page-title-container {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-family: 'Baloo 2', sans-serif;
    font-size: 44px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.results-count {
    font-family: 'Baloo 2', sans-serif;
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0;
}

/* Search and Filter Bar - REVISED */
.search-filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-container {
    position: relative;
}

.search-input {
    width: 250px; /* Desktop default */
    min-width: 200px;
    max-width: 100%;
    height: 50px;
    padding: 0 0 0 15px;
    border: 2px solid #F3F3F4;
    background-color: #F3F3F4;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    font-family: 'SVN-Gilroy', sans-serif;
    box-sizing: border-box; /* Important! */
}

.search-input::placeholder {
    font-family: 'SVN-Gilroy', sans-serif;
    color: #B3B1B8;
    font-weight: 600;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    pointer-events: none;
    user-select: none;
}

.sort-dropdown {
    height: 50px;
    width: 250px; /* Desktop default */
    min-width: 200px;
    max-width: 100%;
    padding: 0 35px 0 15px;
    border: 2px solid #F3F3F4;
    border-radius: var(--border-radius);
    font-size: 14px;
    background: #F3F3F4 url('data:image/svg+xml;charset=US-ASCII,<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m19 9-7 7-7-7"/></svg>') no-repeat right 15px center;
    background-size: 12px;
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    font-family: 'SVN-Gilroy', sans-serif;
    font-weight: 600;
    box-sizing: border-box; /* Important! */
}

.sort-dropdown:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.1);
}

.search-label, .sort-label {
    font-family: 'SVN-Gilroy', sans-serif;
    font-size: 12px;
    color: #8C8A94;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 40px;
    margin-bottom: 60px;
}

/* Product Card */
.product-card {
    position: relative;
    width: 100%;
    height: 360px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 4px solid rgba(217, 216, 220, 1);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}


.product-card:hover .product-overlay {
    background: rgba(6, 29, 57, 1); /* Tăng opacity lên 100% khi hover */
}

.product-card:hover .arrow-icon {
    opacity: 1; /* Hiện icon khi hover */
    transform: translateX(0);
}

.product-image {
    width: 100%;
    height: 360px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.product-overlay {
    position: absolute;
    bottom: 4px;
    left: 12px;
    right: 12px;
    width: calc(100% - 60px);
    height: 82px;
    background: rgba(6, 29, 57, 0.8);
    border-radius: var(--border-radius);
    border: 1px solid #FFFFFFCC;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.3s ease;
}

.product-title {
    font-family: 'Baloo 2', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-description {
    font-family: sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

/* Arrow Icon */
.arrow-icon {
    position: absolute;
    right: 16px;
    transform: translateY(-50%) translateX(10px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    width: 24px;
    height: 24px;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow-icon svg {
    width: 24px;
    height: 24px;
}

/* Điều chỉnh vị trí của product-title để tạo không gian cho arrow-icon */
.product-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* No Products Found */
.no-products {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin: 40px 0;
}

.no-products h3 {
    font-size: 24px;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-weight: 600;
}

.no-products p {
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

/* Focus styles for accessibility */
.product-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.search-input:focus,
.sort-dropdown:focus {
    outline: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
        padding: 0 24px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px 30px;
    }
    
    /* Search/sort responsive */
    .search-input,
    .sort-dropdown {
        width: 200px;
        min-width: 180px;
    }
    
    .page-header-container {
        gap: 20px;
    }
    
    .search-filter-bar {
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px 20px;
    }
    
    .product-card {
        height: 350px;
    }
    
    .product-image {
        height: 350px;
    }
    
    /* Stack search/sort on smaller tablets */
    .page-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .search-filter-bar {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-input,
    .sort-dropdown {
        width: 48%;
        min-width: 250px;
    }
}

/* Responsive search-filter-bar */
@media (max-width: 1024px) {
    .search-filter-bar {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .search-container,
    .sort-container {
        width: 100%;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .search-filter-bar {
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    /* Header stack vertical */
    .page-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        margin-bottom: 30px;
    }
    
    .page-title {
        font-size: 32px;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .results-count {
        font-size: 15px;
    }
    
    /* Search/sort full width stack */
    .search-filter-bar {
        flex-direction: column;
        gap: 16px;
        width: 100%;
        align-items: stretch;
    }

    /* Search and Filter Bar - RESPONSIVE FIX */
    .search-filter-bar {
        display: flex;
        align-items: flex-end; /* Align to bottom của labels */
        gap: 15px;
        flex-wrap: wrap; /* Allow wrap on small screens */
    }

    .search-container,
    .sort-container {
        display: flex;
        flex-direction: column;
        flex: 0 0 auto; /* Don't grow/shrink */
    }
    
    .search-container,
    .sort-container {
        width: 100%;
    }
    
    .search-input,
    .sort-dropdown {
        width: 100% !important; /* Force full width */
        min-width: auto;
        max-width: none;
        height: 50px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* Grid 2 cột */
    .products-grid {
<<<<<<< HEAD
        grid-template-columns: repeat(3, 1fr);
=======
        grid-template-columns: repeat(2, 1fr);
>>>>>>> origin/sang1310
        gap: 16px 12px;
        margin-bottom: 40px;
    }
    
    .product-card {
        touch-action: manipulation;
        cursor: pointer;
    }
    
    
    .product-overlay {
        bottom: 3px;
        left: 8px;
        right: 8px;
        width: calc(100% - 40px);
        height: 65px;
        padding: 12px;
    }
    
    .product-title {
        font-size: 16px;
        line-height: 1.1;
    }
    
    .product-description {
        font-size: 12px;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }
    
    .arrow-icon {
        width: 18px;
        height: 18px;
        right: 10px;
    }
    
    .arrow-icon svg {
        width: 18px;
        height: 18px;
    }
    
    /* Touch feedback */
    .product-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .product-card:active .product-overlay {
        background: rgba(6, 29, 57, 1);
    }
    
    .product-card:active .arrow-icon {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }
    
    .page-header-container {
        margin-bottom: 24px;
        padding: 12px 0;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .search-filter-bar {
        gap: 14px;
    }
    
    /* Full width inputs - IMPORTANT! */
    .search-input,
    .sort-dropdown {
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        height: 50px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* Grid 1 cột */
    .products-grid {
        grid-template-columns: 2fr;
        gap: 16px;
        margin-bottom: 30px;
        
    }
    
    .product-card {
        height: 400px;
        border: 3px solid rgba(217, 216, 220, 1);
        max-width: none;
        margin: 0;
    }
    
    .product-image{
        height: 100%;
    }
    
    .product-overlay {
        bottom: 2px;
        left: 6px;
        right: 6px;
        width: calc(100% - 30px);
        height: 60px;
        padding: 10px;
    }
    
    .product-title {
        font-size: 15px;
    }
    
    .product-description {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }
    
    .arrow-icon {
        width: 16px;
        height: 16px;
        right: 8px;
    }
    
    .arrow-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .no-products {
        padding: 40px 12px;
        margin: 20px 0;
    }
    
    .no-products h3 {
        font-size: 20px;
    }
    
    .no-products p {
        font-size: 14px;
    }
}

/* ===== BỔ SUNG THÊM - Paste vào cuối file ===== */

/* Extra small mobile */
@media (max-width: 320px) {
    .container {
        padding: 0 8px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .search-input,
    .sort-dropdown {
        height: 48px;
        font-size: 15px;
    }
    
    .product-card {
        height: 220px;
        border: 2px solid rgba(217, 216, 220, 1);
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-overlay {
        height: 55px;
        padding: 8px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-description {
        font-size: 10px;
    }
}

/* Mobile landscape */
@media (max-width: 768px) and (max-height: 500px) and (orientation: landscape) {
    .page-header-container {
        margin-bottom: 16px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    /* Search horizontal on landscape */
    .search-filter-bar {
        flex-direction: row;
        gap: 12px;
    }
    
    .search-container,
    .sort-container {
        width: 48%;
    }
    
    /* 3 columns on landscape */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .product-card {
        height: 160px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-overlay {
        height: 45px;
        padding: 6px;
    }
    
    .product-title {
        font-size: 12px;
    }
    
    .product-description {
        font-size: 9px;
        -webkit-line-clamp: 1;
    }
}

/* Large desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1200px;
        padding: 0 40px;
    }
    
    .products-grid {
        gap: 40px;
    }
}

/* Better focus states */
.product-card:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

.search-input:focus-visible,
.sort-dropdown:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(46, 134, 171, 0.1);
}

/* High contrast support */
@media (prefers-contrast: high) {
    .product-card {
        border-width: 3px;
        border-color: #000;
    }
    
    .product-overlay {
        background: rgba(0, 0, 0, 0.95);
        border-color: #fff;
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .product-card {
        animation: none !important;
    }
    
    .product-overlay,
    .arrow-icon,
    .product-card {
        transition: none !important;
    }
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
    /* This targets touch devices */
    .product-card {
        min-height: 240px;
        touch-action: manipulation;
    }
    
    /* Larger touch targets */
    .search-input,
    .sort-dropdown {
        min-height: 50px;
        touch-action: manipulation;
    }
}

/* Print styles */
@media print {
    .search-filter-bar {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .product-card {
        break-inside: avoid;
        border: 1px solid var(--border-color);
    }
<<<<<<< HEAD
=======
}

/* ================================================================
   SIDEBAR FILTER - COLLAPSE TỪ DƯỚI LÊN TRÊN
   Paste vào CUỐI file: assets/css/product-listing.css
   ================================================================ */

/* Wrapper chính */
.product-page-wrapper {
    display: flex;
    gap: 0;
    align-items: flex-start;
    margin-top: 20px;
}

/* ========== SIDEBAR ========== */
.product-filter-sidebar {
    width: 280px;
    flex-shrink: 0;
    /* background: #ffffff; */
    /* border: 2px solid #e0e0e0; */
    /* border-radius: 12px; */
    overflow: hidden;
}

/* Sidebar Header - LUÔN HIỂN THỊ */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    /* border-bottom: 2px solid #e0e0e0; */
    /* background: #f8f9fa; */
}

.sidebar-title {
    font-family: 'Baloo 2', sans-serif;
    font-size: 20px;
    font-weight: 800;
    /* color: #19457B; */
    margin: 0;
}

/* Toggle Button */
.sidebar-toggle {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    /* color: white; */
    /* border-radius: 6px; */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    /* background: #19457B; */
    /* transform: scale(1.1); */
}

.toggle-icon {
    display: inline-block;
    line-height: 1;
}

/* ========== SIDEBAR CONTENT - COLLAPSE ANIMATION ========== */
.sidebar-content {
    max-height: 500px; /* Đủ cao cho nội dung */
    overflow: hidden;
    padding: 20px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

/* COLLAPSED STATE - Ẩn từ dưới lên */
.product-filter-sidebar.collapsed .sidebar-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* ========== FILTER FORM ========== */
.category-filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Filter Item */
.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.filter-item:hover {
    background: #f8f9fa;
}

/* Checkbox */
.category-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2E86AB;
}

/* Filter Label */
.filter-label {
    font-family: 'SVN-Gilroy', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-count {
    color: #666;
    font-size: 14px;
}

/* Clear Filters Button */
.clear-filters-btn {
    padding: 10px 16px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-family: 'SVN-Gilroy', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.clear-filters-btn:hover {
    background: #fdd;
    border-color: #faa;
}

/* ========== MAIN CONTENT AREA ========== */
.product-main-area {
    flex: 1;
    min-width: 0;
    margin-left: 30px;
    width: 100%;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .product-page-wrapper {
        flex-direction: column;
    }
    
    .product-filter-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .product-main-area {
        margin-left: 0;
    }
    
    /* Horizontal layout cho filters trên tablet */
    .filter-group {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .filter-item {
        flex: 0 0 auto;
        padding: 8px 12px;
        background: #f8f9fa;
        border-radius: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-title {
        font-size: 16px;
    }
    
    .sidebar-toggle {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .sidebar-content {
        padding: 16px;
    }
    
    .filter-item {
        padding: 8px;
    }
    
    .filter-label {
        font-size: 14px;
    }
}

/* ================================================================
   ĐIỀU CHỈNH PRODUCTS GRID KHI CÓ SIDEBAR
   ================================================================ */

/* Desktop - 3 cột vì có sidebar */
@media (min-width: 1200px) {
    .product-page-wrapper .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktop - 4 cột */
@media (min-width: 1600px) {
    .product-page-wrapper .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
>>>>>>> origin/sang1310
}