@import url("https://d2c87l0yth4zbw.cloudfront.net/fonts/AmazonEmber_Rg.woff2");

#peix-root,
#peix-root * {
    font-family: "Amazon Ember", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#peix-root input:focus,
#peix-root select:focus,
#peix-root button:focus {
    outline: 3px solid #26a5d1 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(38, 165, 209, 0.25) !important;
}

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

#peix-root button:hover {
    filter: brightness(0.95);
}

.peix-fav-btn .fav-icon {
    font-size: 16px;
    display: inline-block;
    transition: transform 0.2s;
}

.peix-fav-btn:hover .fav-icon {
    transform: scale(1.2);
}

/* ══ ESCRIPTORI: nav sticky ══════════════════════════════════════════════════ */
#peix-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 9000;
    background: #fff;
    box-shadow: 0 0 0 transparent;
    transition: box-shadow 0.25s ease, padding 0.25s ease;
    margin-left: -10px;
    margin-right: -10px;
    padding: 0 10px;
}

#peix-nav-wrap.is-stuck {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 0 0 20px 20px;
}

#peix-nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 0;
}

/* Elements ocults per defecte (mòbil) */
#peix-cat-bar,
#peix-cat-bar-spacer,
#peix-drawer-overlay,
#peix-drawer {
    display: none;
}

/* ══ MÒBIL ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    #peix-nav-wrap {
        display: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #peix-root {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    #peix-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    #peix-root .peix-card .peix-preu {
        font-size: 1.3em !important;
    }

    /* Barra mòbil de categories */
    #peix-cat-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 8000;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        min-height: 54px;
        opacity: 0;
        transform: translateY(-100%);
        transition: opacity 0.3s ease, transform 0.3s ease;
        pointer-events: none;
    }

    #peix-cat-bar.visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    #peix-cat-bar-spacer {
        display: block !important;
        height: 0;
        transition: height 0.3s ease;
    }

    #peix-cat-bar-spacer.visible {
        height: 54px;
    }

    /* Drawer mòbil - botons de categoria */
    #peix-drawer-list .peix-f {
        display: flex !important;
        align-items: center;
        width: 100%;
        text-align: left;
        padding: 14px 20px !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #334155 !important;
        font-size: 15px !important;
        font-weight: 600;
        border-bottom: 1px solid #f1f5f9 !important;
        transition: background 0.15s;
    }

    #peix-drawer-list .peix-f.active {
        background: #e0f2fe !important;
        color: #0369a1 !important;
        border-left: 4px solid #26a5d1 !important;
        padding-left: 16px !important;
    }

    #peix-drawer-list .peix-f:hover {
        background: #f8fafc !important;
    }
}

/* ══ Animació camp obligatori ════════════════════════════════════════════════ */
@keyframes peix-shake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-6px); }
    30%      { transform: translateX(5px); }
    45%      { transform: translateX(-4px); }
    60%      { transform: translateX(3px); }
    75%      { transform: translateX(-2px); }
}

.peix-shake {
    animation: peix-shake 0.4s ease-in-out;
}
