/* ============================================================
   CSS สำหรับ Template: รีวิวสินค้าเกษตร (Affiliate Review)
   Version: 1.0.0
   
   วิธีใช้งาน:
   1. คัดลอกโค้ดทั้งหมดนี้
   2. วางใน: Appearance > Customize > Additional CSS
   หรือ
   3. เพิ่มลงในไฟล์ style.css ของ theme
   
   ============================================================ */

/* ==================== Global Variables ==================== */
:root {
    --color-primary: #2ECC40;        /* สีเขียวเกษตร */
    --color-secondary: #27AE60;      /* สีเขียวเข้ม */
    --color-accent: #FF6B6B;         /* สีแดง (สำหรับ CTA) */
    --color-tiktok: #000000;         /* TikTok สีดำ */
    --color-shopee: #EE4D2D;         /* Shopee สีส้ม */
    --color-lazada: #0F156D;         /* Lazada สีน้ำเงินเข้ม */
    --color-facebook: #1877F2;       /* Facebook สีน้ำเงิน */
    --color-text: #2C3E50;           /* สีข้อความ */
    --color-text-light: #6C757D;     /* สีข้อความอ่อน */
    --color-bg: #FFFFFF;             /* พื้นหลังขาว */
    --color-bg-light: #F8F9FA;       /* พื้นหลังอ่อน */
    --color-border: #DEE2E6;         /* สีเส้นขอบ */
    --color-success: #28A745;        /* สีเขียว (ข้อดี) */
    --color-warning: #FFC107;        /* สีเหลือง (คำเตือน) */
    --color-danger: #DC3545;         /* สีแดง (ข้อเสีย) */
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ==================== Reset & Base ==================== */
.affiliate-review-template {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    line-height: 1.7;
}

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

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
}

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

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

/* รูปสินค้า */
.product-image {
    width: 100%;
    position: relative;
    background: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.no-image {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-light);
    color: var(--color-text-light);
}

.no-image span {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ข้อมูลสินค้า */
.product-summary {
    background: var(--color-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.product-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px dashed var(--color-border);
}

.brand {
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* Brand Link (Clickable) */
.brand-link {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px dashed var(--color-primary);
}

.brand-link:hover {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
    transform: translateX(2px);
}

.product-meta .brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.spec-value .brand-link {
    display: inline-block;
    font-weight: 600;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.star {
    font-size: 1.25rem;
}

.star.empty {
    opacity: 0.3;
}

.rating-number {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-left: 0.5rem;
}

/* Price Box */
.price-box {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #ffb74d;
}

.price-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.price-amount {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 900;
    color: #f57c00;
}

/* CTA Buttons */
.cta-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
    text-align: center;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-btn:hover::before {
    width: 300px;
    height: 300px;
}

.cta-btn svg {
    position: relative;
    z-index: 1;
}

.cta-btn:active {
    transform: scale(0.98);
}

/* TikTok Button */
.btn-tiktok {
    background: linear-gradient(135deg, #000000 0%, #2C2C2C 100%);
    color: #FFFFFF;
}

.btn-tiktok:hover {
    background: linear-gradient(135deg, #2C2C2C 0%, #000000 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Shopee Button */
.btn-shopee {
    background: linear-gradient(135deg, #EE4D2D 0%, #FF6B39 100%);
    color: #FFFFFF;
}

.btn-shopee:hover {
    background: linear-gradient(135deg, #FF6B39 0%, #EE4D2D 100%);
    box-shadow: 0 6px 20px rgba(238, 77, 45, 0.4);
    transform: translateY(-2px);
}

/* Lazada Button */
.btn-lazada {
    background: linear-gradient(135deg, #0F156D 0%, #1A1F8C 100%);
    color: #FFFFFF;
}

.btn-lazada:hover {
    background: linear-gradient(135deg, #1A1F8C 0%, #0F156D 100%);
    box-shadow: 0 6px 20px rgba(15, 21, 109, 0.4);
    transform: translateY(-2px);
}

/* Facebook Button */
.btn-facebook {
    background: linear-gradient(135deg, #1877F2 0%, #3B8BF7 100%);
    color: #FFFFFF;
}

.btn-facebook:hover {
    background: linear-gradient(135deg, #3B8BF7 0%, #1877F2 100%);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.4);
    transform: translateY(-2px);
}

/* Large CTA Buttons */
.btn-large {
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
}

.cta-bottom {
    margin-top: 2rem;
    margin-bottom: 0;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--color-bg-light);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

/* ==================== Specs Table ==================== */
.product-specs {
    padding: 3rem 0;
    background: var(--color-bg);
}

.specs-table {
    background: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.spec-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-row:nth-child(even) {
    background: var(--color-bg-light);
}

.spec-label {
    font-weight: 700;
    color: var(--color-text);
}

.spec-value {
    color: var(--color-text-light);
}

/* ==================== Pros & Cons ==================== */
.pros-cons {
    padding: 3rem 0;
    background: var(--color-bg-light);
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.pros-box,
.cons-box {
    background: var(--color-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.pros-box {
    border-top: 4px solid var(--color-success);
}

.cons-box {
    border-top: 4px solid var(--color-danger);
}

.box-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pros-box .box-title {
    color: var(--color-success);
}

.cons-box .box-title {
    color: var(--color-danger);
}

.pros-list,
.cons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros-list li,
.cons-list li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.pros-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: 900;
    font-size: 1.25rem;
}

.cons-list li::before {
    content: '!';
    position: absolute;
    left: 0;
    color: var(--color-danger);
    font-weight: 900;
    font-size: 1.25rem;
    background: var(--color-danger);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.pros-list li:not(:last-child),
.cons-list li:not(:last-child) {
    border-bottom: 1px dashed var(--color-border);
}

/* ==================== Main Content ==================== */
.review-content {
    padding: 3rem 0;
    background: var(--color-bg);
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.content-wrapper h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--color-text);
}

.content-wrapper h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--color-text);
}

.content-wrapper p {
    margin-bottom: 1.5rem;
}

.content-wrapper ul,
.content-wrapper ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.content-wrapper li {
    margin-bottom: 0.5rem;
}

.content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

/* ==================== Verdict & Rating ==================== */
.review-verdict {
    padding: 3rem 0;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
}

.verdict-card {
    background: var(--color-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--color-primary);
}

.verdict-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 2rem;
    text-align: center;
}

.rating-breakdown {
    margin-bottom: 2rem;
}

.rating-item {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.rating-label {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9375rem;
}

.rating-bar {
    height: 12px;
    background: var(--color-bg-light);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 6px;
    transition: width 1s ease;
}

.rating-value {
    font-weight: 700;
    color: var(--color-primary);
    text-align: right;
    font-size: 0.9375rem;
}

/* Overall Rating */
.overall-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.overall-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.overall-score {
    font-size: 3rem;
    font-weight: 900;
    color: white;
}

.overall-score small {
    font-size: 1.5rem;
    opacity: 0.8;
}

/* ==================== FAQ Accordion ==================== */
.review-faq {
    padding: 3rem 0;
    background: var(--color-bg);
}

.faq-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-bg);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: var(--color-bg);
    border: none;
    text-align: left;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--color-bg-light);
}

.faq-question.active {
    background: var(--color-primary);
    color: white;
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 700;
    transition: var(--transition);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.active {
    max-height: 500px;
}

.faq-answer p {
    padding: 1.5rem;
    margin: 0;
    color: var(--color-text-light);
    line-height: 1.7;
    background: var(--color-bg-light);
}

/* ==================== Responsive Design (Tablet) ==================== */
@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .cta-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pros-cons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .rating-item {
        grid-template-columns: 180px 1fr 70px;
    }
}

/* ==================== Responsive Design (Desktop) ==================== */
@media (min-width: 1024px) {
    .review-container {
        padding: 0 40px;
    }
    
    .product-image img {
        aspect-ratio: 4 / 3;
    }
    
    .spec-row {
        grid-template-columns: 250px 1fr;
    }
    
    .cta-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .cta-buttons,
    .trust-badges,
    .faq-accordion {
        display: none;
    }
}

/* ==================== Accessibility ==================== */
.cta-btn:focus,
.faq-question:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==================== Animation ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-summary,
.pros-box,
.cons-box,
.verdict-card,
.faq-item {
    animation: fadeInUp 0.6s ease;
}

/* ==================== Loading State ==================== */
.rating-fill {
    position: relative;
    overflow: hidden;
}

.rating-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* ==================== Utility Classes ==================== */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }

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