/* Featured Ads carousel — wraps the dogs-for-sale .listing-card in a Swiper.
   Mirrors the new listing-grid card design (commit cf3ae2b family + the v2
   redesign): category pill top-left, gold BOOSTED diagonal ribbon top-right,
   photo-count bottom-right, title + breed + price/location row + footer with
   verified-breeder check icon. All sizing is responsive — image uses
   aspect-ratio: 4 / 3 instead of fixed pixel padding-top. */

/* ============ WRAPPER ============ */
.featured-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1432px;
    margin: 0 auto 80px auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.featured-cards-wrapper .featured-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.featured-cards-wrapper .featured-cards h2 {
    font-family: var(--v2-font);
    font-weight: 600;
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--text-green);
    margin-bottom: 0;
}

.featured-cards-wrapper .featured-cards p {
    font-family: var(--v2-font);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0;
    color: var(--text-green);
    margin-bottom: 0;
}

/* Swiper root — must clip its own horizontal overflow so slide transforms
   never push the carousel beyond the page width. */
.featured-cards-wrapper .myBoostedAdverts {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 8px 0;
}

/* ============ CARD ============ */
.featured-cards-wrapper .listing-card {
    position: relative;
    background: var(--v2-bg-card, #fff);
    border: none;
    border-radius: 12px;
    text-decoration: none !important;
    color: var(--v2-fg, var(--text-color)) !important;
    overflow: hidden;
    box-shadow:
        0 1px 3px 0 hsla(0, 0%, 0%, 0.06),
        0 1px 2px -1px hsla(0, 0%, 0%, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-cards-wrapper .listing-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 10px 25px -5px hsla(0, 0%, 0%, 0.10),
        0 8px 10px -6px hsla(0, 0%, 0%, 0.08);
}

/* ============ IMAGE AREA + OVERLAYS ============ */
.featured-cards-wrapper .listing-image {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    overflow: hidden;
    background: hsl(40, 33%, 96%);
    border-radius: 0;
    padding-top: 0;
}

.featured-cards-wrapper .listing-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    border-radius: 0;
    transition: transform 0.5s ease;
}

.featured-cards-wrapper .listing-card:hover .listing-image img {
    transform: scale(1.05);
}

/* Sold overlay */
.featured-cards-wrapper .listing-sold {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.featured-cards-wrapper .listing-sold img {
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    transition: none;
}

/* Boosted ribbon — diagonal gold corner ribbon, top-right */
.featured-cards-wrapper .listing-featured-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 110px;
    height: 110px;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.featured-cards-wrapper .listing-featured-ribbon span {
    position: absolute;
    top: 18px;
    right: -32px;
    transform: rotate(45deg);
    display: block;
    width: 150px;
    text-align: center;
    background: var(--v2-accent, var(--yellow));
    color: #1a1a1a;
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 4px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Photo count badge — bottom-right, dark glass with Camera icon */
.featured-cards-wrapper .listing-image-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-family: var(--v2-font);
    font-size: 12px;
    font-weight: 500;
}

.featured-cards-wrapper .listing-image-count svg {
    width: 12px;
    height: 12px;
    display: block;
}

/* ============ CONTENT ============ */
.featured-cards-wrapper .listing-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    flex: 1 1 auto;
}

.featured-cards-wrapper .listing-content .listing-title {
    font-family: var(--v2-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--v2-fg, var(--text-green)) !important;
    line-height: 1.4 !important;
    letter-spacing: normal !important;
    margin: 0 0 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    transition: color 0.2s ease;
}

.featured-cards-wrapper .listing-card:hover .listing-title {
    color: var(--v2-primary, var(--text-green)) !important;
}

.featured-cards-wrapper .listing-breed {
    font-family: var(--v2-font);
    font-size: 12px;
    color: var(--v2-muted, #666);
    margin: 0 0 8px;
    letter-spacing: normal;
}

/* Price + location row */
.featured-cards-wrapper .listing-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.featured-cards-wrapper .listing-price {
    font-family: var(--v2-font);
    font-size: 18px;
    font-weight: 700;
    color: var(--v2-fg, var(--text-green));
    letter-spacing: normal;
    /* Override the legacy flex-with-gap rule from the old design */
    display: inline;
    margin: 0;
    gap: 0;
}

.featured-cards-wrapper .listing-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--v2-font);
    font-size: 12px;
    color: var(--v2-muted, #666);
    letter-spacing: normal;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-cards-wrapper .listing-location svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    display: block;
}

/* Footer row — top-border separator with seller (verified icon inline) + date */
.featured-cards-wrapper .listing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--v2-border, #eee);
}

.featured-cards-wrapper .listing-seller {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--v2-font);
    font-size: 12px;
    color: var(--v2-muted, #666);
    letter-spacing: normal;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.featured-cards-wrapper .listing-time {
    font-family: var(--v2-font);
    font-size: 12px;
    color: var(--v2-muted, #666);
    flex-shrink: 0;
    letter-spacing: normal;
}

/* ============ SWIPER NAV ============ */
.myBoostedAdverts .swiper {
    padding: 8px 0;
}

.myBoostedAdverts .swiper-slide {
    height: auto;
    display: flex;
    justify-content: stretch;
}

.myBoostedAdverts .swiper-button-next,
.myBoostedAdverts .swiper-button-prev {
    color: var(--white);
    background-color: var(--green);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-top: -18px;
}

.myBoostedAdverts .swiper-button-next:hover,
.myBoostedAdverts .swiper-button-prev:hover {
    background-color: var(--green-hover);
}

.myBoostedAdverts .swiper-button-next:after,
.myBoostedAdverts .swiper-button-prev:after {
    font-weight: 300;
    font-size: 12px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .featured-cards-wrapper {
        padding: 0 16px;
        margin-bottom: 60px;
    }
}

@media (max-width: 768px) {
    .featured-cards-wrapper {
        gap: 16px;
        margin-bottom: 48px;
    }

    .featured-cards-wrapper .featured-cards {
        gap: 6px;
    }

    .featured-cards-wrapper .featured-cards h2 {
        font-weight: 600;
        font-size: 24px;
        line-height: 1.25;
    }

    .featured-cards-wrapper .featured-cards p {
        font-size: 14px;
        line-height: 1.4;
    }

    .featured-cards-wrapper .listing-content {
        padding: 12px;
        gap: 4px;
    }

    .featured-cards-wrapper .listing-price {
        font-size: 16px;
    }

    /* Hide nav buttons on touch widths — users swipe instead */
    .myBoostedAdverts .swiper-button-next,
    .myBoostedAdverts .swiper-button-prev {
        display: none;
    }
}

@media (max-width: 450px) {
    .featured-cards-wrapper .listing-content .listing-title {
        font-size: 13px !important;
    }

    .featured-cards-wrapper .listing-breed,
    .featured-cards-wrapper .listing-location,
    .featured-cards-wrapper .listing-seller,
    .featured-cards-wrapper .listing-time {
        font-size: 11px;
    }
}

/* Verified-breeder ribbon. Mirrors the boosted ribbon's construction; see the long note
   in dogsforsale.css for why the slot is chosen in Blade rather than with :nth-child. */
/* Paired with VERIFIED, BOOSTED moves outward from the corner as well. Band length is the
   chord the band cuts across the clip box, and a band nearer the corner cuts a SHORTER one --
   at top:18 in a 110px box that is ~100px against VERIFIED's ~157px, which is why the gold
   band read as a stub beside the green one. Moving it to 32px in a 140px box takes it to
   ~120px. Growing the box alone does nothing; the offset is what changes the chord.

   The outer band of a stacked pair is always the longer one -- that is inherent to two
   parallel chords of a square corner, not something these numbers can cancel out. */
.featured-cards-wrapper .listing-featured-ribbon.ribbon-paired {
    width: 140px;
    height: 140px;
}

.featured-cards-wrapper .listing-featured-ribbon.ribbon-paired span {
    top: var(--ribbon-slot-0-paired, 32px);
}

.featured-cards-wrapper .listing-verified-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 110px;
    height: 110px;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
    --ribbon-slot-1: 72px;
}

.featured-cards-wrapper .listing-verified-ribbon span {
    position: absolute;
    top: 18px;
    right: -32px;
    transform: rotate(45deg);
    display: block;
    width: 150px;
    text-align: center;
    background: hsl(140, 50%, 46%);
    color: #fff;
    font-family: var(--v2-font);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 4px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Paired with BOOSTED, the two bands touched exactly and read as a single two-tone
   wedge. The bands are rotated 45deg, so a vertical offset V yields a PERPENDICULAR
   separation of V*cos(45) = V*0.707 -- the old 28px offset gave 19.8px against a band
   ~20px tall, i.e. zero gap. Perpendicular gap G needs V = (bandHeight + G) / 0.707.

   58px here is a ~8px gap. It also needs a bigger clip box: further from the corner the
   band crosses a shorter chord, so the 110px box that suits slot 0 truncates slot 1.
   Only the slot-1 case is enlarged, so a lone VERIFIED ribbon is pixel-identical to
   what it is today. Both numbers are meant to be tuned by eye. */
.featured-cards-wrapper .listing-verified-ribbon.ribbon-slot-1 {
    width: 140px;
    height: 140px;
}

.featured-cards-wrapper .listing-verified-ribbon.ribbon-slot-1 span {
    top: var(--ribbon-slot-1);
}
