/* ==========================================================================
   SITE CHROME — header e footer del design BE BIO, su tutte le pagine
   (home, shop, prodotto, carrello, account, recesso...).
   Markup: templates/parts/site/header.php e footer.php, inclusi da /header.php
   e /footer.php. File autonomo: carica da solo i token che usa.
   I colori leggono i token di client-tokens.css (con il valore del design
   come ripiego), quindi si cambiano da lì.
   Le classi sono bb-header / bb-footer (e non .site-header / .site-footer)
   perché quelle sono già usate da Hello Elementor con regole proprie.
   ========================================================================== */

.bb-header,
.bb-footer {
    --bb-cream: var(--woo-color-bg, #FFF9F2);
    --bb-ink: var(--woo-color-text, #321C04);
    --bb-ink-dark: var(--woo-color-primary-h, #1F1003);
    --bb-sage: var(--woo-color-secondary, #7A9A7E);
    --bb-ease: cubic-bezier(0.77, 0, 0.175, 1);
    --bb-gutter: clamp(20px, 4.5vw, 64px);
    --bb-shadow-pill: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);

    /* Inter come nel design: non il font del Kit di Elementor (Roboto), che arriva da --woo-font-body */
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bb-header *,
.bb-footer * {
    box-sizing: border-box;
}

.bb-header a,
.bb-footer a {
    color: inherit;
    text-decoration: none;
}

.bb-header a:hover,
.bb-footer a:hover {
    color: inherit;
    opacity: .75;
}

/* woo-base.css («Elementor Kit — reset interferenze») colora di marrone TUTTI i link delle
   pagine WooCommerce, con specificità alta: nel footer scuro i link sparirebbero.
   Qui il colore dei link è quello del design, quindi !important. */
.bb-footer a,
.bb-footer a:hover {
    color: inherit !important;
}

/* ---------- Posizione ---------- */

/* Pagine interne: l'header segue il flusso, centrato */
.bb-header {
    position: relative;
    z-index: 50;
    width: max-content;
    max-width: 100%;
    margin: 24px auto 0;
}

/* Home: l'header sta sopra l'hero (come nel design) */
body.sitiamo-page--home .bb-header {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    max-width: none;
}

/* ---------- Header ---------- */

.bb-header .header-pill {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 9999px;
    box-shadow: var(--bb-shadow-pill);
    padding: 8px 10px 8px 22px;
}

.bb-header .header-brand {
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #000 !important;
    white-space: nowrap;
}

.bb-header .header-menu-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    border-radius: 9999px;
}

.bb-header .header-menu-toggle:hover,
.bb-header .header-menu-toggle:focus {
    background: transparent;
    color: inherit;
}

.bb-header .header-menu-toggle span {
    position: absolute;
    left: 9px;
    top: 17px;
    width: 18px;
    height: 2px;
    background: #000;
    border-radius: 2px;
    transition: transform 300ms var(--bb-ease);
}

.bb-header .header-menu-toggle span:nth-child(1) {
    transform: translateY(-4px);
}

.bb-header .header-menu-toggle span:nth-child(2) {
    transform: translateY(4px);
}

.bb-header.is-menu-open .header-menu-toggle span:nth-child(1) {
    transform: rotate(45deg);
}

.bb-header.is-menu-open .header-menu-toggle span:nth-child(2) {
    transform: rotate(-45deg);
}

/* Carrello: markup dello shortcode [sitiamo_cart_toggle] con l'aspetto del design */

.bb-header .header-cart {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 9999px;
    background: var(--bb-cream);
    color: var(--bb-ink) !important;
}

.bb-header .header-cart svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.bb-header .header-cart .sitiamo-cart-toggle__count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 9999px;
    background: var(--bb-sage);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    opacity: 1;
}

.bb-header .header-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1);
    padding: 8px;
    display: flex;
    flex-direction: column;
    transform-origin: top center;
    transition: opacity 300ms var(--bb-ease), transform 300ms var(--bb-ease);
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    pointer-events: none;
}

.bb-header.is-menu-open .header-dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bb-header .header-dropdown-link {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--bb-ink) !important;
}

.bb-header .header-dropdown-link:hover {
    background: var(--bb-cream);
}
/* ---------- Footer ---------- */

.bb-footer {
    background: var(--bb-ink);
    color: var(--bb-cream);
    border-radius: 25px 25px 0 0;
    margin-top: 0;
    position: relative;
    padding: 64px 0;
}

/* Home: il footer risale di 25px sull'ultima sezione (la FAQ ha il padding extra) */
body.sitiamo-page--home .bb-footer {
    margin-top: -25px;
}

.bb-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--bb-gutter);
}

.bb-footer .footer-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.bb-footer .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bb-footer .footer-brand-name {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.bb-footer .footer-tagline {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 249, 242, .7);
}

.bb-footer .footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 15px;
}

.bb-footer .footer-newsletter {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bb-footer .footer-newsletter p {
    margin: 0;
    font-size: 15px;
}

.bb-footer .newsletter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 249, 242, .2);
    border-radius: 9999px;
    padding: 4px 4px 4px 20px;
    max-width: 380px;
}

.bb-footer .newsletter-form input[type="email"].newsletter-input {
    flex: 1;
    width: auto;
    min-width: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    outline: none;
    box-shadow: none;
    color: var(--bb-cream);
    font-family: inherit;
    font-size: 14px;
    padding: 8px 0;
}

.bb-footer .newsletter-submit {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 0;
    border-radius: 9999px;
    background: var(--bb-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.bb-footer .newsletter-submit:hover,
.bb-footer .newsletter-submit:focus {
    background: var(--bb-cream);
}

.bb-footer .footer-bottom {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 249, 242, .2);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px 32px;
    font-size: 13px;
}

.bb-footer .footer-legal {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgba(255, 249, 242, .6);
    line-height: 1.5;
}

.bb-footer .footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    color: rgba(255, 249, 242, .8);
}

/* ---------- Responsive (stessi valori del design) ---------- */

@media (min-width: 768px) {
    .bb-footer .footer-columns {
        grid-template-columns: 1.2fr 1fr 1.4fr;
    }
}

@media (min-width: 1024px) {
    .bb-footer .bb-container {
        width: 75%;
        padding: 0;
    }
}
