/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a1a2e;
    --accent-color: #e94560;
    --success-color: #27ae60;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #fff;
}

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

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Header ===== */
.header {
    background: var(--primary-color);
    color: #fff;
    padding: 12px 0;
}

.header-content {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.trust-badge {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ===== Main Product Section ===== */
.main-content {
    padding: 40px 0;
}

.main-content .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

@media (max-width: 768px) {
    .main-content .container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .reviews-header {
        flex-direction: column;
        gap: 25px;
        padding: 25px;
    }

    .reviews-score-card {
        width: 100%;
        min-width: auto;
        padding: 20px;
        flex-direction: row;
        gap: 15px;
    }

    .reviews-score-card .big-rating {
        font-size: 40px;
    }

    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* ===== Product Gallery ===== */
.product-gallery {
    position: sticky;
    top: 20px;
}

.main-image {
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.thumbnail {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--accent-color);
}

/* ===== Product Info ===== */
.product-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.product-rating {
    margin-bottom: 15px;
}

.stars {
    color: #ffc107;
    letter-spacing: 2px;
}

.rating-text {
    color: var(--text-light);
    margin-left: 10px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.current-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-color);
}

.original-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
}

.discount-badge {
    background: var(--success-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.product-description {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 15px;
}

.product-features {
    list-style: none;
    margin-bottom: 25px;
}

.product-features li {
    padding: 8px 0;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-features li::before {
    content: "✓";
    color: var(--success-color);
    font-weight: bold;
}

/* ===== Buy Buttons ===== */
.buy-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: #d63850;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--primary-color);
    color: #fff;
}

.btn-secondary:hover {
    background: #2a2a4e;
    transform: translateY(-2px);
}

/* ===== Purchase Terms ===== */
.purchase-terms {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.purchase-terms p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.purchase-terms p:last-child {
    margin-bottom: 0;
}

.purchase-terms a {
    color: var(--accent-color);
}

/* ===== Trust Icons ===== */
.trust-icons {
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.trust-item {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.trust-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

/* ===== Product Details Tabs ===== */
.product-details {
    background: var(--bg-light);
    padding: 40px 0;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin-bottom: 15px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.specs-table td:first-child {
    font-weight: 600;
    width: 40%;
}

.tab-content ul {
    margin-left: 20px;
    margin-top: 10px;
}

.tab-content li {
    margin-bottom: 8px;
}

/* ===== Reviews Section ===== */
.reviews-section {
    padding: 70px 0;
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
}

.section-title {
    text-align: left;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 20px 0;
}

.reviews-header {
    display: flex;
    align-items: stretch;
    gap: 50px;
    background: #fff;
    padding: 35px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 45px;
}

.reviews-title-area {
    flex: 1;
}

.rating-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bar-label {
    font-size: 13px;
    color: #666;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107, #ff9800);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.bar-count {
    font-size: 13px;
    color: #999;
    width: 28px;
    text-align: left;
    flex-shrink: 0;
}

.reviews-score-card {
    width: 160px;
    min-width: 160px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 25px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4e 100%);
    border-radius: 16px;
    color: #fff;
}

.reviews-score-card .big-rating {
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.reviews-score-card .stars {
    font-size: 18px;
    letter-spacing: 2px;
    color: #ffc107;
    margin: 8px 0 6px;
    display: block;
}

.score-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin: 0;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.review-card {
    background: #fff;
    border: none;
    border-radius: 14px;
    padding: 22px 18px;
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.reviewer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.reviewer-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.reviewer-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-dark);
}

.verified-badge {
    color: var(--success-color);
    font-size: 11px;
    font-weight: 500;
}

.review-stars {
    color: #ffc107;
    font-size: 13px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.review-date {
    color: #bbb;
    font-size: 11px;
    margin-bottom: 8px;
}

.review-text {
    color: #555;
    line-height: 1.65;
    font-size: 13px;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-images {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.review-images:has(img:first-child:nth-last-child(1)) {
    grid-template-columns: 1fr;
}

.review-images:has(img:first-child:nth-last-child(2)),
.review-images:has(img:first-child:nth-last-child(2)) ~ * {
    grid-template-columns: 1fr 1fr;
}

.review-images:has(img:first-child:nth-last-child(3)),
.review-images:has(img:first-child:nth-last-child(3)) ~ *,
.review-images:has(img:first-child:nth-last-child(n+3)) {
    grid-template-columns: 1fr 1fr 1fr;
}

.review-img {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.review-helpful {
    text-align: right;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
}

.helpful-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 11px;
    color: #888;
    cursor: pointer;
    transition: all 0.25s;
}

.helpful-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-color);
    color: #fff;
    padding: 50px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section p,
.footer-section li {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-bottom: 5px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .product-title {
        font-size: 22px;
    }
    
    .current-price {
        font-size: 28px;
    }
    
    .buy-buttons {
        flex-direction: column;
    }
    
    .thumbnail-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .trust-icons {
        flex-direction: column;
        gap: 15px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }

    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}
