/* Baqala («بقالة») — Ecomus home-grocery, child of Modora (Fashion). Only what differs lives here. */

/* Grocery product photos: square on a light card, rounded corners. */
body.baqala .card-product .card-product-wrapper { aspect-ratio: 1 / 1; border-radius: 10px; background-color: #f2f4f6; }
body.baqala .card-product .card-product-wrapper img { object-fit: contain; padding: 8px; }

/* Top bar. */
body.baqala .bq-topbar { padding: 8px 0; font-size: 13px; }
body.baqala .bq-topbar ul { margin: 0; }
body.baqala .bq-topbar p { margin: 0; }
body.baqala .bq-topbar .top-bar-language { display: flex; }
@media (max-width: 991px) {
    body.baqala .bq-topbar .tf-top-bar_wrap { grid-template-columns: 1fr; }
    body.baqala .bq-topbar .tf-top-bar_left,
    body.baqala .bq-topbar .top-bar-language { display: none; }
}

/* Header: two rows, wide search, labelled icons, categories button. */
body.baqala #header.bq-header { background: #fff; }
body.baqala #header.bq-header .main-header { padding: 18px 0; border-bottom: 1px solid var(--line, #ebebeb); }
body.baqala #header.bq-header .tf-form-search .search-box { display: flex; border: 1px solid var(--line, #e5e5e5); border-radius: 999px; overflow: hidden; background: #f7f7f7; }
body.baqala #header.bq-header .tf-form-search input { flex: 1; border: 0; background: transparent; padding: 10px 20px; height: 46px; }
body.baqala #header.bq-header .tf-form-search .tf-btn { border-radius: 999px; margin: 4px; padding: 0 18px; background: var(--main); color: #fff; }
body.baqala #header.bq-header .bq-labelled { display: flex; align-items: center; gap: 6px; }
body.baqala #header.bq-header .bq-labelled .text { font-size: 14px; font-weight: 500; }
body.baqala #header.bq-header .header-bottom { padding: 10px 0; border-bottom: 1px solid var(--line, #ebebeb); }
body.baqala #header.bq-header .bq-cats { position: relative; }
body.baqala #header.bq-header .bq-cats .categories-title { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 6px; background: var(--primary, #3bb77e); color: #fff; font-weight: 600; }
body.baqala #header.bq-header .bq-cats .list-categories-inner { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 240px; z-index: 60; background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: 10px 0; }
body.baqala #header.bq-header .bq-cats:hover .list-categories-inner,
body.baqala #header.bq-header .bq-cats:focus-within .list-categories-inner { display: block; }
body.baqala #header.bq-header .bq-cats .nav-mb-item a { display: block; padding: 8px 20px; }
body.baqala #header.bq-header .bq-cats .nav-mb-item a:hover { color: var(--primary, #3bb77e); background: #f6f6f6; }
body.baqala #header.bq-header .box-right .icon { font-size: 26px; }
body.baqala #header.bq-header .box-right .phone { font-size: 20px; font-weight: 700; color: var(--primary, #3bb77e); line-height: 1.1; }
body.baqala #header.bq-header .box-right .text { font-size: 12px; }

/* Hero: rounded box, text on one side, photo on the other. */
body.baqala .bq-hero .bq-sw-slideshow { overflow: hidden; }
body.baqala .bq-hero .bq-slide { display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: clamp(320px, 34vw, 480px); }
body.baqala .bq-hero .bq-slide .box-content { position: static; transform: none; padding: clamp(24px, 4vw, 64px); }
body.baqala .bq-hero .bq-slide .heading { font-size: clamp(30px, 3.8vw, 56px); line-height: 1.15; color: var(--heading, #253d4e); margin-bottom: 12px; }
body.baqala .bq-hero .bq-slide p { margin-bottom: 26px; color: var(--heading, #253d4e); }
body.baqala .bq-hero .bq-slide-img { height: 100%; }
body.baqala .bq-hero .bq-slide-img img { width: 100%; height: 100%; min-height: clamp(320px, 34vw, 480px); object-fit: cover; display: block; }
body.baqala .bq-hero .bq-hero-dots { position: absolute; bottom: 20px; inset-inline: 0; z-index: 3; }
@media (max-width: 767px) {
    body.baqala .bq-hero .bq-slide { grid-template-columns: 1fr; }
    body.baqala .bq-hero .bq-slide-img { order: -1; }
    body.baqala .bq-hero .bq-slide-img img { min-height: 220px; height: 220px; }
    body.baqala .bq-hero .bq-slide .heading br { display: none; }
}

/* Featured categories. */
body.baqala .flat-control-sw .flat-title .title { font-size: clamp(24px, 2.4vw, 34px); }
body.baqala .collection-item-circle.has-bg { background: #f2f4f6; border-radius: 10px; padding: 18px 10px 14px; }
body.baqala .collection-item-circle .collection-image { width: 100px; height: 100px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; display: block; }
body.baqala .collection-item-circle .collection-image img { width: 100%; height: 100%; object-fit: cover; }

/* Promo cards. */
body.baqala .bq-promos { gap: 30px; }
body.baqala .bq-promos .collection-inner { position: relative; display: block; }
body.baqala .bq-promos .collection-image { aspect-ratio: 2 / 1.15; overflow: hidden; }
body.baqala .bq-promos .collection-image img { width: 100%; height: 100%; object-fit: cover; }
body.baqala .bq-promos .collection-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 60%); border-radius: 10px; }
body.baqala .bq-promos .collection-content { position: absolute; inset: auto 0 0 0; padding: clamp(18px, 2.5vw, 34px); z-index: 2; }
body.baqala .bq-promos .heading { font-size: clamp(20px, 2vw, 28px); line-height: 1.25; margin: 6px 0 16px; }

/* Deals of the day. */
body.baqala .bq-deals .flat-title .title,
body.baqala .bq-popular .flat-title .title { font-size: clamp(24px, 2.4vw, 34px); }
body.baqala .bq-deal-card { border-radius: 14px; padding: 14px 14px 20px; background: #f2f4f6; }
body.baqala .bq-deal-card .card-product .card-product-wrapper { background: #fff; }
body.baqala .bq-deal-card .pr-stock { margin-top: 12px; font-size: 13px; }
body.baqala .bq-deal-card .progress { height: 6px; background: #e1e5e9; border-radius: 6px; margin-top: 6px; }
body.baqala .bq-deal-card .progress-bar { background: var(--primary, #3bb77e); border-radius: 6px; }
body.baqala .bq-deal-card .count-down { margin-top: 16px; display: flex; justify-content: center; }

/* Popular products: tabs beside the title. */
body.baqala .bq-popular .widget-tab-5 { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0; }
body.baqala .bq-popular .widget-tab-5 a { padding: 4px 14px; border-radius: 999px; border: 1px solid transparent; color: var(--text-2, #545454); }
body.baqala .bq-popular .widget-tab-5 a.active { border-color: var(--primary, #3bb77e); color: var(--primary, #3bb77e); }
body.baqala .bq-popular .bq-grid { gap: 30px 20px; }
body.baqala .bq-popular .bq-grid-item[hidden] { display: none; }

/* "Why us" panel: the quality section with a yellow background setting. */
body.baqala .flat-wrap-iconbox { border-radius: 20px; padding: clamp(30px, 5vw, 70px) clamp(20px, 4vw, 60px); }

/* Subscription: photo and text. */
body.baqala .bq-img-text .tf-image-wrap img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
body.baqala .bq-img-text .heading { font-size: clamp(28px, 3vw, 44px); color: var(--heading, #253d4e); }
body.baqala .bq-popular .flat-title-tab { flex-wrap: wrap; gap: 16px; align-items: center; }
body.baqala .bq-popular .widget-tab-5 { flex-direction: row; width: auto; border: 0; }
body.baqala .bq-popular .widget-tab-5 .nav-tab-item { width: auto; }
body.baqala .bq-popular .widget-tab-5 a { display: inline-block; width: auto; white-space: nowrap; }

/* ── Matched to the live demo (wpecomus.com/grocery, measured at 1366px) ─────────────────── */

/* Hero box 686px tall; promo cards 480px. */
body.baqala .bq-hero .bq-slide { min-height: clamp(320px, 50vw, 686px); }
body.baqala .bq-hero .bq-slide-img img { min-height: clamp(320px, 50vw, 686px); }
body.baqala .bq-promos .collection-image { aspect-ratio: auto; height: clamp(240px, 35vw, 480px); }

/* Deal cards: centred name and price. */
body.baqala .bq-deal-card .card-product-info { display: flex; flex-direction: column; align-items: center; text-align: center; }
body.baqala .bq-deal-card .card-product-info .title { text-align: center; font-weight: 600; }

/* Popular products: bordered rounded cards; name and price on one side, round green cart button on the other. */
body.baqala .bq-popular .card-product { border: 1px solid #ebebeb; border-radius: 10px; padding: 8px 8px 14px; height: 100%; }
body.baqala .bq-popular .card-product .card-product-info { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title cart" "price cart"; align-items: center; column-gap: 10px; padding: 12px 6px 0; }
body.baqala .bq-popular .card-product .card-product-info .title { grid-area: title; font-weight: 600; font-size: 14px; }
body.baqala .bq-popular .card-product .card-product-info .price { grid-area: price; font-size: 16px; font-weight: 700; color: var(--main); }
body.baqala .bq-popular .card-product .card-product-info .add-to-cart-btn { grid-area: cart; width: 40px !important; height: 40px; min-width: 0; padding: 0; border-radius: 50%; background: var(--primary, #3bb77e); color: transparent; font-size: 0; margin: 0; position: relative; }
body.baqala .bq-popular .card-product .card-product-info .add-to-cart-btn::before { content: "\e908"; font-family: 'icomoon'; font-size: 16px; color: #fff; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* "Why us": the small line above the title. */
body.baqala .flat-wrap-iconbox .flat-title { display: flex; flex-direction: column; }
body.baqala .flat-wrap-iconbox .flat-title .sub-title,
body.baqala .flat-wrap-iconbox .flat-title p { order: -1; font-size: 13px; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }

/* Subscription: portrait photo 412×512 on the start side, text centred beside it. */
body.baqala .bq-img-text .tf-img-with-text { align-items: center; }
body.baqala .bq-img-text .tf-image-wrap { order: 1; display: flex; justify-content: center; }
body.baqala .bq-img-text .tf-content-wrap { order: 2; }
body.baqala .bq-img-text .tf-image-wrap img { width: 412px; max-width: 100%; aspect-ratio: 412 / 512; }
body.baqala .bq-img-text .tf-btn { background: var(--heading, #253d4e); }
/* "Why us": the sub_title's wrapper goes above the title. */
body.baqala .flat-wrap-iconbox .flat-title > div { order: -1; }
body.baqala .flat-wrap-iconbox .flat-title .title { font-size: clamp(24px, 2.6vw, 36px); color: var(--heading, #253d4e); }
/* Cart circle: the template uses ::before for its loading spinner, so the bag goes on ::after. */
body.baqala .bq-popular .card-product .card-product-info .add-to-cart-btn::before { content: none; }
body.baqala .bq-popular .card-product .card-product-info .add-to-cart-btn::after { content: "\e908"; font-family: 'icomoon' !important; font-size: 16px; color: #fff; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
/* Header rows as tall as the demo's. */
body.baqala #header.bq-header .main-header { padding: 12px 0; }
body.baqala #header.bq-header .logo-header img { max-height: 56px; width: auto; }
body.baqala #header.bq-header .header-bottom { padding: 6px 0; }
body.baqala .flat-wrap-iconbox .tf-icon-box .icon { width: 50px; height: 50px; font-size: 22px; border-width: 1px; }

/* ── Phones, matched to wpecomus.com/grocery at 390px ──────────────────────────────────────── */
@media (max-width: 767px) {
    /* hero: text and photo side by side inside the coloured box, as live */
    body.baqala .bq-hero .bq-slide { grid-template-columns: 1.35fr 1fr; min-height: 300px; }
    body.baqala .bq-hero .bq-slide-img { order: 0; }
    body.baqala .bq-hero .bq-slide-img img { min-height: 300px; height: 300px; }
    body.baqala .bq-hero .bq-slide .box-content { padding: 20px 16px; }
    body.baqala .bq-hero .bq-slide .heading { font-size: 24px; }
    body.baqala .bq-hero .bq-slide p { font-size: 13px; margin-bottom: 16px; }
    body.baqala .bq-hero .bq-slide .tf-btn { height: 40px; padding: 0 16px; font-size: 13px; }
    body.baqala .collection-item-circle .collection-image { width: 110px; height: 110px; }
    /* promo cards and "why us": swipe sideways, one and a bit per view */
    body.baqala .bq-promos { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; }
    body.baqala .bq-promos > * { flex: 0 0 85%; scroll-snap-align: start; }
    body.baqala .bq-promos .collection-image { height: 200px; }
    body.baqala .flat-wrap-iconbox .wrap-iconbox { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0 !important; }
    body.baqala .flat-wrap-iconbox .wrap-iconbox > * { flex: 0 0 100%; scroll-snap-align: center; }
    /* subscription: smaller centred photo */
    body.baqala .bq-img-text .tf-image-wrap img { width: 370px; max-width: 100%; }
}

/* Live search under the header search box. */
body.baqala .bq-search, body.nono .bq-search { position: relative; }
.bq-search-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; z-index: 80; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 16px 18px; max-height: 420px; overflow: auto; }
.bq-search-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.bq-search-results .ec-search-results { list-style: none; margin: 0; padding: 0; }
.bq-search-results .ec-search-results li { border-bottom: 1px solid #f0f0f0; padding: 8px 0; }
.bq-search-results .ec-search-results li:last-child { border-bottom: 0; }
.bq-search-results img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.bq-search-results .product-suggestion-list-link { display: flex; align-items: center; gap: 14px; color: #000; }
.bq-search-results .product-image { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: #f5f5f5; }
.bq-search-results .product-image img { width: 100%; height: 100%; object-fit: cover; }
body.baqala #header.bq-header .bq-headset { color: #000; display: flex; }

/* Phones: only cart + search beside the logo (as live); account and wishlist are in the bottom toolbar.
   With four icons the search icon slid under the logo. */
@media (max-width: 1149px) {
    #header.bq-header .nav-icon .bq-labelled { display: none !important; }
    #header.bq-header .nav-icon { gap: 14px; }
    #header.bq-header .logo-header img { max-height: 40px; width: auto; }
}
