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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #27272A;
    min-height: 100vh;
    padding: 0 0 20px;
    color: #e4e4e7;
}

/* ===== AFFILIATE TOP BAR ===== */
.affiliate-top-bar {
    background: rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    padding: 7px 20px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.01em;
}

.affiliate-top-bar a {
    color: rgba(255,255,255,0.75);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
    font-size: inherit;
    padding: 0;
    transition: color 0.2s;
}

.affiliate-top-bar a:hover {
    color: white;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #323236;
    border-radius: 16px;
    padding: 36px 40px;
    max-width: 660px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.08);
}

.modal-box h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    padding-right: 30px;
}

.modal-box p {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.75;
    margin-bottom: 14px;
}

.modal-box p:last-child {
    margin-bottom: 0;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 4px;
}

.modal-close:hover {
    color: white;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #fff;
}

h1 i {
    color: #f97316;
    margin-right: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.75);
}

/* ===== NAV ===== */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 35px;
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: white;
}

nav a.active {
    background: white;
    color: #27272A;
    border-color: white;
    font-weight: 700;
}

/* ===== DEALS GRID ===== */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.deal-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.deal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
}

.deal-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ef4444;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(239,68,68,0.4);
}

.image-container {
    position: relative;
    height: 300px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.deal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.deal-info {
    padding: 20px;
}

.deal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #18181b;
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e74c3c;
}

.original-price {
    font-size: 1.1rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.discount-badge {
    background: #22c55e;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: bold;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 15px;
    color: #f59e0b;
    font-size: 1rem;
}

.rating i {
    font-size: 0.9rem;
}

.review-count {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-left: 4px;
}

.cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1rem;
    transition: opacity 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 16px rgba(109,40,217,0.3);
}

.cta-button:hover {
    opacity: 0.9;
    box-shadow: 0 6px 22px rgba(109,40,217,0.5);
}

.loading {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 1.3rem;
    padding: 50px;
}

.error {
    background: #422006;
    border: 1px solid #f97316;
    color: #fdba74;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== RECENSIONI SECTION ===== */
.recensioni-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.08);
}

.recensioni-section h2 {
    color: white;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 8px;
}

.recensioni-section .section-subtitle {
    color: rgba(255,255,255,0.55);
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.rec-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.rec-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s;
    font-family: inherit;
}

.rec-tab:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
    color: white;
}

.rec-tab.active {
    background: white;
    color: #27272A;
    border-color: white;
    font-weight: 700;
}

.rec-panel {
    display: none;
}

.rec-panel.active {
    display: block;
}

.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 35px;
}

.rec-card {
    background: #1c1c1f;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.rec-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 22px 55px rgba(0,0,0,0.65);
    border-color: rgba(139,92,246,0.35);
}

/* image container */
.rec-card-img-container {
    position: relative;
    height: 260px;
    background: #0f0f11;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rec-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 22px;
    display: block;
}

/* icon shown when no image is available */
.rec-card-icon-fallback {
    font-size: 4rem;
    color: rgba(139,92,246,0.45);
}

/* gradient accent line at the bottom of the image area */
.rec-card-img-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4338ca, #7c3aed, #4338ca);
}

.rec-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(20,20,23,0.82);
    color: rgba(255,255,255,0.85);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
}

.rec-card-body {
    padding: 26px 28px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rec-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f4f4f5;
    margin-bottom: 12px;
    line-height: 1.35;
}

.rec-card-review {
    font-size: 0.97rem;
    color: #a1a1aa;
    line-height: 1.78;
    margin-bottom: 22px;
    flex: 1;
}

.rec-card-price {
    font-size: 1.9rem;
    font-weight: 800;
    color: #f87171;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rec-card-price .price-note {
    font-size: 0.85rem;
    font-weight: 400;
    color: #71717a;
}

.rec-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    transition: opacity 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 18px rgba(109,40,217,0.35);
}

.rec-cta:hover {
    opacity: 0.9;
    box-shadow: 0 6px 24px rgba(109,40,217,0.55);
}

.rec-cta-search {
    background: linear-gradient(135deg, #3f3f46 0%, #27272a 100%);
    box-shadow: none;
}

.rec-cta-search:hover {
    box-shadow: none;
}

.rec-discount {
    display: inline-block;
    background: #16a34a;
    color: #dcfce7;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
}

.rec-price-na {
    font-size: 1rem;
    font-weight: 400;
    color: #71717a;
}

.rec-price-loading {
    font-size: 1rem;
    font-weight: 400;
    color: #52525b;
    animation: rec-pulse 1.5s ease-in-out infinite;
}

@keyframes rec-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ===== DEALS SECTION (async) ===== */
#deals-section {
    display: none;
    margin-bottom: 35px;
}

#deals-section.visible {
    display: block;
}

#deals-title {
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    color: rgba(255,255,255,0.45);
    padding: 20px;
}

footer p {
    margin-bottom: 6px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.affiliate-disclaimer {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    font-style: italic;
    border: 1px solid rgba(255,255,255,0.07);
    display: block;
    color: rgba(255,255,255,0.4);
}

.footer-links {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.82rem;
}

.footer-links a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: rgba(255,255,255,0.8);
}

.footer-sep {
    color: rgba(255,255,255,0.2);
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    background: #1c1c1f;
    border-top: 1px solid rgba(139,92,246,0.3);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 260px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.cookie-banner-icon {
    font-size: 1.4rem;
    color: #a78bfa;
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-banner-text p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin: 0;
}

.cookie-banner-text a {
    color: #a78bfa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 9px 22px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: opacity 0.2s, box-shadow 0.2s;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(109,40,217,0.35);
}

.cookie-btn-accept:hover {
    opacity: 0.88;
    box-shadow: 0 4px 18px rgba(109,40,217,0.5);
}

.cookie-btn-decline {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.12);
}

.cookie-btn-decline:hover {
    background: rgba(255,255,255,0.13);
    color: rgba(255,255,255,0.85);
}

@media (max-width: 600px) {
    .cookie-banner-inner {
        flex-direction: column;
        gap: 14px;
    }

    .cookie-banner-actions {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .rec-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .deals-grid {
        grid-template-columns: 1fr;
    }

    nav a {
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    .modal-box {
        padding: 28px 22px;
    }
}
