/* ============================================
   Bigger eCommerce — Header & Footer
   ============================================ */

.be-header-wrapper {
    font-family: var(--be-font);
    color: var(--be-header-text);
    position: relative;
    z-index: 100;
}
.be-header-wrapper[data-sticky="1"] .be-topbar {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0px);
    z-index: 100;
}

/* ===== Top Bar ===== */
.be-topbar {
    background: var(--be-header-topbar-bg, var(--be-header-bg));
    border-bottom: 1px solid var(--be-border-light);
    box-shadow: var(--be-shadow-sm);
}
.be-topbar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 16px;
    padding: 0 20px;
    height: var(--be-header-h, 64px);
    position: relative;
}
.be-topbar__search-slot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
}
.be-topbar__logo {
    flex-shrink: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.be-topbar__logo img {
    max-height: 40px;
    width: auto;
}
.be-topbar__logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--be-header-logo-color, var(--be-header-accent));
}
.be-topbar__search-slot {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
}
.be-topbar__search {
    display: flex;
    align-items: center;
    background: var(--be-header-search-bg, var(--be-bg-gray));
    border-radius: var(--be-radius-pill);
    overflow: hidden;
    border: 1px solid var(--be-header-search-border, var(--be-border-light));
    transition: border-color var(--be-transition), box-shadow var(--be-transition);
}
.be-topbar__search:focus-within {
    border-color: var(--be-brand);
    box-shadow: var(--be-shadow-focus);
}
.be-topbar__search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--be-text);
    outline: none;
    font-family: inherit;
    min-width: 0;
}
.be-topbar__search-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--be-header-search-btn, var(--be-brand));
    cursor: pointer;
}
.be-topbar__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.be-topbar__util {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--be-header-util-color, var(--be-header-text));
    border-radius: var(--be-radius);
    position: relative;
    cursor: pointer;
    transition: color var(--be-transition), background var(--be-transition);
}
.be-topbar__util:hover {
    color: var(--be-header-util-hover-color, var(--be-header-accent));
    background: var(--be-header-util-hover-bg, var(--be-brand-light));
}
.be-topbar__util svg {
    display: block;
}
.be-topbar__util-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}
.be-topbar__util-count {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--be-header-cart-count-bg, var(--be-brand));
    color: var(--be-header-cart-count-color, #fff);
    border-radius: var(--be-radius-pill);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== Language Switcher ===== */
.be-lang-switcher {
    position: relative;
}
.be-lang-btn {
    cursor: pointer;
}
.be-lang-flag {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    display: block;
}
.be-lang-flag-sm {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
}
.be-lang-text {
    font-size: 13px;
    font-weight: 600;
}
.be-lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline-end: 0;
    min-width: 160px;
    background: var(--be-bg-white);
    border: 1px solid var(--be-border);
    border-radius: var(--be-radius);
    box-shadow: var(--be-shadow-md);
    padding: 6px 0;
    z-index: 200;
    margin-top: 4px;
}
.be-lang-switcher:hover .be-lang-dropdown,
.be-lang-switcher.is-open .be-lang-dropdown {
    display: block;
}
.be-lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--be-text-secondary);
    text-decoration: none;
    transition: background var(--be-transition-fast), color var(--be-transition-fast);
}
.be-lang-item:hover {
    background: var(--be-brand-light);
    color: var(--be-brand);
}
.be-lang-item.is-active {
    color: var(--be-brand);
    font-weight: 700;
}
.be-lang-item svg {
    margin-inline-start: auto;
    color: var(--be-brand);
}
/* ===== Navbar ===== */
.be-navbar {
    background: var(--be-header-navbar-bg, var(--be-header-bg));
    border-bottom: 1px solid var(--be-border-light);
}
.be-navbar__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

.be-navbar--start .be-navbar__list {
    justify-content: flex-start;
}

.be-navbar--center .be-navbar__list {
    justify-content: center;
}

.be-navbar--end .be-navbar__list {
    justify-content: flex-end;
}
.be-navbar__item {
    position: relative;
}
.be-navbar__link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--be-header-navlink-color, var(--be-header-text));
    text-decoration: none;
    transition: color var(--be-transition);
    border-bottom: 3px solid transparent;
}
.be-navbar__link:hover,
.be-navbar__item:hover > .be-navbar__link {
    color: var(--be-header-navlink-hover-color, var(--be-header-accent));
    border-bottom-color: var(--be-header-navlink-hover-border, var(--be-header-accent));
}

/* ===== Side Rail ===== */
.be-siderail {
    position: fixed !important;
    inset-inline-start: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 16px 4px;
    background: var(--be-header-siderail-bg, var(--be-bg-white));
    border-inline-end: 1px solid var(--be-border-light);
    box-shadow: var(--be-shadow-sm);
    width: 65px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden; /* منع شريط التمرير الأفقي الناتج عن فائض العناصر الأبناء */
    margin: 0 !important;
}
.be-siderail__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    max-width: 100%; /* احترام حدود الحاوية */
    padding: 8px 4px;
    box-sizing: border-box;
    text-decoration: none;
    color: var(--be-header-siderail-item-color, var(--be-text-secondary));
    border-radius: var(--be-radius-sm);
    transition: color var(--be-transition), background var(--be-transition);
}
.be-siderail__item:hover {
    background: var(--be-header-siderail-item-hover-bg, var(--be-brand-light));
    color: var(--be-header-siderail-item-hover-color, var(--be-brand));
}
.be-siderail__label {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
    line-height: 1.2;
}

/* ===== Mobile Nav ===== */
.be-mobilenav {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 90;
    display: none;
    background: var(--be-bg-white);
    border-top: 1px solid var(--be-border-light);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.be-mobilenav {
    align-items: center;
    justify-content: space-around;
    height: 56px;
}
.be-mobilenav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--be-text-secondary);
    position: relative;
    cursor: pointer;
    transition: color var(--be-transition);
}
.be-mobilenav__item:hover,
.be-mobilenav__item:active {
    color: var(--be-brand);
}
.be-mobilenav__label {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
}
.be-mobilenav__item--cart .be-cart-badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 25%;
    min-width: 16px;
    height: 16px;
    background: var(--be-brand);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Mobile Panels ===== */
.be-mobile-search-panel {
    position: fixed;
    bottom: 56px;
    inset-inline: 0;
    z-index: 91;
    padding: 12px 16px;
    background: var(--be-bg-white);
    border-top: 1px solid var(--be-border-light);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.be-mobile-search {
    display: flex;
    align-items: center;
    background: var(--be-bg-gray);
    border-radius: var(--be-radius-pill);
    overflow: hidden;
}
.be-mobile-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 15px;
    outline: none;
}
.be-mobile-search button {
    flex-shrink: 0;
    border: none;
    background: var(--be-brand);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.be-mobile-menu-panel {
    position: fixed;
    bottom: 56px;
    inset-inline: 0;
    z-index: 91;
    background: var(--be-bg-white);
    border-top: 1px solid var(--be-border-light);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    max-height: 60vh;
    overflow-y: auto;
}
.be-mobile-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--be-border-light);
}
.be-mobile-menu-title {
    font-size: 16px;
    font-weight: 700;
}
.be-mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--be-text-muted);
}
.be-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.be-mobile-menu-list li a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--be-text);
    text-decoration: none;
    border-bottom: 1px solid var(--be-border-light);
}
.be-mobile-menu-list li a:hover {
    background: var(--be-brand-light);
    color: var(--be-brand);
}
.be-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 89;
    background: rgba(0,0,0,0.4);
}

/* ===== Mini Cart ===== */
.be-minicart {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
}
.be-minicart[data-open] {
    display: block;
}
.be-minicart__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}
.be-minicart__drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--be-bg-white);
    display: flex;
    flex-direction: column;
}
.be-minicart--right .be-minicart__drawer {
    inset-inline-end: 0;
    transform: translateX(100%);
}
.be-minicart--left .be-minicart__drawer {
    inset-inline-start: 0;
    transform: translateX(-100%);
}
.be-minicart[data-open] .be-minicart__drawer {
    transform: translateX(0) !important;
}
.be-minicart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--be-border-light);
    flex-shrink: 0;
}
.be-minicart__title {
    font-size: 18px;
    font-weight: 700;
}
.be-minicart__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--be-text-muted);
    line-height: 1;
}
.be-minicart__close:hover {
    color: var(--be-text);
}
.be-minicart__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}
.be-minicart__item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--be-border-light);
    align-items: center;
}
.be-minicart__item-img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--be-radius-sm);
    overflow: hidden;
}
.be-minicart__item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.be-minicart__item-info {
    flex: 1;
    min-width: 0;
}
.be-minicart__item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--be-text);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.be-minicart__item-meta {
    font-size: 12px;
    color: var(--be-text-secondary);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.be-minicart__item-meta b {
    color: var(--be-brand);
}

/* ===== Global Button Reset (Minicart) ===== */
.be-minicart [type=button],
.be-minicart [type=submit],
.be-minicart button {
    border: 0px solid var(--be-brand);
}
/* ===== Minicart Quantity Controls ===== */
.be-mc-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgb(224, 224, 224);
    border-radius: 4px;
    overflow: hidden;
    background: rgb(249, 249, 249);
}
.be-mc-qty-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.be-mc-qty-btn {
    width: 24px;
    height: 28px;
    border: none;
    cursor: pointer;
    line-height: 1;
    font-size: 14px;
    transition: background-color 0.2s;
}
.be-mc-qty-btn[type=button]:not(:disabled) {
    color: rgb(255, 91, 0);
    background-color: rgb(255, 255, 255);
    padding: 4px 12px;
    font-weight: bold;
}
.be-mc-qty-btn:hover {
    background: var(--be-brand-light);
    color: var(--be-brand);
}
.be-mc-qty-val {
    padding: 0px 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: rgb(51, 51, 51);
}
.be-mc-qty-input {
    width: 40px;
    height: 28px;
    border: none;
    background: var(--be-bg-white, #fff);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: rgb(51, 51, 51);
    font-family: inherit;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.be-mc-qty-input::-webkit-outer-spin-button,
.be-mc-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.be-minicart__item-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--be-text-muted);
    cursor: pointer;
    border-radius: var(--be-radius-sm);
    transition: background var(--be-transition), color var(--be-transition);
}
.be-minicart__item-remove:hover {
    color: var(--be-danger);
    background: var(--be-danger-light);
}
.be-minicart__item-remove svg {
    width: 16px;
    height: 16px;
}
.be-minicart__empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--be-text-muted);
}
.be-minicart__footer {
    border-top: 1px solid var(--be-border-light);
    padding: 16px 20px;
    flex-shrink: 0;
    background: var(--be-bg-gray);
}
.be-minicart__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
}
.be-minicart__total {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
}
.be-minicart__total b {
    color: var(--be-brand);
}
.be-minicart__discount {
    color: var(--be-success, #00a32a);
    font-weight: 600;
}
.be-minicart__discount span:last-child {
    color: var(--be-success, #00a32a);
}
.be-minicart__actions {
    display: flex;
    gap: 8px;
}
.be-minicart__btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--be-radius);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    display: block;
}
.be-minicart__btn--cart {
    background: var(--be-brand-light);
    color: var(--be-brand);
    border: 1px solid var(--be-brand);
}
.be-minicart__btn--checkout {
    background: var(--be-brand);
    color: #fff;
}

/* ===== Footer ===== */
.be-footer {
    font-family: var(--be-font);
    padding: 40px 0 0;
    margin-top: 40px;
}
.be-footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr;
    gap: 24px;
    padding: 0 20px 32px;
}
.be-footer__col-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}
.be-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.be-footer__links li {
    margin-bottom: 8px;
}
.be-footer__links a {
    font-size: 14px;
    color: var(--be-footer-link);
    text-decoration: none;
    transition: color var(--be-transition);
}
.be-footer__links a:hover {
    color: var(--be-footer-link-hover);
}
.be-footer__about {
    font-size: 14px;
    line-height: 1.6;
    color: var(--be-footer-link);
}
.be-footer__logo img {
    max-width: 160px;
    max-height: 50px;
    margin-bottom: 12px;
}
.be-footer__socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.be-footer__social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    transition: background var(--be-transition), transform var(--be-transition);
}
.be-footer__social:hover {
    background: var(--be-footer-link-hover);
    transform: translateY(-2px);
}
.be-footer__newsletter-text {
    font-size: 13px;
    color: var(--be-footer-link);
    margin-bottom: 10px;
}
.be-footer__newsletter {
    display: flex;
    gap: 6px;
}
.be-footer__newsletter input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--be-radius);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 13px;
    outline: none;
}
.be-footer__newsletter input::placeholder {
    color: rgba(255,255,255,0.5);
}
.be-footer__newsletter button {
    padding: 10px 16px;
    border: none;
    border-radius: var(--be-radius);
    background: var(--be-footer-link-hover);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.be-footer__combined-row {
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
}
.be-footer__payments {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0;
}
.be-footer__payment {
    padding: 4px;
    background: #fff;
    border-radius: var(--be-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.be-footer__payment svg {
    display: block;
    border-radius: 3px;
}
.be-footer__payment--custom {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #333;
}
.be-footer__bottom {
    padding: 0;
    text-align: center;
}
.be-footer__copyright {
    font-size: 13px;
    color: var(--be-footer-link);
}

/* ===== Newsletter Messages ===== */
.be-footer__newsletter-msg {
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
}
.be-footer__newsletter-msg.is-success {
    color: #4ade80;
}
.be-footer__newsletter-msg.is-error {
    color: #f87171;
}

/* ===== Back to Top ===== */
.be-back-to-top {
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    z-index: 80;
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--be-brand);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--be-shadow-md);
    transition: opacity var(--be-transition), transform var(--be-transition), background var(--be-transition);
}
.be-back-to-top.is-visible {
    display: flex;
}
.be-back-to-top:hover {
    transform: translateY(-3px);
    background: var(--be-brand-hover);
}

/* ===== Search Plugin (AJAX Search for WooCommerce) ===== */
.dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp {
    padding: 0px;
}
.dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp .dgwt-wcas-search-input {
    padding: 10px;
    line-height: 24px;
    font-size: 17px;
    border: 2px solid transparent;
    border-radius: 30px;
    height: 75px;
    font-family: Roboto, sans-serif;
    background-color: #eee;
}

/* ===== Responsive ===== */

/* Siderail body padding — applied via PHP class .be-has-siderail (not :has) */
body.be-has-siderail {
    padding-inline-start: 65px;
}

@media (max-width: 1024px) {
    .be-siderail {
        display: none;
    }
    body.be-has-siderail {
        padding-inline-start: 0;
    }
}
@media (max-width: 768px) {
    .be-topbar__util-label {
        display: none;
    }
    .be-topbar__actions > .be-topbar__util {
        display: none;
    }
    .be-topbar__actions > .be-lang-switcher {
        display: block;
    }
    .be-topbar__inner {
        gap: 8px;
        padding: 0 12px;
        justify-content: space-between;
        position: static;
    }
    .be-topbar__search-slot {
        position: static;
        transform: none;
        flex: 1;
        max-width: 100%;
        margin: 0 8px;
    }
    .be-topbar__search {
        border-radius: var(--be-radius);
    }
    .be-topbar__search-input {
        padding: 8px 12px;
        font-size: 14px;
    }
    .be-topbar__search-btn {
        width: 36px;
        height: 36px;
    }
    .be-topbar__logo-text {
        font-size: 18px;
    }
    .be-navbar {
        display: none;
    }
    .be-mobilenav {
        display: flex;
    }
    .be-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .be-footer__col--about,
    .be-footer__col--newsletter {
        grid-column: 1 / -1;
    }
    body {
        padding-bottom: 56px;
    }
}
@media (max-width: 480px) {
    .be-footer__inner {
        grid-template-columns: 1fr;
    }
    .be-footer__combined-row {
        flex-direction: column;
        text-align: center;
    }
    .be-minicart__drawer {
        width: 100%;
    }
}
