/* ══════════════════════════════════════════════════════
   South Pizza Hot Deals v2
   ══════════════════════════════════════════════════════ */

.sphdv2-section {
    width: 100%;
    padding: 32px 0 48px;
    background: var(--sphdv2-section-bg, #fff);
    box-sizing: border-box;
}

.sphdv2-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ── Top Banner ── */
.sphdv2-banner {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.sphdv2-banner__link {
    display: block;
    line-height: 0;
}

.sphdv2-banner__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform .4s ease;
}

.sphdv2-banner:hover .sphdv2-banner__img {
    transform: scale(1.015);
}

/* ── Cards Grid ── */
.sphdv2-cards {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, 1fr);
}
.sphdv2-cards[data-count="5"] { grid-template-columns: repeat(5, 1fr); }
.sphdv2-cards[data-count="6"] { grid-template-columns: repeat(3, 1fr); }
.sphdv2-cards[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.sphdv2-cards[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.sphdv2-cards[data-count="1"] { grid-template-columns: 1fr; }

/* ── Deal Card ── */
.sphdv2-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,.18);
    transition: transform .2s ease, box-shadow .2s ease;
    background: var(--sphdv2-card-bg, #1a0a00);
}

.sphdv2-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.sphdv2-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* ── Image wrap — button lives INSIDE here ── */
.sphdv2-card__img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;   /* default; overridden per-card via inline style */
    overflow: hidden;
    background: #222;
    display: block;
}

/* Inline style from admin overrides default aspect ratio */
.sphdv2-card__img-wrap[style] {
    aspect-ratio: unset;
}

.sphdv2-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.sphdv2-card:hover .sphdv2-card__img {
    transform: scale(1.05);
}

.sphdv2-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    color: #555;
}

/* Gradient overlay — darker at bottom so button is readable */
.sphdv2-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 45%,
        rgba(0,0,0,.65) 100%
    );
    pointer-events: none;
}

/* ── Badge — top-left ── */
.sphdv2-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--sphdv2-badge-bg, #e74c3c);
    color: var(--sphdv2-badge-text, #fff);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 4px;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* ── CTA Button — pinned bottom-right inside image ── */
.sphdv2-card__cta {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    /* colours set via inline style (per-card or global) */
    background: var(--sphdv2-btn-bg, #e74c3c);
    color: var(--sphdv2-btn-text, #fff);
    font-size: .78rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;       /* pill shape like reference image */
    letter-spacing: .2px;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
    transition: filter .18s ease, transform .18s ease;
    pointer-events: none;      /* parent <a> handles the click */
}

.sphdv2-card:hover .sphdv2-card__cta {
    filter: brightness(1.15);
    transform: scale(1.05);
}

/* ── No-overlay mode ── */
.sphdv2-card--no-overlay .sphdv2-card__overlay { display: none; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */

@media (max-width: 960px) {
    .sphdv2-cards[data-count="5"] { grid-template-columns: repeat(3, 1fr); }
    .sphdv2-cards[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .sphdv2-section { padding: 20px 0 32px; }
    .sphdv2-inner   { padding: 0 12px; }

    .sphdv2-cards,
    .sphdv2-cards[data-count] {
        grid-template-columns: repeat(2, 1fr);
    }

    .sphdv2-card__cta { font-size: .72rem; padding: 6px 11px; }
}

@media (max-width: 400px) {
    .sphdv2-cards,
    .sphdv2-cards[data-count] { grid-template-columns: 1fr; }
}
