/* ===================================
   Cards (Deals, Articles, Products)
   =================================== */

/* --- Deal Card --- */
/* --- Deal Card (Retail Style Premium) --- */
.deal-card {
    background: var(--color-surface-lowest);
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    min-width: 0;
    max-width: 100%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.deal-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.deal-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-surface-low);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-bottom: none;
}

.deal-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.deal-card:hover .deal-image-wrapper img {
    transform: scale(1.04);
}

.deal-badge-discount {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--color-tertiary);
    color: var(--color-white);
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    letter-spacing: 0.1em;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(156, 60, 102, 0.25);
    text-transform: uppercase;
}

.card-icon-wishlist {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s;
    border: 1px solid var(--color-border-light);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.card-icon-wishlist:hover {
    transform: scale(1.1);
    background: var(--color-white);
    color: #e74c3c;
    border-color: #e74c3c;
}

/* Favorited state */
.card-icon-wishlist.is-favorited {
    background: var(--color-white);
    border-color: #e74c3c;
}

.card-icon-wishlist.is-favorited svg path {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* Add to basket button / Go to store */
.btn-basket-mini {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    /* Green trust color */
    color: white;
    border-radius: 50%;
    /* Circular button */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s;
    opacity: 0;
    transform: translateY(10px);
    box-shadow: 0 4px 10px rgba(45, 106, 79, 0.2);
}

.deal-card:hover .btn-basket-mini {
    opacity: 1;
    transform: translateY(0);
}

.btn-basket-mini:hover {
    background: var(--color-primary-dark);
    transform: scale(1.1);
}

.deal-content {
    border: none;
    padding: 16px;
    background: transparent;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
}

.brand-name {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.deal-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 10px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.9em;
    transition: color 0.2s ease;
}

.deal-card:hover .deal-title {
    color: var(--color-primary-light);
}

/* Stretched link: title anchor covers the entire card */
.deal-card-link {
    text-decoration: none;
    color: inherit;
}

.deal-card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    /* Below interactive elements */
}

/* Interactive elements must sit above the stretched overlay */
.card-icon-wishlist,
.btn-basket-mini,
.variant-chips-container,
.price-comparison-wrapper,
.deal-price-row {
    position: relative;
    z-index: 1;
}

.deal-price-row {
    margin-top: auto !important;
    width: 100%;
    padding-top: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    border-top: none;
}

.deal-price-current {
    color: var(--color-primary);
    font-family: var(--font-sans);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.deal-price-original {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
    font-weight: 500;
}

/* --- Article Card --- */
.article-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
    border: 1px solid var(--color-border-light);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-alt);
    /* Default background */
}

/* Article Image Fallbacks */
.article-img-hudpleje {
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.8)), url('../../img/categories/hudpleje.png');
    background-size: cover;
    background-position: center;
}

.article-img-makeup {
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.8)), url('../../img/categories/makeup.png');
    background-size: cover;
    background-position: center;
}

.article-img-parfumer {
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.8)), url('../../img/categories/parfumer.png');
    background-size: cover;
    background-position: center;
}

.article-img-haar {
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.8)), url('../../img/categories/haarpleje.png');
    background-size: cover;
    background-position: center;
}

.article-img-maend {
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.8)), url('../../img/categories/maend.png');
    background-size: cover;
    background-position: center;
}

.article-img-kosttilskud {
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.8)), url('../../img/categories/kosttilskud.png');
    background-size: cover;
    background-position: center;
}

.article-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-anbefaling {
    background: var(--color-best);
    color: var(--color-white);
}

.badge-guide {
    background: var(--color-white);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.badge-vs {
    background: var(--color-deal);
    color: var(--color-white);
}

.article-body {
    padding: var(--space-lg);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.article-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.article-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.article-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

.article-read {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary);
}

.article-card:hover .article-read {
    color: var(--color-primary-dark);
}

/* --- Product Box (Affiliate) --- */
.product-box {
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    margin: 40px 0;
    background: var(--color-white);
    display: flex;
    gap: 24px;
    align-items: flex-start;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.product-box:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(45, 106, 79, 0.12);
    transform: translateY(-2px);
}

.product-box-image {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-bg-warm);
    border: 1px solid var(--color-border-light);
}

.product-box-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-box-content {
    flex: 1;
    min-width: 0;
}

.product-box-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--color-text);
    line-height: 1.3;
}

.product-box-brand {
    font-size: 15px;
    color: var(--color-text-muted);
    margin: 0 0 14px 0;
    font-weight: 500;
}

.product-box-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.product-box-current-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    font-family: var(--font-sans);
}

.product-original-price {
    font-size: 18px;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.product-discount {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.product-box-shop {
    font-size: 14px;
    color: var(--color-text-light);
    margin: 0 0 18px 0;
}

/* --- Mobile --- */
@media (max-width: 640px) {
    .deal-image-wrapper {
        height: 200px;
        padding: 20px;
    }

    .deal-image-wrapper img {
        max-width: 100% !important;
        height: auto !important;
    }

    .deal-heading {
        font-size: 0.95rem;
    }

    .product-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .product-box-image {
        width: 100%;
        max-width: 220px;
        height: 220px;
    }

    .product-box-title {
        font-size: 20px;
    }

    .product-box-current-price {
        font-size: 24px;
    }

    .product-box-price {
        justify-content: center;
    }
}

/* --- Product Variants (Chips) --- */
.variant-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.variant-chip {
    font-size: 0.75rem;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--color-bg);
    color: var(--color-text-light);
    transition: all 0.2s;
}

.variant-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-white);
}

.variant-chip.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.variant-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    border-top: 1px solid var(--color-border-light);
}

.deal-card:hover .variant-overlay {
    transform: translateY(0);
}

/* --- Price Comparison (Dropdown) --- */
.price-comparison-wrapper {
    position: relative;
    width: 100%;
    margin-top: 8px;
}

.compare-prices-btn {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    padding: 8px 12px;
    text-align: left;
    font-size: 0.8rem;
    color: var(--color-text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.compare-prices-btn:hover {
    background: var(--color-bg-warm);
    border-color: var(--color-border-dark);
}

.price-comparison-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 20;
    max-height: 240px;
    overflow-y: auto;
    padding: 0 12px;
}

.merchant-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85rem;
}

.merchant-option:last-child {
    border-bottom: none;
}

.merchant-stock {
    font-size: 1rem;
    line-height: 1;
}

.merchant-stock.in-stock {
    color: var(--color-success);
}

.merchant-stock.low-stock {
    color: var(--color-warning);
}

.merchant-stock.out-of-stock {
    color: var(--color-text-muted);
}

.merchant-name {
    flex: 1;
    margin-left: 8px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merchant-price {
    font-weight: 700;
    margin-right: 10px;
    color: var(--color-text);
}

.merchant-buy-btn {
    padding: 4px 10px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.2s;
}

.merchant-buy-btn:hover {
    background: var(--color-primary-dark);
}