.affe-card-list {
    display: grid;
    gap: 18px;
}

.affe-product-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #d8dde3;
    border-radius: 12px;
    background: #fff;
    color: #1d2d3f;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.affe-product-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 210px;
    padding: 16px;
    background: #f7f8f9;
}

.affe-product-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 195px;
    max-height: 205px;
    object-fit: contain;
}

.affe-product-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px 22px;
}

.affe-product-brand {
    margin-bottom: 4px;
    color: #66717d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.affe-product-title {
    margin: 0 0 5px;
    color: #132b43;
    font-size: 20px;
    line-height: 1.25;
}

.affe-product-model {
    margin-bottom: 10px;
    color: #697887;
    font-size: 13px;
}

.affe-product-score {
    display: inline-flex;
    align-items: baseline;
    align-self: flex-start;
    gap: 2px;
    margin: 4px 0 12px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef3f7;
    color: #17324d;
}

.affe-product-score strong { font-size: 16px; }
.affe-product-score span { font-size: 12px; }

.affe-product-specs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0 12px;
}

.affe-spec {
    min-width: 0;
    padding: 8px 9px;
    border-radius: 8px;
    background: #f7f8fa;
}

.affe-spec span,
.affe-spec strong {
    display: block;
}

.affe-spec span {
    margin-bottom: 2px;
    color: #74808c;
    font-size: 10px;
}

.affe-spec strong {
    color: #20384f;
    font-size: 13px;
}

.affe-best-for {
    margin: 0 0 9px;
    color: #34495e;
    font-size: 14px;
}

.affe-best-for span {
    font-weight: 700;
}

.affe-product-verdict {
    margin: 0 0 13px;
    color: #526170;
    font-size: 14px;
    line-height: 1.5;
}

.affe-product-buy {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 8px;
}

.affe-price-block {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
    margin-right: auto;
}

.affe-price {
    color: #101820;
    font-size: 20px;
    line-height: 1.15;
}

.affe-old-price {
    color: #8a949d;
    font-size: 13px;
    text-decoration: line-through;
}

.affe-cta,
.affe-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
}

.affe-cta {
    background: #f5b21b;
    color: #111 !important;
}

.affe-cta:hover { filter: brightness(.96); }

.affe-details {
    border: 1px solid #ced5dc;
    background: #fff;
    color: #1c3b59 !important;
}

.affe-card-error {
    padding: 12px 14px;
    border-left: 4px solid #d63638;
    background: #fff1f1;
}

@media (max-width: 900px) {
    .affe-product-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .affe-product-media {
        min-height: 190px;
        padding: 14px;
    }

    .affe-product-title {
        font-size: 18px;
    }

    .affe-product-specs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Smartphones: always use one vertical card layout. */
@media (max-width: 700px) {
    .affe-product-card {
        grid-template-columns: 1fr;
    }

    .affe-product-media {
        min-height: 205px;
        padding: 14px 16px 10px;
    }

    .affe-product-media img {
        width: auto;
        height: auto;
        max-width: min(240px, 88%);
        max-height: 195px;
    }

    .affe-product-body {
        padding: 15px 13px 13px;
    }

    .affe-product-brand {
        font-size: 10px;
    }

    .affe-product-title {
        margin-bottom: 8px;
        font-size: 16px;
        line-height: 1.24;
    }

    .affe-product-model {
        margin-top: -4px;
        margin-bottom: 9px;
        font-size: 12px;
    }

    .affe-product-specs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-bottom: 10px;
    }

    .affe-spec {
        padding: 8px;
    }

    .affe-product-buy {
        width: 100%;
        gap: 10px;
        padding-top: 8px;
    }

    .affe-price-block {
        width: 100%;
        margin-right: 0;
    }

    .affe-price {
        font-size: 20px;
    }

    .affe-cta,
    .affe-details {
        width: 100%;
        min-height: 42px;
    }
}

/* 0.7.0: explicit editorial selections remain visible when an offer becomes unavailable. */
.affe-product-card.is-unavailable {
    border-color: #dde1e5;
}

.affe-availability {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    margin-right: auto;
    padding: 0 13px;
    border: 1px solid #d8dde3;
    border-radius: 999px;
    background: #f5f6f7;
    color: #5f6973;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 700px) {
    .affe-availability {
        width: 100%;
        justify-content: center;
        min-height: 42px;
        margin-right: 0;
    }
}

/* 0.9.0: verified customer rating and truthful urgency signals. */
.affe-customer-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 5px 0 10px;
    color: #4c5966;
    font-size: 13px;
    line-height: 1;
}

.affe-customer-rating strong {
    color: #172b3f;
    font-size: 13px;
}

.affe-stars {
    position: relative;
    display: inline-block;
    width: 82px;
    height: 16px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 16px;
    line-height: 16px;
    letter-spacing: 1px;
}

.affe-stars-base {
    position: absolute;
    inset: 0;
    color: #d7dce1;
}

.affe-stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    color: #f5b21b;
    white-space: nowrap;
}

.affe-rating-info {
    cursor: help;
    color: #78838e;
    font-size: 13px;
}

.affe-fomo {
    width: 100%;
    margin: 0 0 2px;
    color: #9b4d00;
    font-size: 12px;
    font-weight: 700;
}

.affe-fomo.is-lowest,
.affe-fomo.is-drop,
.affe-fomo.is-discount {
    color: #9b4d00;
}

.affe-fomo.is-stock {
    color: #a33a00;
}

@media (max-width: 700px) {
    .affe-customer-rating {
        flex-wrap: wrap;
        margin-top: 2px;
    }

    .affe-review-count {
        font-size: 12px;
    }
}

/* 0.11.0: stronger, data-backed commercial signals. */
.affe-offer-signal {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    margin: 0 0 2px;
    flex-wrap: wrap;
}

.affe-fomo {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-height: 24px;
    margin: 0;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fff3d6;
    color: #8a4600;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.affe-fomo.is-discount {
    background: #fff0cf;
    color: #8a4300;
}

.affe-fomo.is-lowest,
.affe-fomo.is-drop {
    background: #eef6ec;
    color: #245b2c;
}

.affe-fomo.is-stock {
    background: #fff0e7;
    color: #993d00;
}

.affe-savings {
    color: #4d5c69;
    font-size: 12px;
    font-weight: 700;
}

.affe-price-block {
    row-gap: 4px;
}

@media (max-width: 700px) {
    .affe-offer-signal {
        gap: 7px;
    }

    .affe-fomo,
    .affe-savings {
        font-size: 11px;
    }
}

/* 0.12.1: distinct commercial states. */
.affe-product-card.is-preorder {
    border-color: #e2d8bf;
}

.affe-product-card.is-coming-soon {
    border-color: #d8dde3;
}

.affe-availability.is-coming-soon {
    border-color: #e8d7a7;
    background: #fff8e5;
    color: #7a5200;
}

.affe-availability.is-unknown {
    border-color: #d8dde3;
    background: #f7f8f9;
    color: #69737d;
}


/* 0.12.2: larger product imagery on desktop and mobile. */
@media (min-width: 901px) {
    .affe-product-card {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .affe-product-media {
        min-height: 260px;
        padding: 10px;
    }

    .affe-product-media img {
        width: 100%;
        height: 100%;
        max-width: 260px;
        max-height: 250px;
        object-fit: contain;
    }
}

@media (min-width: 701px) and (max-width: 900px) {
    .affe-product-card {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .affe-product-media {
        min-height: 225px;
        padding: 10px;
    }

    .affe-product-media img {
        max-width: 215px;
        max-height: 215px;
    }
}

@media (max-width: 700px) {
    .affe-product-media {
        min-height: 285px;
        padding: 10px 10px 8px;
    }

    .affe-product-media img {
        width: auto;
        height: auto;
        max-width: min(300px, 96%);
        max-height: 270px;
    }
}

@media (max-width: 390px) {
    .affe-product-media {
        min-height: 260px;
    }

    .affe-product-media img {
        max-width: min(280px, 96%);
        max-height: 245px;
    }
}


/* 0.13.0: editorial ranking position and optional label. */
.affe-ranking-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 9px;
}
.affe-position-badge,
.affe-editorial-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
}
.affe-position-badge {
    background: #17324d;
    color: #fff;
    letter-spacing: .04em;
}
.affe-editorial-badge {
    background: #fff0cf;
    color: #7b4300;
}
@media (max-width: 700px) {
    .affe-ranking-badges {
        margin-bottom: 8px;
    }
    .affe-position-badge,
    .affe-editorial-badge {
        min-height: 24px;
        padding: 4px 8px;
        font-size: 10px;
    }
}
