/* ===============================
   RESET / BASE
================================ */
html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ===============================
   PAGINA CATALOGO
================================ */
.catalog-page {
    position: relative;
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #0f172a, #0b3c5d, #0ea5e9);
    padding-top: 100px;
    /* spazio per tabs */
}

/* ===============================
   TOP AREA (TABS + BACK)
================================ */
.catalog-top {
    position: static;
    margin-top: 20px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
}

/* --- Tabs Pokémon / One Piece --- */
.tcg-tabs {
    display: flex;
    justify-content: center;
    gap: 18px;
}

.tcg-tab {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    padding: 14px 20px;
    cursor: pointer;

    backdrop-filter: blur(12px);
    transition: transform .2s ease, background .2s ease;
}

.tcg-tab:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
}

.tcg-tab.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
}

.tcg-tab img {
    width: 160px;
    height: 60px;
    object-fit: contain;
}

/* --- Back button --- */
.catalog-bar {
    display: flex;
    justify-content: center;
}

.back-btn {
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .10);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
}

.back-btn.hidden {
    display: none;
}

/* ===============================
   VIEW (scroll area)
================================ */
.catalog-view {
    height: auto;
    overflow: visible;
    padding: 30px 20px;
}

.hidden {
    display: none;
}

/* ===============================
   GRID
================================ */
.product-grid {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(auto-fill, 260px);
        justify-content: center;
    gap: 28px;
}

/* ===============================
   CARD BASE (GLASS)
================================ */
.tcg-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    padding: 34px;

    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.tcg-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.55);
    background: rgba(255, 255, 255, 0.14);
}

/* ===============================
   ESPANSIONI
================================ */
.expansion-card {
    flex-direction: column;
}

.expansion-card img {
    width: 240px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .45));
}

/* titolo espansione */
.expansion-title {
    margin-top: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    letter-spacing: .8px;
    text-transform: uppercase;
}

/* nascondi titolo per Pokémon */
.expansion-card:not(.onepiece) .expansion-title {
    display: none;
}

/* ONE PIECE desktop */
.expansion-card.onepiece {
    padding: 24px;
}

.expansion-card.onepiece img {
    height: 220px;
    width: auto;
}

/* ===============================
   NASCONDI SCROLLBAR
================================ */
.catalog-view::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.catalog-view {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* =================================================
   MOBILE TUNING (VERO FIX)
================================================= */
@media (max-width: 768px) {

    .catalog-page {
        padding-top: 80px;
    }

    .catalog-top {
        padding: 12px 14px;
        gap: 10px;
    }

    /* tabs */
    .tcg-tabs {
        gap: 12px;
    }

    .tcg-tab {
        padding: 10px 12px;
        border-radius: 14px;
    }

    .tcg-tab img {
        width: 130px;
        height: 44px;
    }

    /* area scroll */
    .catalog-view {
        height: calc(100vh - 80px - 120px);
        padding: 16px 14px calc(90px + env(safe-area-inset-bottom));
        margin-top: 50px;
    }

    @media (max-width: 768px) {
        .catalog-view {
            height: auto;
            padding: 20px 14px;
            margin-top: 0;
        }
    }

    /* 2 card per riga */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .tcg-card {
        padding: 14px;
        border-radius: 18px;
    }

    /* Pokémon */
    .expansion-card img {
        height: 78px;
        width: 100%;
    }

    /* One Piece */
    .expansion-card.onepiece {
        min-height: 210px;
        padding: 14px; 
    }

    .expansion-card.onepiece img {
        height: 150px;
    }

    .expansion-card.onepiece .expansion-title {
        font-size: 13px;
        margin-top: 10px;
        font-weight: 800;
    }
}

@media (max-width: 768px) {
    .language-choice {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
}

/* telefoni piccoli */
@media (max-width: 420px) {
    .tcg-tab img {
        width: 118px;
        height: 40px;
    }

    .expansion-card.onepiece img {
        height: 140px;
    }
    
}

/* ===============================
   PRODUCT CARD – WHITE STYLE
================================ */
.product-grid .tcg-card {
    background: #ffffff;
    border: none;
    backdrop-filter: none;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    border-radius: 28px;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* ===============================
   PRODUCT CARD TEXT COLORS
================================ */
.product-grid .tcg-card h3 {
    color: #0f172a;
    /* blu scuro */
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin: 10px 0 6px;
}

.product-grid .tcg-card .price {
    color: #0b3c5d;
    /* blu leggermente più acceso */
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

/* ===============================
   FILTERS – UI POLISH (SAFE)
================================ */

.type-filters {
    display: flex;
    justify-content: center;
    /* CENTRATI */
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 auto 28px;
    /* aria sopra i prodotti */
    max-width: 1000px;
}

/* bottoni base */
.type-filters button {
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.30);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2px;

    cursor: pointer;
    backdrop-filter: blur(8px);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .25),
        0 6px 18px rgba(0, 0, 0, .25);

    transition: background .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

/* hover */
.type-filters button:hover {
    background: rgba(255, 255, 255, 0.20);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .35),
        0 10px 26px rgba(0, 0, 0, .35);
}

/* attivo */
.type-filters button.active {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #020617;
    border-color: transparent;

    box-shadow:
        0 14px 32px rgba(56, 189, 248, .55),
        inset 0 1px 0 rgba(255, 255, 255, .45);
}

.catalog-search {
    width: 100%;
    max-width: 420px;
    margin: 0 auto 16px;
    display: block;

    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 600;
}

.catalog-search::placeholder {
    color: rgba(255, 255, 255, .6);
}

.language-choice {
    display: flex;
    justify-content: center;
    gap: 28px;
}

.language-card {
    width: 150px;
    height: 190px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;

    cursor: pointer;
    transition: transform .25s ease, background .25s ease;
}

.language-choice {
    display: flex;
    justify-content: center;
    gap: 28px;
}

/* CARD ORIZZONTALE */
.language-card {
    position: relative;
    width: 220px;
    height: 140px;
    /* 🔥 orizzontale */
    padding: 0;
    border-radius: 22px;
    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.18);
    background: none;

    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease;
}

.language-card:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

/* BANDIERA FULL */
.language-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* OVERLAY PER LEGGIBILITÀ */
.language-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}

/* TESTO CENTRALE */
.lang-code {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 42px;
    font-weight: 900;
    letter-spacing: 4px;
    color: rgb(190, 190, 190);

    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
}

.hidden {
    display: none !important;
}

.catalog-toolbar {
    position: sticky;
    top: 80px;
    /* sotto la header */
    z-index: 50;

    display: flex;
    align-items: center;
    gap: 14px;

    max-width: 1100px;
    margin: 0 auto 18px;
    padding: 10px 16px;

    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    border-radius: 18px;
}

.catalog-toolbar.hidden {
    display: none;
}

/* back button */
.back-btn {
    position: static;
    margin: 0 auto 20px;
    display: block;

    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;

    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);

    transition: background .2s ease, transform .2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.catalog-search-wrapper {
    display: flex;
    justify-content: center;
    margin: 0 auto 24px;
    width: 80%;
}

.catalog-search {
    width: 100%;
    max-width: 420px;
    /* 👈 larghezza reale */
}
