/* ======================================================
   ONPAL WEB — Universal Buyer Header/Footer
   File: /web/assets/header.css
   Scope: UI only
====================================================== */

.op-buyer-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
    transition: padding 0.18s ease, box-shadow 0.18s ease;
}

.op-buyer-header .op-logo img {
    max-height: 42px;
    width: auto;
    display: block;
}

.op-buyer-title {
    font-size: 20px;
    font-weight: 700;
    color: #12372a;
    white-space: nowrap;
    padding-left: 10px;
    border-left: 1px solid rgba(15, 23, 42, 0.12);
}

.op-buyer-header__links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.op-buyer-header__links a {
    white-space: nowrap;
}

.op-buyer-hi {
    color: #12372a;
    font-size: 13px;
    font-weight: 700;
}

.op-buyer-hi--desktop {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.op-buyer-header .op-cart-btn {
    min-width: 48px;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eaf8ef;
    color: #0b7a31;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid rgba(11, 122, 49, 0.16);
}

.op-buyer-header .op-cart-btn:hover {
    background: #dff5e7;
}

.op-buyer-menu {
    background: #0b7a31;
    color: #ffffff;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.op-buyer-menu a,
.op-buyer-menu span {
    color: #ffffff;
}

.op-buyer-menu a.is-active {
    font-weight: 800;
    text-decoration: underline;
}

body.op-header-compact .op-buyer-header {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

body.op-header-compact .op-buyer-menu {
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

body.op-header-compact .op-buyer-title {
    display: none;
}

body.op-header-compact .op-buyer-header .op-logo img {
    max-height: 34px;
}

.op-mobile-drawer {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    z-index: 1100;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.20);
    padding: 12px;
    display: grid;
    gap: 4px;
}

.op-mobile-drawer[hidden] {
    display: none !important;
}

@media screen and (min-width: 901px) {
    .op-mobile-drawer {
        display: none !important;
    }
}

.op-mobile-drawer a {
    color: #12372a;
    text-decoration: none;
    font-weight: 700;
    padding: 12px;
    border-radius: 12px;
}

.op-mobile-drawer a:hover {
    background: #f3f7f4;
}

.op-site-footer {
    background: #f6f7f8;
    margin-top: 40px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.op-site-footer__trust {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.op-site-footer__trust div {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.op-site-footer__trust b {
    color: #12372a;
    font-size: 14px;
}

.op-site-footer__trust span {
    color: #667085;
    font-size: 12px;
}

.op-site-footer__main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 26px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 24px;
}

.op-site-footer__main h4 {
    margin: 0 0 10px;
    color: #12372a;
    font-size: 15px;
}

.op-site-footer__main a {
    display: block;
    color: #344054;
    text-decoration: none;
    margin: 6px 0;
    font-size: 13px;
}

.op-site-footer__main p {
    color: #667085;
    font-size: 13px;
    margin: 0 0 12px;
}

.op-site-footer__app {
    display: inline-flex !important;
    width: fit-content;
    background: #12372a;
    color: #ffffff !important;
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 800;
}

.op-site-footer__bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px 26px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #667085;
    font-size: 12px;
}

@media (max-width: 900px) {
    .op-buyer-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 12px;
    }

    .op-buyer-header .op-header__left {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .op-buyer-header .op-search {
        width: 100%;
        order: 2;
    }

    .op-buyer-header__links {
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .op-buyer-header__links > a:not(.op-cart-btn),
    .op-buyer-hi--desktop {
        display: none;
    }

    .op-buyer-title {
        font-size: 16px;
        margin-right: 54px;
    }

    .op-buyer-menu {
        display: none;
    }

    body.op-header-compact .op-buyer-header .op-header__left {
        display: none;
    }

    body.op-header-compact .op-buyer-header {
        grid-template-columns: 1fr auto;
    }

    body.op-header-compact .op-buyer-header .op-search {
        order: 1;
        padding-right: 58px;
    }

    .op-site-footer__trust {
        grid-template-columns: 1fr;
    }

    .op-site-footer__main {
        grid-template-columns: 1fr;
    }

    .op-site-footer__bottom {
        display: grid;
    }
}

/* ======================================================
   ONPAL BUYER HEADER — Mobile Header Clean Fix
   Scope:
   - Keep existing cart emoji/button only
   - Force Hi username into one line
   - No SVG/image cart override
====================================================== */



@media screen and (max-width: 900px) {
    .op-buyer-header {
        padding: 8px 12px !important;
    }

    .op-buyer-header .op-header__left {
        width: 100%;
        display: grid !important;
        grid-template-columns: 32px 132px minmax(86px, 1fr) 54px;
        align-items: center;
        gap: 6px;
        justify-content: unset !important;
    }

    .op-buyer-header .op-mobile-menu {
        width: 32px;
        height: 32px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: none;
    }

    .op-buyer-header .op-logo {
        width: 132px;
        min-width: 0;
        flex: none;
    }

    .op-buyer-header .op-logo img {
        width: 132px;
        max-width: 132px;
        max-height: 34px;
        object-fit: contain;
    }

    .op-buyer-hi--left {
        display: block !important;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap !important;
        word-break: keep-all;
        font-size: 13px;
        font-weight: 800;
        line-height: 32px;
        color: #12372a;
    }

    .op-cart-btn--mobile-head {
        display: inline-flex !important;
        width: 54px;
        min-width: 54px;
        height: 34px;
        margin: 0;
        padding: 0 8px;
        border: 0;
        border-radius: 10px;
        background: #ff8a00;
        color: #ffffff;
        align-items: center;
        justify-content: center;
        gap: 5px;
        font-size: 15px;
        font-weight: 900;
        text-decoration: none;
    }

    .op-cart-btn--mobile-head::before {
        content: none !important;
        display: none !important;
        background-image: none !important;
    }

    .op-cart-btn--mobile-head span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 999px;
        background: #ffffff;
        color: #ff8a00;
        font-size: 11px;
        font-weight: 900;
        line-height: 17px;
    }

    .op-buyer-header__links .op-cart-btn {
        display: none !important;
    }
}

@media screen and (max-width: 380px) {
    .op-buyer-header .op-header__left {
        grid-template-columns: 30px 118px minmax(72px, 1fr) 50px;
        gap: 5px;
    }

    .op-buyer-header .op-logo {
        width: 118px;
    }

    .op-buyer-header .op-logo img {
        width: 118px;
        max-width: 118px;
    }

    .op-buyer-hi--left {
        font-size: 12px;
    }

    .op-cart-btn--mobile-head {
        width: 50px;
        min-width: 50px;
        font-size: 14px;
    }
}

/* ======================================================
   ONPAL BUYER HEADER — Mobile Compact Fix
   Problem:
   - Mobile scroll compact mode made search too small
   Rule:
   - On mobile, keep full-width searchable header
   - Do not hide logo/name/cart row
====================================================== */

@media screen and (max-width: 900px) {
    body.op-header-compact .op-buyer-header {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 8px 12px !important;
    }

    body.op-header-compact .op-buyer-header .op-header__left {
        display: grid !important;
        width: 100% !important;
    }

    body.op-header-compact .op-buyer-header .op-search,
    body.op-header-compact .op-buyer-header .op-buyer-search {
        order: 2 !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        padding-right: 0 !important;
        display: flex !important;
    }

    body.op-header-compact .op-buyer-header .op-search input,
    body.op-header-compact .op-buyer-header .op-buyer-search input {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 42px !important;
        font-size: 14px !important;
    }

    body.op-header-compact .op-buyer-header .op-search button,
    body.op-header-compact .op-buyer-header .op-buyer-search button {
        width: 58px !important;
        min-width: 58px !important;
        height: 42px !important;
        flex: 0 0 58px !important;
    }

    body.op-header-compact .op-buyer-header .op-logo img {
        max-height: 34px !important;
    }
}

/* ======================================================
   ONPAL BUYER HEADER — Mobile Login Link
   Scope:
   - Show Login in mobile header when guest
   - Logged-in buyers still see Hi Name
====================================================== */

.op-mobile-auth-link {
    display: none;
}

@media screen and (max-width: 900px) {
    .op-mobile-auth-link {
        display: block !important;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
        font-weight: 900;
        line-height: 32px;
        color: #0b7a31;
        text-decoration: none;
        text-align: left;
    }

    .op-mobile-auth-link:hover {
        text-decoration: underline;
    }
}

/* Cart button: desktop hide, mobile show */
@media screen and (min-width: 901px) {
    .op-buyer-header .op-cart-btn.op-cart-btn--mobile-head {
        display: none !important;
    }
}

/* ======================================================
   ONPAL WEB — Product Card Cart + Buy Buttons
====================================================== */

.op-product-card__actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.op-product-card__actions .op-product-card__btn {
    width: 100%;
    border-radius: 10px;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.op-product-card__btn--cart {
    background: #ffffff !important;
    color: #0b7a31 !important;
    border: 1px solid #0b7a31 !important;
}

.op-product-card__btn--buy {
    background: #0b7a31 !important;
    color: #ffffff !important;
    border: 1px solid #0b7a31 !important;
}

.op-product-card__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media screen and (max-width: 480px) {
    .op-product-card__actions {
        gap: 6px;
    }

    .op-product-card__actions .op-product-card__btn {
        font-size: 12px;
        padding: 9px 6px;
    }
}
/* ======================================================
   ONPAL WEB — Product Card Cart + Buy Buttons
====================================================== */

.op-product-card__actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.op-product-card__actions .op-product-card__btn {
    width: 100%;
    border-radius: 10px;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.op-product-card__btn--cart {
    background: #ffffff !important;
    color: #0b7a31 !important;
    border: 1px solid #0b7a31 !important;
}

.op-product-card__btn--buy {
    background: #0b7a31 !important;
    color: #ffffff !important;
    border: 1px solid #0b7a31 !important;
}

.op-product-card__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media screen and (max-width: 480px) {
    .op-product-card__actions {
        gap: 5px;
    }

    .op-product-card__actions .op-product-card__btn {
        font-size: 9px;
        padding: 6px 3px;
        border-radius: 5px;
    }
}
/* ======================================================
   ONPAL BUYER HEADER — Account-only Mobile Drawer
   UI-only. Mobile PDP keeps discovery links out of drawer.
====================================================== */

.op-mobile-drawer__greeting {
    color: #07883f;
    font-weight: 900;
    padding: 12px;
    border-radius: 12px;
    background: #f0fff4;
    border: 1px solid #d8f3df;
}

@media screen and (max-width: 900px) {
    .op-buyer-menu {
        display: none !important;
    }

    .op-mobile-drawer {
        border: 1px solid rgba(7, 136, 63, 0.10);
    }
}
