/* ============================================================
   CSS สำหรับ Archive Product Reviews (Card Grid Layout)
   Version: 1.3.0
   
   วิธีใช้งาน:
   เพิ่มโค้ดนี้ต่อท้าย affiliate-review-styles.css
   หรือวางใน Customizer > Additional CSS
   
   ============================================================ */

/* ==================== Global Styles ==================== */
.product-reviews-archive {
    background: #FAFAFA;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== Archive Hero ==================== */
.archive-hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
    padding: 3rem 0 2rem;
    margin-bottom: 3rem;
}

.archive-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: #2C3E50;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.archive-subtitle {
    font-size: 1.125rem;
    color: #6C757D;
    text-align: center;
    margin: 0 0 2rem 0;
}

.archive-description {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    color: #6C757D;
}

/* ==================== Category Filter ==================== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #2C3E50;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-btn:hover {
    background: #2ECC40;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 64, 0.3);
}

.filter-btn.active {
    background: #2ECC40;
    color: white;
    box-shadow: 0 4px 12px rgba(46, 204, 64, 0.3);
}

.filter-btn .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== Products Section ==================== */
.products-section {
    padding: 2rem 0 4rem;
}

/* ==================== Products Grid ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

/* ==================== Product Card ==================== */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Product Image */
.product-card .product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-card .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
}

.product-card .no-image span {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.5rem 1rem;
    background: rgba(46, 204, 64, 0.95);
    color: white;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 20px;
    backdrop-filter: blur(8px);
}

/* Rating Badge */
.rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    font-weight: 700;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.rating-badge .star {
    font-size: 1rem;
}

.rating-badge .score {
    color: #2ECC40;
    font-size: 0.9375rem;
}

/* Product Info */
.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    background: #fff;
}

.product-brand .brand-label {
    padding: 0.35rem 0.6rem;
    background: #64748b;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-brand .brand-name {
    padding: 0.35rem 0.75rem;
    color: #334155;
    font-weight: 600;
    background: #f8fafc;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    min-height: 3.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: #2C3E50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #2ECC40;
}

.product-excerpt {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    min-height: 2.625rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Chemical Badge in Card */
.product-chemical-badge {
    margin-bottom: 0.75rem;
}

/* Product Footer */
.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: auto;
    flex-wrap: nowrap;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.price-amount {
    font-size: 1.375rem;
    font-weight: 900;
    color: #f57c00;
    white-space: nowrap;
}

/* Product Actions */
.product-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.quick-buy {
    display: flex;
    gap: 0.5rem;
}

.quick-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.125rem;
    text-decoration: none;
    transition: all 0.3s ease;
    color: white;
}

.quick-buy-btn.tiktok {
    background: #000;
}

.quick-buy-btn.shopee {
    background: #EE4D2D;
}

.quick-buy-btn.lazada {
    background: #F57224;
}

.quick-buy-btn:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

/* ==================== Pagination ==================== */
.archive-pagination {
    margin: 3rem 0;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    background: white;
    color: #2C3E50;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.page-numbers:hover {
    background: #2ECC40;
    color: white;
}

.page-numbers.current {
    background: #2ECC40;
    color: white;
}

/* ==================== No Products ==================== */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.no-products .icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
}

.no-products h2 {
    font-size: 1.75rem;
    color: #2C3E50;
    margin: 0 0 0.5rem 0;
}

.no-products p {
    color: #6c757d;
    margin-bottom: 2rem;
}

.btn-home {
    display: inline-flex;
    padding: 0.75rem 2rem;
    background: #2ECC40;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-home:hover {
    background: #27AE60;
}

/* ==================== CTA Section ==================== */
.cta-section {
    background: linear-gradient(135deg, #2ECC40 0%, #27AE60 100%);
    padding: 4rem 0;
    margin-top: 4rem;
}

.cta-content {
    text-align: center;
    color: white;
}

.cta-content h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 0 0 1rem 0;
}

.cta-content p {
    font-size: 1.125rem;
    margin: 0 0 2rem 0;
    opacity: 0.95;
}

.btn-cta {
    display: inline-flex;
    padding: 1rem 2.5rem;
    background: white;
    color: #2ECC40;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ==================== Breadcrumb ==================== */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: #6c757d;
}

.breadcrumb a {
    color: #2ECC40;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
}

.breadcrumb .current {
    color: #2C3E50;
}

/* ==================== Related Products ==================== */
.related-products {
    padding: 3rem 0;
    background: white;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.related-card a {
    display: block;
    text-decoration: none;
}

.related-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.related-card h3 {
    padding: 1rem;
    font-size: 1rem;
    color: #2C3E50;
    margin: 0;
}

.related-card .view-review {
    display: block;
    padding: 0 1rem 1rem;
    color: #2ECC40;
    font-weight: 600;
}

/* ==================== Responsive Design ==================== */

/* Mobile Default - 2 columns */
.products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.product-card .product-image {
    aspect-ratio: 1 / 1;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .archive-hero {
        padding: 2rem 0 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .archive-title {
        font-size: 1.5rem;
    }
    
    .archive-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }
    
    .category-filter {
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .filter-btn .count {
        min-width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }
    
    .products-section {
        padding: 1rem 0 2rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    /* Card Mobile */
    .product-card {
        border-radius: 10px;
    }
    
    .product-info {
        padding: 0.75rem;
    }
    
    /* Brand Badge Mobile */
    .product-brand {
        font-size: 0.6875rem;
        margin-bottom: 0.5rem;
    }
    
    .product-brand .brand-label {
        padding: 0.25rem 0.4rem;
        font-size: 0.625rem;
    }
    
    .product-brand .brand-name {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    /* Chemical Badge Mobile */
    .product-chemical-badge {
        margin-bottom: 0.5rem;
    }
    
    .product-chemical-badge > a,
    .product-chemical-badge > span {
        font-size: 9px !important;
    }
    
    /* Title Mobile */
    .product-title {
        font-size: 0.875rem;
        min-height: 2.45rem;
        margin-bottom: 0.5rem;
    }
    
    /* Category Badge Mobile */
    .category-badge {
        top: 8px;
        left: 8px;
        padding: 0.3rem 0.6rem;
        font-size: 0.6875rem;
    }
    
    /* Rating Badge Mobile */
    .rating-badge {
        top: 8px;
        right: 8px;
        padding: 0.3rem 0.5rem;
    }
    
    .rating-badge .star {
        font-size: 0.75rem;
    }
    
    .rating-badge .score {
        font-size: 0.75rem;
    }
    
    /* Footer Mobile */
    .product-footer {
        padding-top: 0.75rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .product-price {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.25rem;
    }
    
    .price-amount {
        font-size: 1.125rem;
    }
    
    .product-actions {
        width: 100%;
        justify-content: center;
    }
    
    .quick-buy {
        gap: 0.4rem;
    }
    
    .quick-buy-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9375rem;
        border-radius: 8px;
    }
    
    .quick-buy-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Small Mobile (< 375px) */
@media (max-width: 374px) {
    .products-grid {
        gap: 0.5rem;
    }
    
    .product-info {
        padding: 0.5rem;
    }
    
    .product-title {
        font-size: 0.8125rem;
    }
    
    .price-amount {
        font-size: 1rem;
    }
    
    .quick-buy-btn {
        width: 32px;
        height: 32px;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    
    .archive-hero {
        padding: 2.5rem 0 2rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .price-amount {
        font-size: 1.25rem;
    }
    
    .quick-buy-btn {
        width: 38px;
        height: 38px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    
    .product-info {
        padding: 1.25rem;
    }
    
    .product-title {
        font-size: 1.125rem;
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .products-grid {
        gap: 2rem;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .category-filter,
    .cta-section,
    .quick-buy,
    .btn-view-review {
        display: none;
    }
}

/* ============================================================
   END OF STYLESHEET
   ============================================================ */

/* Quick Buy TikTok Button */
.quick-buy-btn.tiktok {
    background: linear-gradient(135deg, #000000 0%, #fe2c55 100%);
    color: white;
}

.quick-buy-btn.tiktok:hover {
    background: linear-gradient(135deg, #fe2c55 0%, #000000 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(254, 44, 85, 0.4);
}

.quick-buy-btn.tiktok svg {
    width: 16px;
    height: 16px;
}
