﻿/* =============================================
   Compare Page Styles
   ============================================= */

.compare-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    z-index: 1050;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 177, 79, 0.08);
}

body.compare-page {
    padding-top: 80px;
    background: #f8faf9;
}

.compare-header h2 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin: 0;
}

.compare-header .btn-home {
    border-radius: 50px;
    font-weight: 600;
    padding: 8px 20px;
    background: #00b14f;
    border: none;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;
}

.compare-header .btn-home:hover {
    background: #0a8f3d;
    color: white;
}

/* Search */
.compare-search {
    max-width: 640px;
    margin: 0 auto 32px;
    background: white;
    border-radius: 60px;
    padding: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
}

.compare-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-size: 15px;
    outline: none;
    border-radius: 60px;
}

.compare-search .btn-search {
    background: #00b14f;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.compare-search .btn-search:hover {
    background: #0a8f3d;
}

/* Product Card */
.product-summary {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 28px;
    margin-bottom: 32px;
    border: none;
}

.product-summary img {
    max-height: 160px;
    object-fit: contain;
    border-radius: 12px;
    background: #f9fafb;
    padding: 8px;
}

.product-summary h3 {
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: 8px;
}

.product-category-tag {
    display: inline-block;
    background: #e8f8ef;
    color: #0a8f3d;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

/* Comparison Table */
.compare-table-wrap {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 32px;
}

.compare-table {
    margin: 0;
}

.compare-table thead {
    background: linear-gradient(135deg, #e8f8ef, #d4f5e2);
}

.compare-table thead th {
    font-weight: 600;
    font-size: 14px;
    color: #0a8f3d;
    padding: 16px 12px;
    text-align: center;
    border: none;
}

.compare-table tbody td {
    padding: 16px 12px;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    border-color: #f0f0f0;
}

.compare-table tbody tr {
    transition: 0.2s;
}

.compare-table tbody tr:hover {
    background: #fafffe;
}

.compare-table tbody tr.best-row {
    background: #f0fdf4;
}

.compare-table tbody tr.best-row td:first-child {
    border-left: 4px solid #00b14f;
}

.price-cell {
    font-size: 18px;
    color: #0a8f3d;
}

.badge-best {
    background: #00b14f;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.badge-diff {
    color: #e74c3c;
    font-weight: 600;
    font-size: 13px;
}

.status-ok {
    color: #00b14f;
    font-weight: 600;
    font-size: 13px;
}

.status-low {
    color: #e74c3c;
    font-weight: 600;
    font-size: 13px;
}

.btn-visit {
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 16px;
}

/* Mobile Cards (hidden on desktop) */
.compare-cards {
    display: none;
}

.compare-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    border: 2px solid transparent;
}

.compare-card-best {
    border-color: #00b14f;
    background: #fafffe;
}

.compare-card-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: #00b14f;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.compare-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.compare-card-header h5 {
    font-weight: 700;
    margin: 0;
    font-size: 16px;
}

.compare-card-price {
    font-size: 22px;
    font-weight: 700;
    color: #0a8f3d;
}

.compare-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.compare-card-details div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compare-card-details span {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compare-card-details strong {
    font-size: 14px;
}

/* Best Deal Section */
.best-deal-section {
    background: linear-gradient(135deg, #f0fdf4, #e8f8ef);
    border-radius: 20px;
    padding: 36px 24px;
    text-align: center;
    margin-bottom: 40px;
    border: 2px solid #d4f5e2;
}

.best-deal-section .trophy {
    font-size: 40px;
    margin-bottom: 8px;
}

.best-deal-section h2 {
    color: #0a8f3d;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.best-deal-section h3 {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.best-deal-section .best-price {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #00b14f;
    margin-bottom: 8px;
}

.best-deal-section p {
    color: #636e72;
    font-size: 14px;
    margin-bottom: 0;
}

.btn-deal {
    border-radius: 50px;
    padding: 12px 32px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 767px) {
    .compare-table-wrap {
        display: none;
    }

    .compare-cards {
        display: block;
    }

    .compare-search {
        flex-direction: column;
        border-radius: 16px;
        padding: 12px;
        gap: 8px;
    }

    .compare-search input {
        text-align: center;
    }

    .compare-search .btn-search {
        width: 100%;
        border-radius: 12px;
    }

    .product-summary {
        padding: 20px;
    }

    .product-summary .row {
        text-align: center;
    }

    .product-summary img {
        margin-bottom: 16px;
    }
}

@media (min-width: 768px) {
    .compare-cards {
        display: none !important;
    }
}
