/* Better Books Customer Header V2 - used on all non-admin-dashboard pages */
.bbk-customer-header{
    height:74px;
    background:#ffffff;
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    gap:14px;
    padding:0 22px;
    border-bottom:1px solid #e5e7eb;
    box-shadow:0 8px 28px rgba(15,23,42,.08);
    position:sticky;
    top:0;
    z-index:1000;
}

.bbk-head-side{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.bbk-head-left{
    justify-content:flex-start;
}

.bbk-head-right{
    justify-content:flex-end;
}

.bbk-head-link,
.bbk-account-button{
    height:42px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    padding:0 13px;
    border-radius:14px;
    border:1px solid #e5e7eb;
    background:#f8fafc;
    color:#111827;
    font-size:15px;
    font-weight:850;
    line-height:1;
    text-decoration:none;
    cursor:pointer;
    white-space:nowrap;
    transition:background .18s ease,border-color .18s ease,transform .18s ease;
}

.bbk-head-link:hover,
.bbk-account-button:hover,
.bbk-head-link.is-active{
    background:#eef2ff;
    border-color:#c7d2fe;
    color:#1d4ed8;
}

.bbk-head-icon,
.bbk-account-icon{
    font-size:18px;
    line-height:1;
}

.bbk-head-logo{
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:120px;
    text-decoration:none;
}

.bbk-head-logo img{
    display:block;
    height:105px;
    width:auto;
    max-width:155px;
    object-fit:contain;
    position:relative;
    top:-10px;
    z-index:2;
}

.bbk-cart-head-link{
    position:relative;
    padding-right:10px;
}

.bbk-cart-count{
    min-width:20px;
    height:20px;
    padding:0 6px;
    border-radius:999px;
    background:#ef4444;
    color:#ffffff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
    font-weight:900;
    line-height:1;
}

.bbk-account-wrap{
    position:relative;
}

.bbk-account-button{
    font-family:inherit;
}

.bbk-account-caret{
    font-size:12px;
    color:#64748b;
}

.bbk-account-menu{
    position:absolute;
    right:0;
    top:calc(100% + 10px);
    min-width:230px;
    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:18px;
    box-shadow:0 22px 55px rgba(15,23,42,.16);
    padding:9px;
    opacity:0;
    transform:translateY(-6px);
    pointer-events:none;
    transition:opacity .18s ease, transform .18s ease;
    z-index:1300;
}

.bbk-account-wrap.is-open .bbk-account-menu{
    opacity:1;
    transform:translateY(0);
    pointer-events:auto;
}

.bbk-account-summary{
    padding:10px 11px 12px;
    border-bottom:1px solid #f1f5f9;
    margin-bottom:5px;
}

.bbk-account-summary strong{
    display:block;
    color:#111827;
    font-size:14px;
    font-weight:900;
}

.bbk-account-summary span{
    display:block;
    color:#64748b;
    font-size:12px;
    margin-top:4px;
}

.bbk-account-menu a,
.bbk-account-menu button,
.bbk-account-credit{
    width:100%;
    display:block;
    padding:10px 11px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:#111827;
    text-align:left;
    text-decoration:none;
    font-size:14px;
    font-weight:800;
    font-family:inherit;
}

.bbk-account-menu a:hover,
.bbk-account-menu button:hover{
    background:#f1f5f9;
}

.bbk-account-credit{
    color:#15803d;
    background:#ecfdf5;
    margin:4px 0;
}

.bbk-account-menu form{
    margin:0;
}

.bbk-account-menu button{
    color:#dc2626;
    cursor:pointer;
}

@media(max-width:900px){
    .bbk-customer-header{
        height:66px;
        padding:0 10px;
        gap:6px;
        grid-template-columns:1fr auto 1fr;
    }

    .bbk-head-side{
        gap:5px;
    }

    .bbk-head-link,
    .bbk-account-button{
        height:40px;
        min-width:40px;
        padding:0 9px;
        border-radius:12px;
        gap:3px;
    }

    .bbk-head-text,
    .bbk-account-label,
    .bbk-account-caret{
        display:none;
    }

    .bbk-head-icon,
    .bbk-account-icon{
        font-size:18px;
    }

    .bbk-head-logo{
        min-width:88px;
    }

    .bbk-head-logo img{
        height:105px;
        max-width:110px;
        top:8px;
    }

    .bbk-cart-count{
        min-width:18px;
        height:18px;
        padding:0 5px;
        font-size:11px;
        margin-left:-3px;
    }

    .bbk-account-menu{
        right:0;
        min-width:215px;
    }
}

@media(max-width:390px){
    .bbk-customer-header{
        padding:0 7px;
    }

    .bbk-head-link,
    .bbk-account-button{
        min-width:36px;
        height:38px;
        padding:0 7px;
    }

    .bbk-head-logo{
        min-width:78px;
    }

    .bbk-head-logo img{
        height:86px;
        max-width:120px;
    }
}


/* Header enhancement: dashboard blocks icon, credit pill, cleaner account */
.bbk-dashboard-icon{
    width:18px;
    height:18px;
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:3px;
}

.bbk-dashboard-icon span{
    display:block;
    background:currentColor;
    border-radius:3px;
}

.bbk-account-label{
    align-items:center;
    gap:7px;
}

.bbk-account-name{
    display:inline-block;
}

.bbk-credit-pill,
.bbk-summary-credit{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#ecfdf5;
    color:#047857;
    border:1px solid #bbf7d0;
    border-radius:999px;
    padding:3px 8px;
    font-size:12px;
    font-weight:900;
    white-space:nowrap;
}

.bbk-summary-credit{
    margin-top:6px;
    width:max-content;
}

.bbk-account-menu a[href*="register"]{
    color:#1d4ed8;
    background:#eff6ff;
}

.bbk-account-menu a[href*="register"]:hover{
    background:#dbeafe;
}

@media(max-width:900px){
    .bbk-account-label{
        display:none;
    }

    .bbk-dashboard-icon{
        width:18px;
        height:18px;
    }
}


/* Header V3.1 final polish */
.bbk-dashboard-tile{
    font-size:20px;
    font-weight:900;
    line-height:1;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:20px;
    min-width:20px;
}

.bbk-account-button .bbk-credit-pill{
    display:none!important;
}

.bbk-account-label{
    display:inline-flex;
    align-items:center;
    gap:0;
}

.bbk-account-name{
    max-width:150px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.bbk-summary-credit{
    background:#ecfdf5!important;
    color:#047857!important;
    border:1px solid #bbf7d0!important;
    border-radius:999px!important;
    padding:4px 10px!important;
    font-weight:900!important;
}

@media(max-width:900px){
    .bbk-dashboard-tile{
        font-size:20px;
        width:18px;
        min-width:18px;
    }
}

/* Header mobile final: icon-only account button */
@media(max-width:900px){
    .bbk-account-button .bbk-account-label,
    .bbk-account-button .bbk-account-name,
    .bbk-account-button .bbk-credit-pill,
    .bbk-account-button .bbk-account-caret{
        display:none!important;
    }

    .bbk-account-button{
        width:40px!important;
        min-width:40px!important;
        padding:0!important;
        justify-content:center!important;
    }

    .bbk-account-icon{
        margin:0!important;
        font-size:20px!important;
    }
}

@media(max-width:390px){
    .bbk-account-button{
        width:36px!important;
        min-width:36px!important;
        padding:0!important;
    }
}
