/* =============================================================
   Affiliate Showcase — Frontend Styles
   ============================================================= */

/* Wrapper */
.afsc-wrap {
    font-family: inherit;
    box-sizing: border-box;
}

.afsc-wrap *,
.afsc-wrap *::before,
.afsc-wrap *::after {
    box-sizing: inherit;
}

/* ── Grid layout ─────────────────────────────────────────── */
.afsc-grid {
    display: grid;
    gap: 24px;
}

.afsc-cols-1 { grid-template-columns: 1fr; }
.afsc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.afsc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.afsc-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Single card wrapper */
.afsc-single .afsc-card {
    max-width: 360px;
}

/* ── Card ─────────────────────────────────────────────────── */
.afsc-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.afsc-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

/* ── Featured card ────────────────────────────────────────── */
.afsc-card-featured {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.afsc-featured-star {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 16px;
    z-index: 2;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* ── Button via label ─────────────────────────────────────── */
.afsc-button-via {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.85;
    letter-spacing: 0.03em;
    margin-top: 1px;
}

/* ── Badge ────────────────────────────────────────────────── */
.afsc-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 2;
}

/* ── Image ────────────────────────────────────────────────── */
.afsc-image-wrap {
    background: #f9fafb;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.afsc-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.afsc-card:hover .afsc-image-wrap img {
    transform: scale(1.04);
}

.afsc-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Card body ────────────────────────────────────────────── */
.afsc-card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* Partner name */
.afsc-partner {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

/* Title */
.afsc-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.afsc-title a {
    color: inherit;
    text-decoration: none;
}

.afsc-title a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Description */
.afsc-description {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* Pricing */
.afsc-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
}

.afsc-price {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

.afsc-original-price {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}

/* ── Button ───────────────────────────────────────────────── */
.afsc-button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 10px 20px;
    background: #2563eb;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    line-height: 1.3;
}

.afsc-button:hover {
    background: #1d4ed8;
    color: #ffffff !important;
}

/* ── Pagination ───────────────────────────────────────────── */
.afsc-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.afsc-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151 !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.afsc-page-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827 !important;
}

.afsc-page-btn.afsc-page-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff !important;
    font-weight: 700;
    pointer-events: none;
}

.afsc-no-products {
    text-align: center;
    color: #6b7280;
    font-size: 15px;
    padding: 40px 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media ( max-width: 900px ) {
    .afsc-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .afsc-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

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

    .afsc-single .afsc-card {
        max-width: 100%;
    }
}
