:root {
    --primary-color: #2C3E50;
    --secondary-color: #E74C3C;
    --success-color: #27AE60;
    --warning-color: #F39C12;
    --text-color: #1a1a2e;
    --text-muted: #64748b;
    --light-gray: #f5f5f5;
    --border-color: #e2e8f0;
    --accent-color: #0891b2;
    --accent-gradient: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
    --cta-color: #EA580C;
    --cta-gradient: linear-gradient(135deg, #EA580C 0%, #F97316 100%);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Navigation and Header Styles */
.top-nav {
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    padding: 6px 0;
    position: relative;
    z-index: 10;
}

.top-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo-link {
    display: block;
}

.couponsite-logo {
    height: 32px;
    width: auto;
    max-width: 130px;
}

.nav-extras {
    display: flex;
    align-items: center;
}

.commission-note {
    font-size: 12px;
    color: #777;
    display: none; /* Hide on mobile */
}

/* Merchant Header Section */
.merchant-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.merchant-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.merchant-logo-wrapper {
    width: 72px;
    height: 72px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    flex-shrink: 0;
}

#merchantLogoContainer {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.merchant-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.no-logo-text {
    color: #999;
    font-size: 14px;
    text-align: center;
}

.merchant-details {
    flex: 1;
    min-width: 0; /* For text truncation */
}

.merchant-name {
    font-size: 1.25rem;
    margin: 0 0 4px 0;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.merchant-subtitle {
    font-weight: 500;
    color: var(--text-muted);
}

.merchant-tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 4px 0 8px 0;
    line-height: 1.4;
}

.merchant-tagline:empty {
    display: none;
}

.merchant-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #8c8c8c;
    flex-wrap: wrap;
}

.verified-count {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.verified-count i {
    color: #4caf50;
}

.count-section {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.count-section:not(.last-visible):not(.hidden) {
    margin-right: 8px;
}

.count-section:not(.last-visible):not(.hidden)::after {
    content: "•";
    margin-left: 8px;
    color: #ccc;
}

.count-section.hidden {
    display: none;
}

.separator {
    margin: 0 8px;
    color: #ccc;
}

/* Mobile responsive styles for merchant header */
@media (max-width: 768px) {
    /* Float logo left so text flows beside and under it */
    .merchant-info {
        display: block;
    }
    
    .merchant-logo-wrapper {
        float: left;
        width: 56px;
        height: 56px;
        margin-right: 10px;
        margin-bottom: 6px;
        border: none; /* Remove border on mobile */
    }
    
    .merchant-details {
        overflow: visible; /* Allow content to flow under floated logo */
    }
    
    .merchant-name {
        font-size: 1.0625rem;
        margin-bottom: 2px;
    }
    
    .merchant-tagline {
        display: none; /* Hide on mobile - shown in About section instead */
    }
    
    /* Stats - simplified for mobile */
    .merchant-stats {
        display: block;
        font-size: 0.75rem;
        line-height: 1.4;
        margin-top: 2px;
    }
    
    .verified-count {
        display: inline;
    }
    
    .count-section {
        display: inline;
    }
    
    .count-section:not(.last-visible):not(.hidden)::after {
        content: "•";
        margin: 0 5px;
        color: #ccc;
    }
    
    .separator {
        display: inline;
        margin: 0 5px;
    }
    
    .last-verified {
        display: inline;
    }
    
    /* Commission - start below logo */
    .commission-disclosure {
        clear: left;
        margin-top: 4px;
    }
    
    .commission-note {
        display: block;
        font-size: 0.7rem;
        line-height: 1.3;
        color: #999;
    }
}

/* Small phones only - more aggressive space saving */
@media (max-width: 520px) {
    /* Shorten "Promo Codes and Coupons" to just "Coupons" */
    .merchant-subtitle {
        font-size: 0;
    }
    
    .merchant-subtitle::after {
        content: "Coupons";
        font-size: 1.0625rem;
        font-weight: 500;
        color: var(--text-muted);
    }
    
    /* Hide "Current as of" date */
    .separator,
    .last-verified {
        display: none !important;
    }
}

/* Commission disclosure styling */
.commission-disclosure {
    margin-top: 12px;
}

.commission-note {
    font-size: 0.7rem;
    color: #999;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.link-text {
    color: #666;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.link-text:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Safari-specific text smoothing */
@supports (-webkit-appearance: none) {
    .commission-note {
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }
    
    .link-text {
        -webkit-font-smoothing: antialiased;
    }
}

/* Main Content Styles */
main.container {
    padding-top: 20px;
    padding-bottom: 40px;
}

/* Deal cards - Single column list layout */
.deals-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
    max-width: 800px;
}

/* Footer - Stable layout to prevent CLS */
.site-footer {
    margin-top: 40px;
    padding: 40px 0 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #6b7280;
    /* Prevent layout shifts with containment */
    contain: layout style;
}

/* Desktop: 4 columns */
.gh-footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.gh-footer-content-column {
    min-height: 120px; /* Reserve space to prevent CLS */
}

.gh-footer-content-column h4 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    margin-top: 0;
    line-height: 1.2; /* Explicit line-height prevents font-swap shifts */
}

.gh-footer-content-column p {
    line-height: 1.6;
    margin-bottom: 16px;
    color: #6b7280;
}

.gh-footer-content-column nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gh-footer-content-column nav a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
    line-height: 1.5; /* Explicit line-height */
    min-height: 24px; /* Reserve space for each link */
}

.gh-footer-content-column nav a:hover {
    color: #1f2937;
}

.gh-footer-copyright-text {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 20px;
    line-height: 1.4;
}

.gh-footer-social {
    display: flex;
    gap: 16px;
}

.gh-footer-social a {
    color: rgb(0 0 0 / 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgb(0 0 0 / 0.05);
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    flex-shrink: 0; /* Prevent shrinking */
}

.gh-footer-social a:hover {
    color: #15171a;
    background-color: #e6e6e6;
}

.gh-footer-social svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.footer-disclosure {
    border-top: 1px solid #e5e7eb;
    padding-top: 20px;
    text-align: center;
}

.footer-disclosure .commission-note {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
}

/* Mobile-only copyright - hidden on desktop */
.footer-copyright-mobile {
    display: none;
}

/* Tablet: 2x2 grid */
@media (max-width: 1024px) {
    .gh-footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px 40px;
    }
    
    .gh-footer-content-column {
        min-height: 100px;
    }
}

/* Mobile: compact footer */
@media (max-width: 640px) {
    .site-footer {
        padding: 20px 0 12px;
        margin-top: 30px;
    }
    
    .gh-footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 16px 12px;
    }
    
    .gh-footer-content-column {
        min-height: auto;
        text-align: left;
    }
    
    /* Hide entire About section on mobile */
    .gh-footer-content-column:first-child {
        display: none;
    }
    
    .gh-footer-content-column h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .gh-footer-content-column nav {
        gap: 4px;
        align-items: flex-start;
    }
    
    .gh-footer-content-column nav a {
        font-size: 12px;
        min-height: 20px;
        line-height: 1.4;
    }
    
    /* Social column spans full width at bottom */
    .gh-footer-content-column:last-child {
        grid-column: 1 / -1;
        text-align: center;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid #e5e7eb;
    }
    
    .gh-footer-content-column:last-child h4 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .gh-footer-social {
        justify-content: center;
        gap: 12px;
    }
    
    .gh-footer-social a {
        width: 36px;
        height: 36px;
    }
    
    .gh-footer-social svg {
        width: 18px;
        height: 18px;
    }
    
    .footer-disclosure {
        padding-top: 12px;
        margin-top: 8px;
    }
    
    .footer-disclosure .commission-note {
        font-size: 11px;
    }
    
    /* Show copyright on mobile */
    .footer-copyright-mobile {
        display: block;
        margin: 6px 0 0 0;
        font-size: 10px;
        color: #9ca3af;
    }
}

/* Merchant About Section */
.merchant-about {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    max-width: 800px;
    border: 1px solid var(--border-color);
}

.merchant-about h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

/* Long description / About section */
.merchant-long-desc {
    font-size: 14px;
    line-height: 1.65;
    color: #555;
}

.merchant-long-desc:empty {
    display: none;
}

.merchant-long-desc h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}

.merchant-long-desc p {
    margin-bottom: 1em;
}

.merchant-long-desc p:last-child {
    margin-bottom: 0;
}

/* Separator between long_desc and text_bottom when both exist */
.merchant-long-desc:not(:empty) + .merchant-text-bottom:not(:empty) {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.merchant-description {
    margin-bottom: 20px;
    font-size: 15px;
    color: #444;
}

.merchant-text-bottom {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.merchant-text-bottom h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-color);
}

.merchant-text-bottom h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-top: 1.25em;
    margin-bottom: 0.4em;
    color: var(--text-color);
}

.merchant-text-bottom h1,
.merchant-text-bottom h4,
.merchant-text-bottom h5,
.merchant-text-bottom h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-color);
}

.merchant-text-bottom h1:first-child,
.merchant-text-bottom h2:first-child,
.merchant-text-bottom h3:first-child,
.merchant-text-bottom h4:first-child,
.merchant-text-bottom h5:first-child,
.merchant-text-bottom h6:first-child {
    margin-top: 0;
}

.merchant-text-bottom p {
    margin-bottom: 1em;
}

.merchant-text-bottom ul,
.merchant-text-bottom ol {
    margin-bottom: 1em;
    padding-left: 20px;
}

.merchant-text-bottom li {
    margin-bottom: 0.5em;
}

/* FAQ Definition List styling */
.merchant-text-bottom dl {
    margin: 0 0 1.5em 0;
}

.merchant-text-bottom dt {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    margin-top: 0.9em;
    margin-bottom: 0.2em;
}

.merchant-text-bottom dt:first-child {
    margin-top: 0;
}

.merchant-text-bottom dd {
    margin: 0 0 1em 0;
    padding-left: 0;
    color: #555;
    line-height: 1.6;
}

/* Horizontal rule styling */
.merchant-text-bottom hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5em 0;
}

/* Quote styling */
.merchant-text-bottom q {
    font-style: italic;
}

/* Ordered list styling for how-to sections */
.merchant-text-bottom ol {
    margin-bottom: 1em;
    padding-left: 24px;
    counter-reset: item;
}

.merchant-text-bottom ol li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}



/* Responsive adjustments */
@media (min-width: 768px) {
    .merchant-logo-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .merchant-name {
        font-size: 1.5rem;
    }
    
    .merchant-subtitle {
        font-size: 15px;
    }
    
    .commission-note {
        display: block;
    }
}

/* Tablet: Adjust card spacing */
@media (max-width: 768px) {
    .deals-grid,
    .merchant-about {
        max-width: 100%;
    }
    
    .deal-content {
        padding: 16px 20px;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .merchant-logo-wrapper {
        width: 64px;
        height: 64px;
    }
    
    .merchant-name {
        font-size: 1.125rem;
    }
}

/* Deal card styles - Horizontal list layout with left accent */
.deal-card {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    cursor: pointer;
}

.deal-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.08);
    border-left-color: #22d3ee;
    transform: translateY(-2px);
}

/* =============================================
   TOP OFFER / BEST DEAL STYLES
   ============================================= */
.deal-card.top-offer {
    background-color: rgba(8, 145, 178, 0.025);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.deal-card.top-offer:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15), 0 12px 36px rgba(0, 0, 0, 0.1);
}

/* Badges row: Best Offer + tags (Hot/Exclusive/New) — flush to top of card */
.deal-badges {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 0 0 0 20px;
}

.best-offer-badge,
.deal-badges .tag {
    font-size: 10px;
    font-weight: 700;
    padding: 5px 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0 0 6px 6px;
    color: white;
    line-height: 1;
}

.best-offer-badge {
    background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.3);
}


/* Subtle glow animation on top offer button */
.deal-card.top-offer .deal-button {
    animation: pulse-glow 2s ease-in-out infinite;
}

.deal-card.top-offer .deal-button:hover {
    animation: none;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4);
    }
    50% {
        box-shadow: 0 0 16px 3px rgba(234, 88, 12, 0.2);
    }
}

.deal-card.expired {
    opacity: 0.6;
    border-left-color: #94a3b8;
}

.deal-card.upcoming::after {
    content: "Coming Soon";
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #fbbf24;
    color: #78350f;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.deal-card.expired::after {
    content: "Expired";
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #f1f5f9;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.deal-content {
    padding: 20px 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    gap: 20px;
}

/* Top offer: normal padding since badges hang from top edge */
.deal-card.top-offer .deal-content {
    padding-top: 20px;
}

/* Large discount badge (left side) */
.deal-discount-large {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.375rem;
    font-weight: 800;
    color: var(--text-color);
    min-width: 80px;
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.1;
    padding: 4px 22px 4px 0;
    border-right: 2px solid var(--border-color);
}

/* Deal info section (middle) */
.deal-info {
    flex: 1;
    min-width: 0;
}

/* Button section (right side) */
.deal-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Tags are now inside .deal-badges row — no absolute positioning needed */

.tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    letter-spacing: 0.04em;
}

.tag.exclusive {
    background: linear-gradient(135deg, #9333ea 0%, #c026d3 100%);
}

.tag.hot {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

.tag.new {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.deal-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
    line-height: 1.4;
}

.deal-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.5;
}

.deal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Verified badge on each deal card */
.deal-verified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #059669;
    font-weight: 600;
}

.deal-verified .icon {
    width: 0.9em;
    height: 0.9em;
}

/* Dot separator between meta items (Verified • Used X times • Expires in...) */
.deal-meta > span + span::before {
    content: "·";
    margin-right: 10px;
    color: #cbd5e1;
    font-weight: 400;
}

/* Usage social proof — slightly bolder to draw the eye */
.deal-usage {
    color: #374151;
    font-weight: 600;
}

/* Expiry urgency levels */
.deal-expiry.expiry-urgent {
    color: #dc2626;
    font-weight: 600;
}

.deal-expiry.expiry-warning {
    color: #d97706;
    font-weight: 600;
}

.deal-expiry.expiry-soon {
    color: #92400e;
}

.deal-button {
    background: var(--cta-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 130px;
    text-align: center;
}

.deal-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

.deal-button:active {
    transform: translateY(0);
}

/* Peel-off corner on "Show Code" buttons — RetailMeNot-style visual cue
   that a coupon code is hidden underneath. The folded corner creates a
   "peel to reveal" metaphor. Only applied to code buttons inside deal cards
   (not .activate, not modal buttons). */
.deal-card .deal-button:not(.activate) {
    position: relative;
    overflow: hidden;
    padding-right: 32px; /* extra space so text doesn't tuck under the fold */
}

.deal-card .deal-button:not(.activate)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px;
    border-color: #fff #fff #c2410c #c2410c;
    border-bottom-left-radius: 3px;
    transition: border-width 0.15s ease;
}

.deal-card .deal-button:not(.activate):hover::after {
    border-width: 17px;
}

/* Revealed code display (after Show Code is clicked) */
.revealed-code {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    padding: 10px 20px;
    font-family: 'Plus Jakarta Sans', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.revealed-code .code-text {
    -webkit-user-select: all;
    -moz-user-select: all;
    user-select: all;
}

/* Modal styles for coupon code display */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.code-modal {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

.code-modal h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Merchant branding in modal */
.modal-merchant-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #f8fafc;
    padding: 8px;
    border: 1px solid #e2e8f0;
}

.modal-merchant-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.modal-deal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.modal-deal-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.coupon-code {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 16px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', monospace;
    margin-bottom: 20px;
    -webkit-user-select: all;
    -moz-user-select: all;
    user-select: all;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px dashed var(--border-color);
    letter-spacing: 0.05em;
}

.coupon-code:hover {
    border-color: var(--accent-color);
}

/* Modal button inherits main button styles */

.modal-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: var(--text-color);
    transform: scale(1.05);
}

/* Post-copy confirmation and shop button */
.modal-post-copy {
    text-align: center;
    margin-top: 10px;
}

.modal-copy-confirm {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
}

.modal-shop-btn {
    display: inline-block;
    background: var(--cta-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.modal-shop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

.modal-shop-btn:active {
    transform: translateY(0);
}

/* Helper classes */
.error-message, .no-deals-message {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.error-message {
    text-align: center;
    padding: 30px;
    background-color: #fff1f0;
    border-radius: 8px;
    color: #cf1322;
    margin: 20px 0;
    border: 1px solid #ffa39e;
}

.error-message h3 {
    margin-bottom: 10px;
    color: #cf1322;
}

.error-details {
    margin-top: 20px;
    text-align: left;
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    color: #333;
}

.error-details ul {
    margin-top: 10px;
    margin-left: 20px;
}

.error-details li {
    margin-bottom: 5px;
}

/* Divider between active and expired deals */
.deals-divider {
    position: relative;
    width: 100%;
    text-align: center;
    margin: 32px 0 24px;
}

.deals-divider::before {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    z-index: 0;
}

.deals-divider span {
    display: inline-block;
    background-color: #f8fafc;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#merchantLogoLink {
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#merchantLogoLink img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* =============================================
   DEAL CARD - MOBILE OVERRIDES (<=640px)
   Must be AFTER base deal card styles to win cascade
   ============================================= */
@media (max-width: 640px) {
    .deal-content {
        flex-wrap: wrap;
        padding: 14px 16px;
        gap: 10px;
    }
    
    /* Discount badge: side-by-side with info on mobile */
    .deal-discount-large {
        font-size: 2rem;
        min-width: 50px;
        padding: 0 12px 0 0;
        border-right: 2px solid var(--border-color);
    }
    
    .deal-info {
        flex: 1;
        min-width: 0;
        padding-right: 0;
    }
    
    .deal-meta {
        justify-content: flex-start;
        margin-top: 4px;
    }
    
    /* Button: full width on its own row */
    .deal-actions {
        flex-basis: 100%;
        align-items: stretch;
    }
    
    .deal-button {
        width: 100%;
        padding: 12px 20px;
    }
    
    .deal-card {
        border-left-width: 4px;
    }
    
    .deal-title {
        font-size: 1.2rem;
    }
    
    .deal-description {
        font-size: 0.8125rem;
    }
    
    /* Badges row: flush top on mobile too */
    .deal-badges {
        padding: 0 0 0 16px;
        gap: 5px;
    }
    
    .best-offer-badge {
        font-size: 10px;
        padding: 5px 12px 4px;
    }
    
    .deal-card.top-offer .deal-content {
        padding-top: 14px;
    }
    
}