:root {
    /* Tunable design tokens */
    --coupon-max-width: 720px;
    --coupon-padding-mobile: 12px;
    --coupon-padding-desktop: 20px;
    --coupon-radius: 14px;
    --coupon-bg-start: rgba(255,255,255,0.95);
    --coupon-bg-end: rgba(250,250,250,0.9);
    --coupon-shadow: 0 8px 28px rgba(20,20,40,0.06);
    --accent-ribbon-start: #ff6b6b;
    --accent-ribbon-end: #ff3b3b;
    /* Fluid type sizes */
    --title-size: clamp(1.05rem, 1.6vw, 1.25rem);
    --subtitle-size: clamp(0.85rem, 1.2vw, 1rem);
    --meta-size: clamp(0.75rem, 1vw, 0.9rem);
}

/* Base frame */
.coupon-frame {
    position: relative;
    width: 100%;
    max-width: var(--coupon-max-width);
    margin: 0 auto;
    padding: var(--coupon-padding-desktop);
    border-radius: var(--coupon-radius);
    background: linear-gradient(180deg, var(--coupon-bg-start), var(--coupon-bg-end));
    box-shadow: var(--coupon-shadow), inset 0 1px 0 rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: stretch;
    gap: 18px;
    box-sizing: border-box;
}

/* Make the inner card transparent so Bootstrap styles still apply */
.coupon-card {
    background: transparent;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Layout: on wide screens show logo and content side-by-side */
.coupon-inner {
    display: flex;
    gap: 18px;
    align-items: center;
}

/* Logo column */
.logo-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 6px;
}

/* Content column stretches */
.coupon-content {
    flex: 1 1 auto;
    min-width: 0; /* allow text truncation/wrapping */
}

/* Merchant logo sizing fluid */
.merchant-logo {
    width: clamp(56px, 9vw, 96px);
    height: clamp(56px, 9vw, 96px);
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid rgba(0,0,0,0.06);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Text sizes */
.coupon-frame h5 {
    font-size: var(--title-size);
    margin-bottom: 0.25rem;
}

.coupon-frame p.small,
.coupon-frame .meta {
    font-size: var(--meta-size);
}

.coupon-frame .subtitle {
    font-size: var(--subtitle-size);
    margin-bottom: 0.5rem;
    color: #6c757d;
}

/* Ribbon for new coupons */
.ribbon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(90deg, var(--accent-ribbon-start), var(--accent-ribbon-end));
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    letter-spacing: 0.6px;
    z-index: 5;
}

/* Button styling */
.coupon-frame .btn {
    padding: 10px 14px;
    font-weight: 600;
}

/* Mobile first adjustments */
@media (max-width: 575.98px) {
    .coupon-frame {
        padding: var(--coupon-padding-mobile);
        border-radius: 10px;
        gap: 12px;
    }

    /* Stack vertically on small screens */
    .coupon-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .logo-wrap {
        padding-right: 0;
    }

    .merchant-logo {
        width: 64px;
        height: 64px;
        border-radius: 50%;
    }

    .coupon-frame .btn {
        font-size: 0.95rem;
    }

    .ribbon {
        top: 10px;
        right: 10px;
        padding: 5px 8px;
        font-size: 11px;
    }
}


/* Arrow-only top-left button */
.coupon-frame .top-left-arrow {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 12;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.06);
    color: #333;
    text-decoration: none;
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

    /* Hover / focus states */
    .coupon-frame .top-left-arrow:hover,
    .coupon-frame .top-left-arrow:focus {
        transform: translateY(-2px);
        background: #fff;
        box-shadow: 0 10px 24px rgba(0,0,0,0.10);
        outline: none;
    }

/* Smaller on very small screens */
@media (max-width: 575.98px) {
    .coupon-frame .top-left-arrow {
        top: 8px;
        left: 8px;
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }

        .coupon-frame .top-left-arrow svg {
            width: 18px;
            height: 18px;
        }
}


/* Tablet / small desktop */
@media (min-width: 576px) and (max-width: 991.98px) {
    .coupon-frame {
        padding: 16px;
        gap: 14px;
    }

    .coupon-inner {
        flex-direction: row;
        align-items: center;
    }

    .merchant-logo {
        width: 72px;
        height: 72px;
        border-radius: 12px;
    }
}

/* Large desktop: allow a wider layout and subtle hover lift */
@media (min-width: 992px) {
    .coupon-frame {
        padding: var(--coupon-padding-desktop, 20px);
        gap: 20px;
        transition: transform 180ms ease, box-shadow 180ms ease;
    }

        .coupon-frame:hover {
            transform: translateY(-4px);
            box-shadow: 0 18px 48px rgba(20,20,40,0.12);
        }

    .coupon-inner {
        flex-direction: row;
        align-items: center;
    }

    .merchant-logo {
        width: 84px;
        height: 84px;
        border-radius: 12px;
    }

    /* Slightly larger title on wide screens */
    .coupon-frame h5 {
        font-size: clamp(1.15rem, 1.2vw, 1.35rem);
    }
}
