/* FlowAds Template Styles v3.2 */
:root {
    --flowads-primary: #1976d2;
    --flowads-primary-dark: #1565c0;
    --flowads-success: #2e7d32;
    --flowads-warning: #ef6c00;
    --flowads-danger: #c62828;
    --flowads-text: #1a1a1a;
    --flowads-text-muted: #666;
    --flowads-border: #e0e0e0;
    --flowads-bg: #ffffff;
    --flowads-bg-light: #f8fafc;
    --flowads-radius: 12px;
    --flowads-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.flowads-wrapper {
    margin: 1.5rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.flowads {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--flowads-bg);
    border: 1px solid var(--flowads-border);
    border-radius: var(--flowads-radius);
    overflow: hidden;
    box-shadow: var(--flowads-shadow);
    color: var(--flowads-text);
    line-height: 1.5;
    margin-bottom: 1rem;
    position: relative;
}

.flowads-image {
    background: var(--flowads-bg-light);
    overflow: hidden;
}

.flowads-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flowads-partner {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--flowads-primary);
    margin-bottom: 4px;
}

.flowads-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--flowads-text);
    margin-bottom: 4px;
}

.flowads-meta {
    font-size: 0.875rem;
    color: var(--flowads-text-muted);
    margin-bottom: 8px;
}

.flowads-description {
    font-size: 0.95rem;
    color: var(--flowads-text);
}

.flowads-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--flowads-primary);
}

.flowads-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-height: 44px;
}

.flowads-btn-primary {
    background: var(--flowads-primary);
    color: white;
}

.flowads-btn-primary:hover {
    background: var(--flowads-primary-dark);
    color: white;
}

/* Compact Template */
.flowads-compact {
    max-width: 320px;
}

.flowads-compact .flowads-image {
    width: 100%;
    height: 160px;
}

.flowads-compact .flowads-content {
    padding: 12px;
}

/* Enhanced Template (Blog/Brand Standard) */
.flowads-enhanced {
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.flowads-enhanced .flowads-main {
    display: flex;
    min-height: 0;
}

.flowads-enhanced .flowads-image {
    width: 200px;
    min-width: 200px;
    max-height: 200px;
    flex-shrink: 0;
    overflow: hidden;
}

.flowads-enhanced .flowads-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flowads-enhanced .flowads-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.flowads-enhanced .flowads-description {
    font-size: 0.9rem;
    color: var(--flowads-text-muted);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.flowads-enhanced .flowads-ctas {
    padding: 12px 16px;
    border-top: 1px solid var(--flowads-border);
    background: var(--flowads-bg-light);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flowads-enhanced .flowads-flow-badge {
    font-size: 0.75rem;
    color: var(--flowads-text-muted);
    padding: 8px 16px;
    background: var(--flowads-bg-light);
    border-top: 1px solid var(--flowads-border);
    text-align: center;
}

.flowads-enhanced .flowads-disclosure {
    font-size: 0.7rem;
    color: #999;
    padding: 8px 16px;
    background: #f9f9f9;
    border-top: 1px solid var(--flowads-border);
}

/* Affiliate Template */
.flowads-affiliate {
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.flowads-affiliate .flowads-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.flowads-affiliate .flowads-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flowads-affiliate .flowads-content {
    padding: 16px;
    flex: 1;
}

.flowads-affiliate .flowads-partner {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--flowads-primary);
    margin-bottom: 4px;
}

.flowads-affiliate .flowads-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--flowads-text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flowads-affiliate .flowads-meta {
    font-size: 0.85rem;
    color: var(--flowads-text-muted);
    margin-bottom: 8px;
}

.flowads-affiliate .flowads-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--flowads-success);
}

.flowads-affiliate .flowads-rating {
    font-size: 0.85rem;
    color: var(--flowads-text-muted);
    margin-left: 8px;
}

.flowads-affiliate .flowads-cta {
    padding: 12px 16px;
    border-top: 1px solid var(--flowads-border);
    background: var(--flowads-bg-light);
}

.flowads-affiliate .flowads-cta .flowads-btn {
    width: 100%;
}

.flowads-affiliate .flowads-disclosure {
    font-size: 0.7rem;
    color: #999;
    padding: 8px 16px;
    background: #f9f9f9;
    border-top: 1px solid var(--flowads-border);
}

/* Sale Badge */
.flowads-sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--flowads-danger);
    color: white;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    z-index: 2;
}

/* Price styling */
.flowads-price-from {
    font-size: 0.8rem;
    color: var(--flowads-text-muted);
    margin-right: 4px;
}

.flowads-price-cabin {
    font-size: 0.8rem;
    color: var(--flowads-text-muted);
    margin-left: 4px;
}

.flowads-price-was {
    font-size: 0.9rem;
    color: var(--flowads-text-muted);
    text-decoration: line-through;
    margin-left: 8px;
}

.flowads-ship {
    font-size: 0.85rem;
    color: var(--flowads-primary);
    margin-top: 8px;
}

.flowads-rating {
    font-size: 0.85rem;
    color: var(--flowads-text-muted);
    margin-left: 12px;
}

/* Presented By Footer (Brand Ads) */
.flowads-presented-by,
.flowads-flow-badge {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    padding: 6px;
    background: #f1f1f1;
    border-top: 1px solid #ddd;
}

/* Header Link Styling (from Sprint 1) */
a.flowads-header-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 1rem;
}

a.flowads-header-link:hover {
    text-decoration: none;
}

a.flowads-header-link h2,
a.flowads-header-link h3 {
    color: var(--flowads-primary);
    transition: color 0.2s;
}

a.flowads-header-link:hover h2,
a.flowads-header-link:hover h3 {
    color: var(--flowads-primary-dark);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .flowads-enhanced .flowads-main {
        flex-direction: column;
    }

    .flowads-enhanced .flowads-image {
        width: 100%;
        height: 180px;
    }
}

/* ========================================= */
/*       NEW BASKET STYLES (Sprint 4)        */
/* ========================================= */

.flowads-basket {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.flowads-basket-header {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 1rem;
}

.flowads-basket-header-link {
    color: white;
    text-decoration: none;
    display: block;
}

.flowads-basket-header-link:hover {
    text-decoration: underline;
}

.flowads-basket .flowads-disclosure {
    font-size: 0.7rem;
    color: #999;
    padding: 8px 16px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

/* Grid-3 Layout */
.flowads-basket-grid-3 .flowads-basket-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.flowads-basket-grid-item {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    background: white;
}

.flowads-basket-grid-item:last-child {
    border-right: none;
}

.flowads-basket-grid-item .flowads-basket-item-image {
    height: 160px;
    overflow: hidden;
}

.flowads-basket-grid-item .flowads-basket-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flowads-basket-grid-item .flowads-basket-item-content {
    padding: 12px;
    flex: 1;
}

.flowads-basket-grid-item .flowads-basket-item-cta {
    padding: 0 12px 12px;
}

.flowads-basket-grid-item .flowads-btn {
    width: 100%;
    text-align: center;
}

/* Banner Layout (full width) */
.flowads-basket-banner .flowads-basket-items {
    display: flex;
    flex-direction: column;
}

.flowads-basket-banner-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.flowads-basket-banner-item:last-child {
    border-bottom: none;
}

.flowads-basket-banner-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.flowads-basket-banner-item .flowads-basket-item-content {
    flex: 1;
}

.flowads-basket-banner-item .flowads-title {
    font-size: 0.95rem;
}

/* Stacked Layout */
.flowads-basket-stacked .flowads-basket-items {
    display: flex;
    flex-direction: column;
}

.flowads-basket-stacked-item {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.flowads-basket-stacked-item:last-child {
    border-bottom: none;
}

.flowads-basket-stacked-item img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.flowads-basket-stacked-item .flowads-basket-item-content {
    flex: 1;
}

.flowads-basket-stacked-item .flowads-basket-item-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Shared styles within context of basket */
.flowads-basket .flowads-partner {
    font-size: 0.7rem;
    font-weight: 600;
    color: #1976d2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flowads-basket .flowads-title {
    font-weight: 600;
    color: #1a1a1a;
    margin: 4px 0;
}

.flowads-basket .flowads-meta {
    font-size: 0.8rem;
    color: #666;
}

.flowads-basket .flowads-price {
    font-weight: 700;
    color: #2e7d32;
    font-size: 1.1rem;
}

.flowads-basket .flowads-rating {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

.flowads-basket .flowads-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #1976d2;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.flowads-basket .flowads-btn:hover {
    background: #1565c0;
}

/* Responsive */
@media (max-width: 800px) {
    .flowads-basket-grid-3 .flowads-basket-items {
        grid-template-columns: 1fr;
    }

    .flowads-basket-grid-item {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .flowads-basket-grid-item:last-child {
        border-bottom: none;
    }

    .flowads-basket-stacked-item {
        flex-wrap: wrap;
    }

    .flowads-basket-stacked-item img {
        width: 100%;
        height: 160px;
    }

    .flowads-basket-stacked-item .flowads-basket-item-action {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 8px;
    }
}