:root {
    --bg: #0b1020;
    --bg-soft: #121a2f;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --ring: rgba(99, 102, 241, 0.35);
    --shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    --radius: 20px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    background: #f1f5f9;
    color: var(--text);
    min-height: 100vh;
}

a { color: inherit; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.85rem 1.5rem;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-flex;
    align-items: center;
}

.site-logo-img {
    display: block;
    max-height: 42px;
    max-width: 180px;
    width: auto;
    height: auto;
}

.logo--footer .site-logo-img {
    max-height: 36px;
    max-width: 160px;
}

.header-search {
    display: flex;
    max-width: 360px;
    flex: 1;
}

.header-search input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 999px 0 0 999px;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    outline: none;
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.header-search button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0 1.1rem;
    border-radius: 0 999px 999px 0;
    font-weight: 600;
    cursor: pointer;
}

.header-search button:hover { background: var(--primary-dark); }

main.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* Hero homepage */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 4rem 1.5rem 4.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
    color: #fff;
    box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    pointer-events: none;
}

.hero::before {
    width: 320px;
    height: 320px;
    background: #6366f1;
    top: -80px;
    right: -60px;
}

.hero::after {
    width: 280px;
    height: 280px;
    background: #f59e0b;
    bottom: -100px;
    left: -40px;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 2.25rem;
    line-height: 1.6;
}

.hero-search {
    display: flex;
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border-radius: 999px;
    padding: 0.45rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 1.1rem 1.5rem;
    font-size: 1.125rem;
    border-radius: 999px;
    outline: none;
    color: var(--text);
}

.hero-search input::placeholder { color: #94a3b8; }

.hero-search button {
    border: none;
    background: linear-gradient(135deg, var(--accent), #ea580c);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 1rem 2rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}

.hero-search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.45);
}

.hero-hints {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.results-block {
    margin-bottom: 2rem;
}

.results-block--amazon {
    margin-top: 0.5rem;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
}

/* ─── Griglia prodotti (e-commerce) ─── */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.125rem;
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

/* Card prodotto */
.pc {
    background: #fff;
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.06),
        0 2px 8px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.pc:hover {
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.15),
        0 12px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.pc__link {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.pc__visual {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.pc__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.pc:hover .pc__img {
    transform: scale(1.04);
}

.pc__placeholder {
    width: 56px;
    height: 56px;
    color: #e2e8f0;
}

.pc__placeholder svg {
    width: 100%;
    height: 100%;
}

.pc__info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 0.625rem;
    padding: 0.875rem 1rem 1rem;
}

.pc__name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    color: #475569;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pc:hover .pc__name {
    color: #0f172a;
}

.pc__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.625rem;
    border-top: 1px solid #f1f5f9;
}

.pc__price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.2;
    white-space: nowrap;
}

.pc__price--na {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
}

.pc__action {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
    line-height: 1.3;
    max-width: 42%;
}

.pc--amazon .pc__action {
    color: #c2410c;
}

.pc:hover .pc__action {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Pulsanti (altre pagine) */
.btn {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn:hover { opacity: 0.92; }

.btn-block { width: 100%; }

.btn-amazon {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
}

/* Search results */
.search-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.search-hero h1 {
    font-size: 1.75rem;
    margin: 0 0 1.5rem;
    color: #1e293b;
}

.search-hero .hero-search {
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.2);
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border-radius: var(--radius);
    color: var(--muted);
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
    padding: 1.5rem 1.5rem 0.75rem;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    color: #cbd5e1;
    padding: 2rem 1.5rem 2.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.site-footer-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.site-footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.logo--footer {
    -webkit-text-fill-color: #fff;
    color: #fff;
    background: none;
}

.site-footer-tagline {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
}

.site-footer-nav a,
.site-footer-link-btn {
    color: #dbe5f4;
    text-decoration: none;
    font-size: 0.88rem;
    background: none;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}

.site-footer-nav a:hover,
.site-footer-link-btn:hover {
    color: #fff;
    border-color: rgba(165, 180, 252, 0.6);
    background: rgba(99, 102, 241, 0.18);
    text-decoration: none;
}

.site-footer-legal {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
}

.site-footer-legal--small {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

.cookie-banner-owner {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: #cbd5e1;
    opacity: 0.9;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 120;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.cookie-banner h2 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #fff;
}

.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 55rem;
}

.cookie-banner a {
    color: #a5b4fc;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-btn {
    border: none;
    border-radius: 10px;
    padding: 0.62rem 1rem;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    font-family: inherit;
}

.cookie-btn--primary {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid #475569;
}

.cookie-btn--primary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.cookie-btn--accent {
    background: linear-gradient(135deg, var(--accent), #ea580c);
    color: #fff;
}

.cookie-btn--accent:hover {
    opacity: 0.92;
}

@media (max-width: 640px) {
    .site-footer {
        padding: 1.5rem 1rem 1.75rem;
    }
    .site-footer-nav {
        gap: 0.55rem;
    }
    .site-footer-nav a,
    .site-footer-link-btn {
        font-size: 0.82rem;
    }
    .cookie-banner {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        padding: 0.75rem;
    }
    .cookie-banner-actions {
        width: 100%;
    }
    .cookie-btn {
        flex: 1;
        text-align: center;
    }
}

/* Legal pages */
.legal-page {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem 2.25rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.65;
}

.legal-page h1 {
    margin-top: 0;
    font-size: 1.75rem;
    color: #0f172a;
}

.legal-page h2 {
    font-size: 1.1rem;
    margin: 1.75rem 0 0.5rem;
    color: #1e293b;
}

.legal-page p,
.legal-page li {
    color: #475569;
}

.legal-page ul {
    padding-left: 1.25rem;
}

.legal-page a {
    color: var(--primary);
}

.legal-updated {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.legal-table-wrap {
    width: 100%;
    margin: 1rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.legal-table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
    border: 1px solid #e2e8f0;
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.legal-table th {
    background: #f8fafc;
    color: #334155;
}

.legal-table code {
    word-break: break-all;
}

@media (max-width: 640px) {
    .legal-table-wrap {
        overflow-x: visible;
    }

    .legal-table {
        min-width: 0;
        border: 0;
    }

    .legal-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .legal-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .legal-table tbody td {
        display: block;
        border: 0;
        border-bottom: 1px dashed #e2e8f0;
        padding: 0.5rem 0;
    }

    .legal-table tbody td:last-child {
        border-bottom: 0;
    }

    .legal-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #64748b;
        margin-bottom: 0.2rem;
    }
}

/* Product detail */
.product-detail {
    display: flex;
    gap: 2rem;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.product-detail-media {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.product-detail-media img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-detail-body {
    flex: 2;
    min-width: 300px;
}

.product-detail-body h1 {
    margin-top: 0;
    font-size: 2rem;
}

.product-detail-price {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 1rem;
}

.product-detail-availability {
    color: #059669;
    font-weight: bold;
    margin-bottom: 2rem;
}

.product-detail-heading {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    font-size: 1.1rem;
}

.product-offers-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.product-offers-table tr {
    border-bottom: 1px solid #e2e8f0;
}

.product-offers-table td {
    padding: 1rem 0;
}

.product-offers-price {
    font-weight: bold;
    color: #2563eb;
}

.product-offers-action {
    text-align: right;
}

.product-detail-description p {
    color: #475569;
    line-height: 1.6;
}

.product-detail-meta {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 2rem;
}

@media (max-width: 380px) {
    .pc__info {
        padding: 0.75rem;
    }
    .pc__price {
        font-size: 1rem;
    }
    .pc__action {
        font-size: 0.6875rem;
    }
}

@media (max-width: 640px) {
    .hero { padding: 2.5rem 1rem 3rem; }
    .hero-search { flex-direction: column; border-radius: var(--radius); padding: 0.75rem; }
    .hero-search input { border-radius: 12px; padding: 1rem; }
    .hero-search button { border-radius: 12px; width: 100%; }
    .header-search { display: none; }
}
