:root {
    --primary-blue: #0061ff;
    --primary-hover: #0052d9;
    --bg-body: #f5f7fa;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header & Navbar */
.navbar {
    background: var(--primary-blue);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo img {
    height: 40px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.auth-btns {
    display: flex;
    gap: 1rem;
}

.btn-outline {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    padding: 0.6rem 1.2rem;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

/* Hero Section (Innovativa Bianca) */
.hero-minimal {
    padding: 6rem 0;
    text-align: center;
    transition: all 0.3s ease;
    background: #ffffff;
    color: var(--text-main);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

/* Stile Esclusivo per la Home Page con Background Astratto Moderno */
.hero-minimal.hero-home {
    background: linear-gradient(135deg, rgba(0, 97, 255, 0.94), rgba(30, 64, 175, 0.88)), 
                url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&q=80&w=2000');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    border-bottom: none;
}

.hero-minimal.hero-home h1 {
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-minimal.hero-home p {
    color: rgba(255,255,255,0.9);
}

/* Sfumatura verso il basso solo per la Home */
.hero-minimal.hero-home::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, var(--bg-body), transparent);
    z-index: 1;
    display: block;
}

.hero-minimal::before {
    display: none;
}

.hero-minimal .container {
    position: relative;
    z-index: 2;
}

.hero-minimal h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1.5px;
    color: var(--text-main);
    text-shadow: none;
}

.hero-minimal p {
    color: var(--text-light);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    font-weight: 500;
}

.hero-minimal.hero-compact {
    padding: 1rem 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

/* Search Box (Ponss Style) */
.search-container {
    background: var(--white);
    padding: 8px;
    border-radius: 100px;
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.search-container input {
    flex: 1;
    border: none;
    padding: 0 1.5rem;
    outline: none;
    font-size: 1rem;
    border-radius: 100px;
}

.search-container button {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

/* Categories Bar - Clean Compact Badge Style */
.categories-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 1.5rem 0;
    scrollbar-width: none;
    justify-content: center;
    -ms-overflow-style: none;
}

.categories-nav::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    white-space: nowrap;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    text-decoration: none;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.cat-pill i {
    font-size: 0.9rem;
    color: #0061ff;
}

.cat-pill:hover {
    background: #f8fafc;
    border-color: #0061ff;
    color: #0061ff;
}

.cat-pill.active {
    background: #0061ff;
    color: #ffffff;
    border-color: #0061ff;
    box-shadow: 0 4px 12px rgba(0, 97, 255, 0.2);
}

.cat-pill.active i {
    color: #ffffff;
}

/* Layout Orizzontale per Risultati (Categorie/Ricerca) */
.coupons-list-horizontal {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* Miglioramento Coupon Card Horizontal per Categorie */
.coupon-card-horizontal {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 2rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.coupon-card-horizontal:hover {
    border-color: #0061ff;
    box-shadow: 0 10px 30px -10px rgba(0, 97, 255, 0.15);
    transform: translateY(-4px);
}

.merchant-side {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Fix logo su coupon-tutti.php: impedisce overflow e mantiene proporzioni */
.merchant-side a {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.merchant-side img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-container {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 5px;
}

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

.verified-badge {
    font-size: 0.65rem;
    font-weight: 700;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}

.coupon-info {
    flex: 1;
}

/* Miglioramento Badge Tipologia */
.type-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.type-badge.code {
    background: #fff7ed;
    color: #ea580c;
    border-color: #ffedd5;
}

.type-badge.deal {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #e0f2fe;
}

.coupon-info h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.25;
}

.coupon-info p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 12px;
}

.coupon-footer-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

.coupon-footer-meta i {
    margin-right: 4px;
}

.used-today {
    color: #64748b;
}

/* Smart Deals AI Section */
.ai-smart-deals {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border: 1px solid #d0e1ff !important;
    position: relative;
    overflow: hidden;
}

.ai-smart-deals::before {
    content: '\f0e7';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -10px;
    right: -5px;
    font-size: 4rem;
    color: rgba(0, 97, 255, 0.03);
    transform: rotate(15deg);
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #0061ff;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 50px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-suggestion-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.ai-suggestion-link:hover {
    border-color: #0061ff;
    color: #0061ff;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 97, 255, 0.08);
}

.ai-suggestion-link i {
    font-size: 0.75rem;
    opacity: 0.5;
}

.coupon-actions {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Fix Pulsante Scopri Coupon */
.code-button-wrapper {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.code-text-hidden {
    color: #94a3b8;
    font-weight: 800;
    font-family: 'Inter', monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.btn-main-action {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0061ff; /* Nuovo colore richiesto */
    color: white;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.code-button-wrapper:hover .btn-main-action {
    transform: translateX(85%);
}

.code-button-wrapper:hover {
    border-color: #0061ff;
    background: #eff6ff;
}

/* Specifiche per Offerta */
.deal-wrapper {
    border-style: solid;
    border-color: #e2e8f0;
}

.btn-deal-action {
    background: #0061ff; /* Nuovo colore richiesto */
}

.deal-wrapper:hover {
    border-color: #0061ff;
    background: #eff6ff;
}

.deal-wrapper .code-text-hidden {
    color: #0061ff;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.expiry-date {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    text-align: center;
    display: block;
}

@media (max-width: 768px) {
    .coupon-card-horizontal {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        text-align: center;
    }
    
    .merchant-side {
        width: 100%;
    }

    .merchant-side a {
        width: 120px;
        height: 60px;
        margin: 0 auto;
    }
    
    .logo-container {
        width: 120px;
        height: 60px;
    }
    
    .coupon-footer-meta {
        justify-content: center;
    }
    
    .coupon-actions {
        width: 100%;
    }
}

.btn-main {
    background: var(--primary-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.btn-main:hover {
    background: var(--primary-hover);
}

.expiry-date {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Descrizione Categoria in Basso */
.category-description-bottom {
    margin-top: 4rem;
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.category-description-bottom h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.category-description-bottom p {
    color: var(--text-light);
    line-height: 1.8;
}

@media (max-width: 768px) {
    .coupon-card-horizontal {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    .meta-top {
        justify-content: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .merchant-info-row {
        justify-content: center;
        width: 100%;
    }
    .coupon-actions {
        width: 100%;
    }
}

.swiper-pagination-bullet-active {
    background: var(--primary-blue) !important;
}

.featuredSwiper .swiper-slide {
    height: auto;
}
.seo-content-section {
    margin-top: 4rem;
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: var(--radius) var(--radius) 0 0;
}

.seo-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.seo-container h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.seo-container p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.seo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: left;
    margin: 2rem 0;
}

.seo-text-block p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.seo-footer-note {
    font-style: italic;
    border-top: 1px dashed var(--border-color);
    padding-top: 1.5rem;
}

@media (max-width: 768px) {
    .seo-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .seo-container h2 {
        font-size: 1.5rem;
    }
}

/* Coupons Grid (Innovativo) */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.coupon-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 0;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Brands Carousel Moderno */
.featured-brands-carousel {
    padding: 2rem 0;
}

.featured-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 20px 15px;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    margin: 5px;
}

.featured-logo-wrapper {
    width: 80px;
    height: 80px;
    background: var(--bg-body);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    transition: all 0.4s ease;
}

.featured-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.4s ease;
}

.featured-card .featured-badge-top {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff4d4d, #f97316);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(255, 77, 77, 0.3);
}

.featured-card .featured-offers-badge {
    background: rgba(0, 97, 255, 0.08);
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 50px;
    margin-top: 5px;
}

.featured-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 97, 255, 0.15);
    border-color: var(--primary-blue) !important;
}

.featured-card:hover .featured-offers-badge {
    background: var(--primary-blue);
    color: white;
}

.featured-card:hover .featured-logo-wrapper {
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 97, 255, 0.1);
    transform: scale(1.1);
}

.featured-card:hover .featured-logo-wrapper img {
    filter: grayscale(0);
    opacity: 1;
}

.featured-card:hover .featured-name {
    color: var(--primary-blue);
}

/* Pagination Swiper */
.swiper-pagination-bullet-active {
    background: var(--primary-blue) !important;
}

.card-header-promo {
    padding: 0;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.merchant-logo-container {
    width: 100%;
    height: 100%;
    margin: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.merchant-logo-container a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.merchant-logo-large {
    width: 140px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.coupon-card:hover .merchant-logo-large {
    transform: scale(1.08);
}

.card-body-promo {
    padding: 1rem 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.merchant-info-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.card-tp-stars {
    color: #00b67a;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 2px;
}

.merchant-name-link {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.merchant-name-link:hover {
    color: var(--primary-blue);
}

.cat-badge-link {
    text-decoration: none;
}

.cat-badge-soft {
    font-size: 9px;
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 97, 255, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.cat-badge-link:hover .cat-badge-soft {
    background: var(--primary-blue);
    color: white;
}

.coupon-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.3;
}

.coupon-card p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0;
}

.code-box-container {
    margin: 0 1.5rem 1rem;
}

.action-area {
    padding: 0 1.5rem 1.5rem;
}

.badge-verified {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: #ecfdf5;
    color: #059669;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid #d1fae5;
}

.btn-get-code {
    width: 100%;
    padding: 14px;
    background: rgba(0, 97, 255, 0.05);
    color: var(--primary-blue);
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    border-radius: 12px;
    display: block;
    border: 1px solid rgba(0, 97, 255, 0.15);
    transition: all 0.2s;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-family: 'Inter', monospace;
}

.btn-get-code:hover {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 97, 255, 0.2);
}

/* Code Box & Copy UI */
.code-box-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.code-box {
    font-family: 'Inter', monospace;
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.btn-copy-mini {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.btn-copy-mini:hover {
    color: var(--primary-blue);
}

.code-box-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.code-val {
    font-weight: 800;
    color: var(--primary-blue);
    font-size: 1rem;
}

.btn-copy-small {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-copy-small:hover {
    background: var(--primary-hover);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.badge-expiry {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fef2f2;
    padding: 4px 10px;
    border-radius: 6px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
}

.menu-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-content {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        padding: 5rem 2rem;
        z-index: 1000;
    }

    .nav-content.active {
        right: 0;
    }

    .nav-links {
        display: flex !important;
        flex-direction: column;
        gap: 1.5rem;
    }

.nav-expiring-link {
    color: #ffffff !important;
}

@media (max-width: 992px) {
    .nav-expiring-link {
        color: var(--text-main) !important;
        margin-top: 5px;
        margin-bottom: 5px;
    }
}

    .nav-links a {
        color: var(--text-main);
        font-size: 1.2rem;
        display: block;
    }

    .nav-links a i {
        margin-right: 10px;
        color: var(--primary-blue);
    }

    .auth-btns {
        display: none !important;
    }

    .hero-minimal h1 { font-size: 1.8rem; }
    .coupons-grid { grid-template-columns: 1fr; }
}

/* --- NUOVI STILI MODAL COUPON --- */
.modal-coupon-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-coupon-content {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-coupon-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-body);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.modal-coupon-close:hover {
    background: var(--border-color);
    color: var(--text-main);
    transform: rotate(90deg);
}

.modal-coupon-header {
    padding: 40px 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.modal-merchant-logo {
    width: 90px;
    height: 90px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

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

.modal-coupon-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.modal-coupon-body {
    padding: 0 30px 40px;
    text-align: center;
}

.modal-code-section {
    margin: 25px 0;
}

.modal-code-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-body);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.modal-code-wrapper:hover {
    border-color: var(--primary-blue);
    background: #f0f7ff;
}

.modal-code-val {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: 1px;
    text-transform: uppercase;
    word-break: break-all;
}

.btn-modal-copy {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 97, 255, 0.2);
}

.btn-modal-copy:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 97, 255, 0.3);
}

.btn-modal-copy.copied {
    background: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.modal-instruction {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 15px;
    font-weight: 500;
}

.modal-store-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    margin: 10px 0 30px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.modal-store-link:hover {
    border-bottom-color: var(--primary-blue);
    gap: 12px;
}

.modal-details-table {
    width: 100%;
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
}

.modal-detail-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
}

.modal-detail-value {
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Hiding copy button and partial code in cards */
.code-box-inline .btn-copy-small,
.code-box-container .btn-copy-mini {
    display: none !important;
}

.code-box-inline .code-val,
.code-box-container .code-box {
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

/* Sidebar & Category Layout */
.main-layout-with-sidebar {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-body);
}

.sidebar-search {
    display: flex;
    gap: 8px;
    background: var(--bg-body);
    padding: 6px;
    border-radius: 12px;
}

.sidebar-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 0.9rem;
    outline: none;
}

.sidebar-search button {
    background: var(--primary-blue);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-merchant-list {
    list-style: none;
    padding: 0;
}

.sidebar-merchant-list li {
    margin-bottom: 8px;
}

.sidebar-merchant-list a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-merchant-list .m-count {
    font-size: 0.7rem;
    color: var(--primary-blue);
    font-weight: 700;
    background: rgba(0, 97, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    min-width: 28px;
    text-align: center;
}

.sidebar-merchant-list a:hover {
    background: rgba(0, 97, 255, 0.05);
    color: var(--primary-blue);
}

.sidebar-merchant-list a:hover .m-count {
    background: var(--primary-blue);
    color: white;
}

.promo-sidebar {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-blue), #004ecc);
    color: white;
    border: none;
}

.promo-sidebar h3 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.1);
}

.promo-sidebar p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.promo-sidebar i {
    font-size: 2.5rem;
    opacity: 0.3;
}

/* Breadcrumbs Estetici */
.breadcrumb-container {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 0.4rem 0;
}

.breadcrumbs {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.breadcrumbs li a {
    text-decoration: none;
    color: var(--text-light);
    transition: color 0.2s;
}

.breadcrumbs li a:hover {
    color: var(--primary-blue);
}

.breadcrumbs li.active {
    color: var(--text-main);
    font-weight: 700;
}

.breadcrumbs .separator {
    color: var(--border-color);
    font-size: 0.6rem;
    padding: 0 12px;
}

.breadcrumbs li i {
    margin-right: 5px;
    font-size: 0.8rem;
}

/* Header Categoria Responsive & Moderno */
@media (max-width: 992px) {
    .main-layout-with-sidebar {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        position: static;
        order: -1; /* Sidebar above results on mobile */
    }
}

/* --- LOGICA SCADENZA (STA PER SCADERE) --- */
.is-expiring {
    border-color: #fecaca !important;
    background: #fffafa !important;
}

.is-expiring:hover {
    border-color: #ef4444 !important;
    box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.15) !important;
}

.expiring-soon-badge {
    background: #fef2f2;
    color: #ef4444;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid #fee2e2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.5px;
    animation: pulse-red 2s infinite;
}

.countdown-red {
    color: #ef4444 !important;
    font-weight: 700 !important;
}

.countdown-red i {
    color: #ef4444 !important;
}

/* Ribbon per le card in grid */
.card-expiring-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 50px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- COOKIE CONSENT BANNER --- */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none; /* Hidden by default, shown via JS */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-banner {
    background: white;
    max-width: 500px;
    width: 100%;
    padding: 35px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

.cookie-icon {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 20px;
}

.cookie-banner h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-main);
}

.cookie-banner p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 25px;
}

.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-accept-cookies {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-accept-cookies:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-settings-cookies {
    background: #f1f5f9;
    color: var(--text-main);
    text-decoration: none;
    padding: 10px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-settings-cookies:hover {
    background: #e2e8f0;
}

/* Subcategory Cards UI */
.subcategory-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-top: 1.5rem;
}

.subcategory-grid::-webkit-scrollbar {
    display: none;
}

.sub-card {
    background: white;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.sub-card i {
    color: var(--primary-blue);
    font-size: 0.8rem;
    opacity: 0.8;
}

.sub-card span {
    font-size: 0.75rem;
    font-weight: 700;
}

.sub-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -5px rgba(0, 97, 255, 0.1);
}

.sub-card.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.sub-card.active i {
    color: white;
    opacity: 1;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
