/**
 * TBS Affiliate Compare - Matched Products Frontend Refactor
 * 
 * NEUER ANSATZ:
 * - Keine Inline-Styles mehr
 * - Reines CSS-Grid Layout
 * - Mobile First Responsive
 * - BEM-Naming Convention
 * - CSS-Custom Properties für Theming
 * 
 * @version 2.6.0
 */

:root {
    /* Colors */
    --color-primary: #2196f3;
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-danger: #f44336;
    --color-info: #00bcd4;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-xxl: 32px;
    
    /* Typography */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
    
    /* Borders */
    --border-radius: 4px;
    --border-color: #e0e0e0;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ========================================
   BASE CONTAINER
   ======================================== */

.tbsapc-matched-products {
    all: revert;
    box-sizing: border-box;
}

.tbsapc-matched-products,
.tbsapc-matched-products * {
    margin: 0;
    padding: 0;
}

.tbsapc-matched-products * {
    box-sizing: border-box;
}

/* ========================================
   GRID LAYOUT - MAIN
   ======================================== */

.tbsapc-matched-products__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

/* Mobile: 1 Spalte */
@media (max-width: 480px) {
    .tbsapc-matched-products__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
}

/* Tablet: 2 Spalten */
@media (min-width: 481px) and (max-width: 768px) {
    .tbsapc-matched-products__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3-4 Spalten */
@media (min-width: 769px) {
    .tbsapc-matched-products__grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

/* ========================================
   PRODUCT CARD
   ======================================== */

.tbsapc-product-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

/* ========================================
   PRODUCT IMAGE
   ======================================== */

.tbsapc-product-card__image {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    background: #f0f0f0;
}

.tbsapc-product-card__image--missing {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    color: #999;
}

/* ========================================
   PRODUCT INFO
   ======================================== */

.tbsapc-product-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tbsapc-product-card__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tbsapc-product-card__sku {
    font-size: var(--font-size-xs);
    color: #999;
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   PRICE SECTION
   ======================================== */

.tbsapc-product-card__pricing {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-md);
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.tbsapc-product-card__price {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.tbsapc-product-card__base-price {
    font-size: var(--font-size-sm);
    color: #666;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.tbsapc-product-card__shipping {
    font-size: var(--font-size-sm);
    color: #999;
    margin-top: var(--spacing-xs);
}

/* ========================================
   MERCHANT / PROVIDER INFO
   ======================================== */

.tbsapc-product-card__merchant {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: #f0f7ff;
    border-radius: var(--border-radius);
}

.tbsapc-product-card__merchant-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-primary);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: 3px;
    white-space: nowrap;
}

.tbsapc-product-card__merchant-name {
    font-size: var(--font-size-sm);
    color: #333;
    font-weight: 500;
    flex: 1;
}

/* ========================================
   DESCRIPTION
   ======================================== */

.tbsapc-product-card__description {
    font-size: var(--font-size-sm);
    color: #666;
    line-height: 1.4;
    margin: var(--spacing-md) 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   RATING / REVIEWS
   ======================================== */

.tbsapc-product-card__rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.tbsapc-product-card__stars {
    color: #ffc107;
    font-size: var(--font-size-md);
}

.tbsapc-product-card__rating-count {
    color: #999;
    font-size: var(--font-size-xs);
}

/* ========================================
   ACTIONS / BUTTONS
   ======================================== */

.tbsapc-product-card__actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: auto;
}

.tbsapc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: var(--font-size-md);
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    flex-wrap: wrap;
}

.tbsapc-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.tbsapc-btn:active {
    transform: translateY(0);
}

/* Button Variants */
.tbsapc-btn--primary {
    background: var(--color-primary);
    color: white;
}

.tbsapc-btn--primary:hover {
    background: #1976d2;
}

.tbsapc-btn--success {
    background: var(--color-success);
    color: white;
}

.tbsapc-btn--success:hover {
    background: #45a049;
}

.tbsapc-btn--warning {
    background: var(--color-warning);
    color: white;
}

.tbsapc-btn--warning:hover {
    background: #fb8c00;
}

.tbsapc-btn--secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid var(--border-color);
}

.tbsapc-btn--secondary:hover {
    background: #ebebeb;
}

.tbsapc-btn--small {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
}

.tbsapc-btn--full {
    width: 100%;
}

/* ========================================
   SPECIAL BADGES
   ======================================== */

.tbsapc-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 3px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.tbsapc-badge--new {
    background: #c8e6c9;
    color: #1b5e20;
}

.tbsapc-badge--sale {
    background: #ffccbc;
    color: #bf360c;
}

.tbsapc-badge--popular {
    background: #e3f2fd;
    color: #1565c0;
}

/* ========================================
   CATEGORY / BREADCRUMB
   ======================================== */

.tbsapc-breadcrumb {
    font-size: var(--font-size-sm);
    color: #666;
    margin-bottom: var(--spacing-lg);
}

.tbsapc-breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}

.tbsapc-breadcrumb a:hover {
    text-decoration: underline;
}

/* ========================================
   PAGINATION
   ======================================== */

.tbsapc-pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

.tbsapc-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    color: #333;
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tbsapc-pagination__item:hover:not(.active) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.tbsapc-pagination__item.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ========================================
   LOADING STATES
   ======================================== */

.tbsapc-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.tbsapc-skeleton--title {
    height: 20px;
    width: 80%;
    border-radius: 4px;
}

.tbsapc-skeleton--image {
    height: 200px;
    width: 100%;
    border-radius: 4px;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.tbsapc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxl);
    text-align: center;
    color: #999;
}

.tbsapc-empty-state__icon {
    font-size: 48px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.tbsapc-empty-state__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.tbsapc-empty-state__text {
    font-size: var(--font-size-md);
    color: #bbb;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .tbsapc-product-card__actions {
        display: none;
    }
}


/* ============================================================================
 * NEW v2.7.0: No Offers Message
 * ============================================================================ */

.tbsapc-matched-products--empty {
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f3f7 100%);
    border: 2px dashed #d0d7e0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
}

.tbsapc-no-offers {
    max-width: 500px;
    margin: 0 auto;
}

.tbsapc-no-offers__icon {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 20px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.tbsapc-no-offers__title {
    color: #1a1a1a;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.tbsapc-no-offers__text {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.tbsapc-no-offers__subtitle {
    color: #999;
    font-size: 12px;
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Responsive */
@media (max-width: 480px) {
    .tbsapc-matched-products--empty {
        padding: 30px 15px;
    }
    
    .tbsapc-no-offers__icon {
        font-size: 48px;
    }
    
    .tbsapc-no-offers__title {
        font-size: 18px;
    }
    
    .tbsapc-no-offers__text {
        font-size: 13px;
    }
}

