﻿/**
 * Geo Affiliate Products - Styles
 * Maggioro.com product display components
 * Uses theme design tokens from style.css :root
 */

/* ============================================
   Quick Verdict Product Links
   (Primary definition is in style.css β€” these
    are intentionally omitted here to avoid
    cascade conflicts.)
   ============================================ */

/* No Image Placeholder */
.no-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 4px;
    font-size: 48px;
    color: var(--color-text-muted);
}

.featured-image .no-image-placeholder {
    min-height: 150px;
}

/* ============================================
   Skeleton Loaders
   ============================================ */
.skeleton-loader,
.geo-product-skeleton {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.skeleton-card {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    background: var(--color-bg-card);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.skeleton-card.large {
    max-width: 100%;
    display: flex;
    gap: 20px;
    padding: 20px;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-image.small {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin: 12px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.wide {
    width: 100%;
    height: 200px;
}

.skeleton-button {
    height: 40px;
    width: 120px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin: 12px;
    border-radius: 4px;
}

.skeleton-deal {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   Product Grid Layout
   ============================================ */
.geo-product-container {
    margin: 30px 0;
}

.geo-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.geo-layout-list .geo-product-grid {
    grid-template-columns: 1fr;
}

/* ============================================
   Product Card
   ============================================ */
.geo-product-card {
    background: var(--color-bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all 0.2s ease;
}

.geo-product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.geo-product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.geo-product-card .product-image {
    width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: var(--color-bg-alt);
}

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

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

.geo-product-card .product-info {
    padding: 16px;
}

.geo-product-card .product-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-headline);
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.geo-product-card .product-brand {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.geo-product-card .product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.geo-product-card .price-current,
.geo-product-card .price-sale {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-headline);
}

.geo-product-card .price-sale {
    color: var(--color-primary);
}

.geo-product-card .price-original {
    font-size: 14px;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.geo-product-card .price-discount {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-bg-card);
    background: var(--color-primary);
    padding: 2px 6px;
    border-radius: 4px;
}

.geo-product-card .product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.geo-product-card .stars {
    color: var(--color-star);
    letter-spacing: -1px;
}

.geo-product-card .rating-count {
    color: var(--color-text-light);
}

.geo-product-card .product-button {
    display: inline-block;
    width: 100%;
    padding: 12px 16px;
    margin-top: 14px;
    background: var(--color-primary);
    color: white;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--card-radius);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.geo-product-card .product-button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Deals Sidebar
   ============================================ */
.geo-deals-container {
    background: var(--color-bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    padding: 20px;
}

.geo-deals-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-headline);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
}

.geo-deals-list {
    display: flex;
    flex-direction: column;
}

.geo-deal-item {
    border-bottom: 1px solid var(--color-border);
}

.geo-deal-item:last-child {
    border-bottom: none;
}

.geo-deal-item a {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.geo-deal-item:hover a {
    background: var(--color-bg-alt);
    margin: 0 -12px;
    padding: 12px;
    border-radius: 4px;
}

.geo-deal-item .deal-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: var(--color-bg-alt);
}

.geo-deal-item .deal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.geo-deal-item .deal-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 0 0 0 4px;
}

.geo-deal-item .deal-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.geo-deal-item .deal-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-headline);
    line-height: 1.3;
    margin-bottom: 4px;
}

.geo-deal-item .deal-prices {
    display: flex;
    align-items: center;
    gap: 8px;
}

.geo-deal-item .deal-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary);
}

.geo-deal-item .deal-original {
    font-size: 12px;
    color: var(--color-text-light);
    text-decoration: line-through;
}

.geo-deal-item .deal-savings {
    font-size: 11px;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 8px;
}

.geo-deal-item .deal-button {
    display: inline-block;
    width: 100%;
    padding: 10px 12px;
    margin-top: 8px;
    background: var(--color-primary);
    color: white;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.geo-deal-item .deal-button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

/* ============================================
   Featured Product Card (Wirecutter Style)
   ============================================ */
.featured-product-card {
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: var(--card-radius);
    padding: 24px;
    margin: 24px 0;
    position: relative;
}

.featured-product-card .product-badge {
    position: absolute;
    top: -12px;
    left: 24px;
    background: var(--color-primary);
    color: white;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 16px;
    border-radius: 20px;
}

.featured-product-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .featured-product-layout {
        flex-direction: column;
    }
}

.featured-product-card .featured-image {
    width: 200px;
    flex-shrink: 0;
}

.featured-product-card .featured-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.featured-product-card .featured-content {
    flex: 1;
}

.featured-product-card .featured-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-headline);
    margin: 0 0 8px;
    line-height: 1.3;
}

.featured-product-card .featured-title a {
    color: inherit;
    text-decoration: none;
}

.featured-product-card .featured-title a:hover {
    color: var(--color-primary);
}

.featured-product-card .featured-brand {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.featured-product-card .featured-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.featured-product-card .featured-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-headline);
}

.featured-product-card .featured-merchant {
    font-size: 14px;
    color: var(--color-text-muted);
}

.featured-product-card .featured-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 4px;
    transition: background 0.2s;
}

.featured-product-card .featured-button:hover {
    background: var(--color-primary-dark);
}

/* ============================================
   Comparison Table
   ============================================ */
.product-comparison-container {
    margin: 30px 0;
    overflow-x: auto;
}

.product-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-card);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.product-comparison-table th,
.product-comparison-table td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.product-comparison-table thead th {
    background: var(--color-bg-alt);
    vertical-align: top;
    min-width: 150px;
}

.product-comparison-table .comparison-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

.product-comparison-table .comparison-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-headline);
    line-height: 1.3;
}

.product-comparison-table .spec-label {
    text-align: left;
    font-weight: 600;
    color: var(--color-text-headline);
    background: var(--color-bg-alt);
}

.product-comparison-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.product-comparison-table .comparison-cta td {
    padding: 20px 16px;
    border-bottom: none;
}

.product-comparison-table .comparison-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    transition: background 0.2s;
}

.product-comparison-table .comparison-button:hover {
    background: var(--color-primary-dark);
}

/* ============================================
   Empty & Error States
   ============================================ */
.geo-empty,
.geo-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.geo-error {
    color: var(--color-primary);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .geo-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .geo-product-card .product-title {
        font-size: 14px;
    }
    
    .geo-product-card .price-current,
    .geo-product-card .price-sale {
        font-size: 16px;
    }
    
    .featured-product-card {
        padding: 20px;
    }
    
    .featured-product-card .featured-image {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .product-comparison-table th,
    .product-comparison-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .geo-product-grid {
        grid-template-columns: 1fr;
    }
    
    .geo-deals-container {
        padding: 16px;
    }
}

/* ============================================
   Product Page - Description & Specs
   ============================================ */

/* Description bullet list */
.product-description-section .product-desc-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
}
.product-description-section .product-desc-list li {
    position: relative;
    padding: 8px 0 8px 24px;
    line-height: 1.6;
    color: var(--color-text-body);
    border-bottom: 1px solid var(--color-border);
}
.product-description-section .product-desc-list li:last-child {
    border-bottom: none;
}
.product-description-section .product-desc-list li::before {
    content: '\2022';
    position: absolute;
    left: 6px;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.2em;
}

/* Specs table */
.product-specs-section .specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.product-specs-section .specs-table th,
.product-specs-section .specs-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
    border-bottom: 1px solid var(--color-border);
}
.product-specs-section .specs-table th {
    width: 35%;
    font-weight: 600;
    color: var(--color-text-headline);
    background: var(--color-bg-alt);
}
.product-specs-section .specs-table td {
    color: var(--color-text-body);
}
.product-specs-section .specs-table tr:last-child th,
.product-specs-section .specs-table tr:last-child td {
    border-bottom: none;
}
