/* ============================================
   TourAffix — Frontend Product Cards
   ============================================ */

:root {
    --tafx-primary: #e8604c;
    --tafx-primary-hover: #d94836;
    --tafx-radius: 14px;
    --tafx-img-ratio: 16 / 10;
}

.tafx-products {
    display: grid;
    gap: 24px;
    padding: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Grid columns */
.tafx-layout-grid.tafx-cols-1 { grid-template-columns: 1fr; }
.tafx-layout-grid.tafx-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tafx-layout-grid.tafx-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tafx-layout-grid.tafx-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* List layout */
.tafx-layout-list { grid-template-columns: 1fr; }
.tafx-layout-list .tafx-product-card {
    display: grid;
    grid-template-columns: 240px 1fr auto;
    align-items: stretch;
}
.tafx-layout-list .tafx-card-image {
    min-height: 180px;
    max-width: 240px;
    aspect-ratio: 4 / 3;
}
.tafx-layout-list .tafx-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tafx-layout-list .tafx-card-content {
    padding: 16px 20px 12px;
    overflow: hidden;
}
.tafx-layout-list .tafx-card-footer {
    flex-direction: column;
    justify-content: center;
    border-top: none;
    border-left: 1px solid #f0f0f0;
    padding: 20px 24px;
    min-width: 160px;
}

/* Card */
.tafx-product-card {
    background: #fff;
    border-radius: var(--tafx-radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.tafx-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Image */
.tafx-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--tafx-img-ratio);
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

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

.tafx-product-card:hover .tafx-card-image img {
    transform: scale(1.06);
}

.tafx-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 48px;
}

/* Badge */
.tafx-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--tafx-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Source tag */
.tafx-source-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.2px;
    backdrop-filter: blur(8px);
}

.tafx-source-viator {
    background: rgba(232, 96, 76, 0.9);
    color: #fff;
}

.tafx-source-booking {
    background: rgba(0, 53, 128, 0.9);
    color: #fff;
}

.tafx-source-getyourguide {
    background: rgba(255, 87, 34, 0.9);
    color: #fff;
}

/* Content */
.tafx-card-content {
    padding: 16px 20px 12px;
    flex: 1;
}

.tafx-card-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: #1a202c;
}

.tafx-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

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

.tafx-card-desc {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

/* Meta */
.tafx-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

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

.tafx-stars {
    color: #f59e0b;
    letter-spacing: -1px;
}

.tafx-rating-num {
    font-weight: 700;
    color: #1a202c;
}

.tafx-review-count {
    color: #94a3b8;
    font-size: 12px;
}

.tafx-duration {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 4px;
}

.tafx-duration::before {
    content: "⏱";
    font-size: 11px;
}

/* Footer */
.tafx-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafbfc;
}

.tafx-price {
    display: flex;
    flex-direction: column;
}

.tafx-price-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.tafx-price-amount {
    font-size: 20px;
    font-weight: 800;
    color: #1a202c;
    line-height: 1.2;
}

.tafx-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--tafx-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.tafx-btn:hover {
    background: var(--tafx-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    color: #fff !important;
}

/* Empty state */
.tafx-empty {
    text-align: center;
    padding: 48px 24px;
    color: #94a3b8;
    font-size: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

/* Block editor placeholder */
.tafx-block-placeholder {
    text-align: center;
    padding: 48px 32px;
    background: linear-gradient(135deg, #fef7f6 0%, #fff5f3 100%);
    border: 2px dashed #e8604c33;
    border-radius: 14px;
}

.tafx-block-placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.tafx-block-placeholder h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #1a202c;
}

.tafx-block-placeholder p {
    color: #64748b;
    font-size: 14px;
    margin: 0 0 4px;
}

.tafx-block-hint {
    font-style: italic;
    font-size: 13px !important;
    color: #94a3b8 !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .tafx-layout-grid.tafx-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .tafx-layout-grid.tafx-cols-3,
    .tafx-layout-grid.tafx-cols-4 { grid-template-columns: repeat(2, 1fr); }

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

    .tafx-layout-list .tafx-card-image {
        max-width: 100%;
        aspect-ratio: var(--tafx-img-ratio);
    }

    .tafx-layout-list .tafx-card-footer {
        border-left: none;
        border-top: 1px solid #f0f0f0;
        flex-direction: row;
    }

    .tafx-card-title { font-size: 15px; }
    .tafx-price-amount { font-size: 18px; }
}

@media (max-width: 480px) {
    .tafx-layout-grid.tafx-cols-2,
    .tafx-layout-grid.tafx-cols-3,
    .tafx-layout-grid.tafx-cols-4 { grid-template-columns: 1fr; }

    .tafx-products { gap: 16px; }

    .tafx-card-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        text-align: center;
    }

    .tafx-btn { justify-content: center; }
}
