/* ============================================================
   BranaBee — Dokan Vendor Store Page
   Enqueued: branabee-dokan-vendor-store (priority 26)
   Loaded after: branabee-child-style, dokan-style
   Scope: dokan_is_store_page() only
   ============================================================ */

/* ── 0. BREADCRUMBS ────────────────────────────────────────── */

#breadcrumbs,
.woocommerce-breadcrumb,
.dokan-store-wrap ~ #breadcrumbs,
p#breadcrumbs {
    padding: 14px 0 6px 28px !important;
    margin: 0 !important;
}

/* ── 1. STORE HERO ─────────────────────────────────────────── */

.bb-store-hero {
    position: relative;
    margin-bottom: 0;
}

/* Banner */
.bb-hero-banner {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #22262d;
}

.bb-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.bb-store-hero:hover .bb-hero-img {
    transform: scale(1.015);
}

/* Placeholder when no banner is set */
.bb-hero-img--placeholder {
    background: linear-gradient(135deg, #22262d 0%, #3a1008 60%, #CB1D11 100%);
    width: 100%;
    height: 100%;
}

/* Gradient overlay — dark at bottom for text legibility */
.bb-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0.35) 40%,
        rgba(0, 0, 0, 0.72) 100%
    );
    z-index: 1;
}

/* Info bar — anchored to bottom of banner */
.bb-hero-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 20px 28px 20px;
    z-index: 2;
}

/* Avatar */
.bb-hero-avatar {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
    background: #fff;
    align-self: center;
    margin-bottom: 0;
}

.bb-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Name + meta wrapper */
.bb-hero-details {
    flex: 1;
    min-width: 0;
}

.bb-hero-name {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px !important;
    line-height: 1.15;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

/* Meta row: address, phone, email, rating — stacked vertically */
.bb-hero-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0 0 8px !important;
    padding: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.845rem;
}

.bb-hero-meta li {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.bb-hero-meta a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: color 0.18s;
}

.bb-hero-meta a:hover {
    color: #F5C200;
}

.bb-hero-meta i {
    font-size: 0.75rem;
    color: #F5C200;
    flex-shrink: 0;
}

.bb-hero-rating i {
    color: #F5C200;
}

/* Open / Closed badge */
.bb-open-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bb-open-badge--open {
    background: rgba(22, 163, 74, 0.82);
    color: #fff;
}

.bb-open-badge--open i {
    color: #86efac;
    font-size: 0.55rem;
}

.bb-open-badge--closed {
    background: rgba(203, 29, 17, 0.82);
    color: #fff;
}

.bb-open-badge--closed i {
    color: #fca5a5;
    font-size: 0.55rem;
}

/* Social icons */
.bb-hero-social {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.bb-hero-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.82rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.bb-hero-social a:hover {
    background: #CB1D11;
    transform: scale(1.1);
}

/* ── CTA button — right-aligned in hero bar ── */
.bb-hero-cta {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
    padding-bottom: 4px;
}

.bb-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    background: #CB1D11;
    color: #fff !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    text-decoration: none !important;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.18s, box-shadow 0.18s, transform 0.14s;
    white-space: nowrap;
}

.bb-cta-btn:hover {
    background: #a8160e;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    color: #fff !important;
}

.bb-cta-btn:active {
    transform: translateY(0);
}

.bb-cta-btn i {
    font-size: 0.9rem;
}

/* Hide CTA on very small screens — contact info is still in sidebar */
@media (max-width: 540px) {
    .bb-hero-cta { display: none; }
}

/* ── Follow / Share button injected before tabs via dokan_after_store_tabs ── */
.dokan-store-follow-store-button-container,
.dokan-share-btn-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.dokan-share-btn {
    align-self: center;
    display: flex;
    align-items: center;
}

/* ── 2. STORE TABS ─────────────────────────────────────────── */

.bb-store-tabs {
    background: #22262d;
    border-bottom: 3px solid #CB1D11;
    padding: 0 28px;
}

.bb-store-tabs ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.bb-store-tabs li {
    margin: 0;
}

.bb-store-tabs li a {
    display: block;
    padding: 13px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    transition: color 0.18s, border-color 0.18s;
}

.bb-store-tabs li a:hover,
.bb-store-tabs li a.active,
.bb-store-tabs li.active a {
    color: #fff;
    border-bottom-color: #F5C200;
}

/* ── 3. PAGE LAYOUT ────────────────────────────────────────── */

/* Some store pages inherit a constrained parent container; override to
   ensure all vendor stores render at full viewport width. */
body.dokan-store .store-page-wrap.woocommerce {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.dokan-store-wrap {
    display: flex !important;
    align-items: flex-start;
    background: #F3F1EE;
    min-height: 400px;
}

.dokan-store-wrap.layout-left {
    flex-direction: row;
}

.dokan-store-wrap.layout-right {
    flex-direction: row-reverse;
}

/* ── 4. LEFT SIDEBAR ───────────────────────────────────────── */

#dokan-secondary.dokan-store-sidebar {
    width: 230px !important;
    min-width: 230px !important;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2ddd6;
    padding: 22px 0;
    align-self: stretch;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

#dokan-secondary .dokan-widget-area {
    padding: 0;
}

/* Widget headings */
#dokan-secondary .widget-title,
#dokan-secondary h3.widget-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #CB1D11;
    padding: 0 18px 8px !important;
    margin: 16px 0 6px !important;
    border-bottom: 1px solid #f0ece6;
}

#dokan-secondary .widget-title:first-child,
#dokan-secondary h3.widget-title:first-child {
    margin-top: 0 !important;
}

/* Category list */
#dokan-secondary ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#dokan-secondary ul li {
    margin: 0;
}

#dokan-secondary ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 18px;
    color: #212328;
    font-size: 0.875rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, padding-left 0.15s, border-color 0.15s;
}

#dokan-secondary ul li a:hover {
    background: #f8f7f5;
    color: #CB1D11;
    padding-left: 22px;
    border-left-color: #CB1D11;
}

/* Category count pill */
#dokan-secondary ul li a .count,
#dokan-secondary ul li .count {
    background: #f0ece6;
    color: #888;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
}

/* Contact widget */
#dokan-secondary .dokan-store-contact form input,
#dokan-secondary .dokan-store-contact form textarea {
    border: 1px solid #e0dbd4;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

#dokan-secondary .dokan-store-contact form input:focus,
#dokan-secondary .dokan-store-contact form textarea:focus {
    outline: none;
    border-color: #CB1D11;
    box-shadow: 0 0 0 2px rgba(203, 29, 17, 0.1);
}

#dokan-secondary .dokan-store-contact form .dokan-btn {
    background: #CB1D11;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 9px 18px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    width: 100%;
    transition: background 0.18s;
    margin-top: 6px;
}

#dokan-secondary .dokan-store-contact form .dokan-btn:hover {
    background: #a8160e;
}

/* Store hours widget */
#dokan-secondary .dokan-store-open-close-widget td {
    font-size: 0.82rem;
    padding: 3px 6px;
    color: #444;
}

#dokan-secondary .dokan-store-open-close-widget td:first-child {
    font-weight: 600;
    color: #212328;
}

/* ── 5. MAIN CONTENT ───────────────────────────────────────── */

#dokan-primary.dokan-single-store {
    flex: 1;
    min-width: 0;
}

#dokan-content.store-page-wrap {
    padding: 24px 26px 40px !important;
}

.seller-items {
    margin-top: 4px;
}

/* Breathing room above the search input and sort dropdown */
.dokan-single-store .woocommerce-result-count,
.dokan-single-store .woocommerce-ordering,
.dokan-single-store .dokan-store-product-search,
.dokan-single-store form.woocommerce-product-search,
.dokan-single-store .berocket_ajax_products_filter,
.dokan-single-store .brfap_filter,
.dokan-store-products-filter-area {
    margin-top: 20px;
}

/* ── 6. PRODUCT GRID — 4 COLUMNS ──────────────────────────── */

/* Force 4-column grid regardless of WooCommerce/Astra columns-N class */
.dokan-single-store ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    float: none !important;
    width: 100% !important;
}

.dokan-single-store ul.products li.product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

/* Tablet: 3 columns */
@media (max-width: 1100px) {
    .dokan-single-store ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Wide mobile: 2 columns */
@media (max-width: 640px) {
    .dokan-single-store ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* Small mobile: 1 column */
@media (max-width: 380px) {
    .dokan-single-store ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* ── 8. RESULTS COUNT + SORT BAR ───────────────────────────── */

.dokan-single-store .woocommerce-result-count {
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 14px;
    float: none;
}

.dokan-single-store .woocommerce-ordering {
    float: none;
    margin-bottom: 14px;
}

.dokan-single-store .woocommerce-ordering select {
    border: 1px solid #e0dbd4;
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 0.85rem;
    color: #212328;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
}

.dokan-single-store .woocommerce-ordering select:focus {
    outline: none;
    border-color: #CB1D11;
}

/* Sort bar wrapper */
.dokan-single-store .woocommerce-products-header,
.dokan-single-store .woocommerce-result-count + .woocommerce-ordering {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ── 9. PAGINATION ─────────────────────────────────────────── */

.dokan-single-store .dokan-pagination-container,
.dokan-single-store nav.woocommerce-pagination {
    margin-top: 36px;
    display: flex;
    justify-content: center;
}

.dokan-single-store .dokan-pagination-container .page-numbers,
.dokan-single-store nav.woocommerce-pagination ul.page-numbers {
    display: inline-flex !important;
    gap: 4px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dokan-single-store .page-numbers li a,
.dokan-single-store .page-numbers li span,
.dokan-store-wrap .page-numbers a,
.dokan-store-wrap .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e0dbd4;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #CB1D11 !important;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dokan-single-store .page-numbers li a:hover {
    background: #CB1D11;
    border-color: #CB1D11;
    color: #fff;
}

.dokan-single-store .page-numbers li span.current {
    background: #CB1D11;
    border-color: #CB1D11;
    color: #fff;
    font-weight: 700;
}

.dokan-single-store .page-numbers li span.dots {
    border: none;
    background: none;
    color: #bbb;
}

/* ── 10. EMPTY STATE ───────────────────────────────────────── */

.dokan-single-store .dokan-info {
    text-align: center;
    padding: 64px 24px;
    color: #888;
    font-size: 1rem;
    background: #fff;
    border: 1px dashed #e0dbd4;
    border-radius: 6px;
    margin-top: 16px;
}

/* ── 11. RESPONSIVE ────────────────────────────────────────── */

/* Wide tablet */
@media (max-width: 1100px) {
    #dokan-secondary.dokan-store-sidebar {
        width: 200px !important;
        min-width: 200px !important;
    }

    .bb-hero-banner { height: 240px; }
    .bb-hero-name  { font-size: 1.45rem; }
}

/* Tablet */
@media (max-width: 900px) {
    .dokan-store-wrap.layout-left,
    .dokan-store-wrap.layout-right {
        flex-direction: column !important;
    }

    #dokan-secondary.dokan-store-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        border-right: none;
        border-bottom: 1px solid #e2ddd6;
        padding: 16px 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    /* Sidebar categories go horizontal on tablet */
    #dokan-secondary ul {
        display: flex;
        flex-wrap: wrap;
        padding: 0 10px;
    }

    #dokan-secondary ul li {
        flex: 0 0 auto;
    }

    #dokan-secondary ul li a {
        padding: 6px 14px;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    #dokan-secondary ul li a:hover {
        padding-left: 14px;
        border-left: none;
        border-bottom-color: #CB1D11;
    }

    .bb-hero-banner { height: 210px; }

    /* Tabs: allow horizontal scroll on tablet so they don't wrap awkwardly */
    .bb-store-tabs {
        padding: 0 18px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .bb-store-tabs::-webkit-scrollbar { display: none; }
    .bb-store-tabs ul { flex-wrap: nowrap; }
    .bb-store-tabs li a { padding: 11px 14px; font-size: 0.78rem; white-space: nowrap; }

    #dokan-content.store-page-wrap { padding: 18px 16px 32px !important; }
}

/* Mobile */
@media (max-width: 640px) {
    .bb-hero-banner { height: 200px; }

    .bb-hero-info {
        padding: 14px 16px;
        gap: 12px;
        /* On mobile the CTA is hidden, so no need to space for it */
        flex-wrap: wrap;
    }

    .bb-hero-avatar {
        width: 64px;
        height: 64px;
    }

    .bb-hero-name { font-size: 1.15rem; }

    .bb-hero-meta {
        font-size: 0.8rem;
        gap: 3px;
    }

    /* Compact the meta on mobile — show only address + rating */
    .bb-hero-meta li:nth-child(3) { display: none; } /* hide email on mobile */

    #dokan-content.store-page-wrap { padding: 14px 12px 28px !important; }

    /* Sort and search fields full width on mobile */
    .dokan-single-store .woocommerce-ordering select {
        width: 100%;
    }

    /* Pagination touch targets */
    .dokan-single-store .page-numbers li a,
    .dokan-single-store .page-numbers li span,
    .dokan-store-wrap .page-numbers a,
    .dokan-store-wrap .page-numbers span {
        width: 42px;
        height: 42px;
        font-size: 0.9rem;
    }
}

/* Small mobile */
@media (max-width: 420px) {
    .bb-hero-banner { height: 170px; }
    .bb-hero-meta { display: none; }
    .bb-hero-name { font-size: 1rem; }
}
