/**
 * CompareHarga - Frontend Styles
 *
 * Styling minimalis & responsive. Override di child theme kalau perlu.
 */

/* === Container & Layout === */
.ch-single-product-wrapper,
.ch-archive-wrapper {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* === Breadcrumb === */
.ch-breadcrumb {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}
.ch-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}
.ch-breadcrumb a:hover {
    color: #2563eb;
}

/* === Product header === */
.ch-product__title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}
.ch-product__brand {
    color: #6b7280;
    margin: 0 0 1.5rem;
}

/* === Product layout: media + sidebar === */
.ch-product__layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 768px) {
    .ch-product__layout {
        grid-template-columns: 1fr;
    }
}

.ch-product__media {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}
.ch-product__image {
    max-width: 100%;
    height: auto;
}

/* === Price box (sidebar) === */
.ch-product__price-box {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    position: sticky;
    top: 80px;
}
.ch-product__price-label {
    display: block;
    font-size: 0.9rem;
    color: #166534;
    margin-bottom: 0.25rem;
}
.ch-product__price-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #166534;
    line-height: 1.2;
}
.ch-product__price-source {
    display: block;
    font-size: 0.85rem;
    color: #166534;
    margin: 0.25rem 0 1rem;
}

/* === Compare table === */
.ch-compare-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}
.ch-compare-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.ch-compare-table th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}
.ch-compare-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.ch-compare-table tr:last-child td {
    border-bottom: none;
}
.ch-row--lowest {
    background: #f0fdf4;
}
.ch-cell-price strong {
    font-size: 1.1rem;
    color: #111827;
}
.ch-row--lowest .ch-cell-price strong {
    color: #166534;
}
.ch-cell-date {
    color: #6b7280;
    font-size: 0.9rem;
}

/* === Marketplace badge === */
.ch-marketplace-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}
.ch-lowest-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: #22c55e;
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* === Buy button === */
.ch-buy-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.2rem;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s, transform 0.2s;
}
.ch-buy-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.ch-btn-small {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}
.ch-btn-large {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

.ch-buy-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

/* === Disclaimer === */
.ch-disclaimer {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0.75rem 0 0;
}

/* === Specs table === */
.ch-specs-display {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.ch-specs-display th,
.ch-specs-display td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
}
.ch-specs-display th {
    width: 30%;
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* === Product card === */
.ch-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.ch-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.ch-product-card__image {
    display: block;
    aspect-ratio: 1;
    background: #f9fafb;
    overflow: hidden;
}
.ch-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ch-product-card__body {
    padding: 1rem;
}
.ch-product-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.4;
}
.ch-product-card__title a {
    color: #111827;
    text-decoration: none;
}
.ch-product-card__title a:hover {
    color: #2563eb;
}
.ch-product-card__price {
    margin: 0.5rem 0 1rem;
}
.ch-product-card__price-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}
.ch-product-card__price strong {
    font-size: 1.25rem;
    color: #166534;
}
.ch-product-card__price small {
    display: block;
    color: #6b7280;
    font-size: 0.8rem;
}
.ch-product-card__cta {
    width: 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.ch-product-card__link {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: #2563eb;
    text-decoration: none;
    margin-top: 0.5rem;
}
.ch-product-card__link:hover {
    text-decoration: underline;
}

/* === Products grid === */
.ch-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

/* === Section headings === */
.ch-product__compare-section,
.ch-product__description,
.ch-product__specs {
    margin: 2.5rem 0;
}
.ch-product__compare-section h2,
.ch-product__description h2,
.ch-product__specs h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* === Affiliate disclosure === */
.ch-affiliate-disclosure {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #78350f;
}

/* === Notices === */
.ch-notice {
    background: #f3f4f6;
    border-left: 4px solid #6b7280;
    padding: 1rem;
    color: #6b7280;
    border-radius: 4px;
    margin: 1rem 0;
}
.ch-no-products,
.ch-no-price {
    color: #6b7280;
    font-style: italic;
}

/* === Inline lowest === */
.ch-lowest-inline strong {
    color: #166534;
}

/* === Pagination === */
.ch-pagination {
    margin: 2rem 0;
    text-align: center;
}
.ch-pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
}
.ch-pagination .page-numbers.current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
