/* B2B Alibaba-Style Layout Stylesheet */

/* Global Colors & Utilities */
:root {
    --b2b-orange: #ff6a00;
    --b2b-orange-hover: #e05d00;
    --b2b-blue: #00609e;
    --b2b-blue-light: rgba(0, 96, 158, 0.05);
    --b2b-green: #25d366;
    --b2b-zalo: #0068ff;
    --b2b-border: #e2e8f0;
    --b2b-bg-light: #f8fafc;
    --b2b-verified: #2ecc71;
}

/* Badges & Credibility Icons */
.b2b-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.b2b-badge-verified {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--b2b-verified);
    border: 1px solid rgba(46, 204, 113, 0.3);
}
.b2b-badge-gold {
    background-color: rgba(255, 170, 0, 0.1);
    color: #f39c12;
    border: 1px solid rgba(255, 170, 0, 0.3);
}

/* B2B Price Tiers Table (Alibaba Style) */
.b2b-price-tier-container {
    background: #fff;
    border: 1px solid var(--b2b-border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}
.b2b-price-tier-header {
    background: var(--b2b-blue-light);
    padding: 12px 16px;
    border-bottom: 1px solid var(--b2b-border);
}
.b2b-price-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--b2b-border);
}
.b2b-price-tier-grid:last-child {
    border-bottom: none;
}
.b2b-price-tier-item {
    padding: 16px;
    text-align: center;
    border-right: 1px solid var(--b2b-border);
}
.b2b-price-tier-item:last-child {
    border-right: none;
}
.b2b-price-tier-qty {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}
.b2b-price-tier-val {
    font-size: 18px;
    color: #1e293b;
    font-weight: 700;
}

/* B2B Wholesale / Trade Specs */
.b2b-trade-specs-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}
.b2b-trade-specs-table td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--b2b-border);
}
.b2b-trade-specs-table td.label-col {
    color: #64748b;
    font-weight: 600;
    width: 180px;
    background: #f8fafc;
}
.b2b-trade-specs-table td.value-col {
    color: #1e293b;
}

/* Specifications Grid */
.b2b-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background-color: var(--b2b-border);
    border: 1px solid var(--b2b-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}
.b2b-specs-row {
    display: contents;
}
.b2b-specs-label, .b2b-specs-value {
    padding: 12px 16px;
    font-size: 13px;
    background-color: #fff;
}
.b2b-specs-label {
    font-weight: 600;
    color: #64748b;
    background-color: #f8fafc;
}

@media (max-width: 768px) {
    .b2b-specs-grid {
        grid-template-columns: 1fr;
    }
    .b2b-specs-label {
        padding-bottom: 4px;
        font-weight: 700;
    }
    .b2b-specs-value {
        padding-top: 4px;
        border-bottom: 1px solid var(--b2b-border);
    }
}

/* Supplier Card Sidebar */
.b2b-supplier-card {
    background: #fff;
    border: 1px solid var(--b2b-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.b2b-supplier-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--b2b-border);
    padding-bottom: 10px;
}
.b2b-supplier-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}
.b2b-supplier-stat-label {
    color: #64748b;
}
.b2b-supplier-stat-val {
    font-weight: 600;
    color: #1e293b;
}
.b2b-quick-inquiry-box {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--b2b-border);
}

/* Floating Action Bar for Mobile */
.b2b-mobile-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    display: flex;
    padding: 10px 16px;
    gap: 8px;
    z-index: 1000;
}
.b2b-mobile-action-bar .btn {
    flex: 1;
    font-weight: 700;
    font-size: 13px;
    height: 42px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* B2B Sub-navigation tabs on Shop View */
.b2b-shop-navbar {
    background: #fff;
    border-bottom: 2px solid var(--b2b-blue);
    margin-top: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.b2b-shop-nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-x: auto;
}
.b2b-shop-nav-item {
    margin-bottom: -2px;
}
.b2b-shop-nav-link {
    display: block;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-decoration: none !important;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}
.b2b-shop-nav-link:hover {
    color: var(--b2b-blue);
}
.b2b-shop-nav-item.active .b2b-shop-nav-link {
    color: var(--b2b-blue);
    border-bottom: 2px solid var(--b2b-blue);
    background: rgba(0, 96, 158, 0.02);
}

/* Tab panes toggling */
.b2b-shop-tab-pane {
    display: none;
    padding-top: 20px;
}
.b2b-shop-tab-pane.active {
    display: block;
    animation: fadeInTab 0.3s ease-in-out;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Factory Tour Components */
.b2b-tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}
.b2b-tour-card {
    background: #fff;
    border: 1px solid var(--b2b-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}
.b2b-tour-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}
.b2b-tour-img-wrapper {
    height: 180px;
    overflow: hidden;
    position: relative;
    background: #e2e8f0;
}
.b2b-tour-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.b2b-tour-card:hover .b2b-tour-img {
    transform: scale(1.05);
}
.b2b-tour-content {
    padding: 16px;
}
.b2b-tour-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}
.b2b-tour-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* Home Section Layouts */
.b2b-home-intro-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--b2b-border);
    border-radius: 12px;
    padding: 24px;
}
.b2b-feature-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 991px) {
    .b2b-feature-metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 575px) {
    .b2b-feature-metric-grid {
        grid-template-columns: 1fr;
    }
}
.b2b-metric-item {
    background: #fff;
    border: 1px solid var(--b2b-border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.b2b-metric-icon {
    font-size: 20px;
    color: var(--b2b-blue);
    margin-bottom: 8px;
}
.b2b-metric-val {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}
.b2b-metric-lbl {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
}

/* B2B Slanted Banner Collage (5 Panels) */
.b2b-collage-banner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 110px;
    overflow: hidden;
    background-color: #000;
}
.b2b-collage-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: auto;
}
.b2b-collage-panel:hover {
    transform: scale(1.08);
}

.b2b-collage-panel.panel-1 {
    z-index: 5;
    clip-path: polygon(0% 0%, 23% 0%, 17% 100%, 0% 100%);
}
.b2b-collage-panel.panel-2 {
    z-index: 4;
    clip-path: polygon(23% 0%, 42% 0%, 36% 100%, 17% 100%);
}
.b2b-collage-panel.panel-3 {
    z-index: 3;
    clip-path: polygon(42% 0%, 61% 0%, 55% 100%, 36% 100%);
}
.b2b-collage-panel.panel-4 {
    z-index: 2;
    clip-path: polygon(61% 0%, 80% 0%, 74% 100%, 55% 100%);
}
.b2b-collage-panel.panel-5 {
    z-index: 1;
    clip-path: polygon(80% 0%, 100% 0%, 100% 100%, 74% 100%);
}

.b2b-collage-borders {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Overrides for Vendors list cards (sellers page & home top-sellers carousel) */
.others-store-card .other-store-banner {
    height: 110px !important;
    min-height: 110px !important;
    overflow: hidden;
    display: block;
}
/* Ensure collage fills the banner wrapper fully */
.others-store-card .other-store-banner .b2b-collage-banner {
    position: relative;
    width: 100%;
    height: 110px !important;
    min-height: 110px !important;
    overflow: hidden;
    background-color: #1a1a2e;
}
.others-store-card .other-store-banner .b2b-collage-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}


/* ── Mobile: home hero banner height ───────────────────────────────────── */
/* Tablet nhỏ 576-767px: giảm còn ~200px */
@media (min-width: 576px) and (max-width: 767px) {
    .__slide-img {
        height: 200px !important;
        object-fit: cover;
        object-position: center center;
    }
}
/* Phone ≤575px: giảm còn ~160px (khoảng ½ desktop) */
@media (max-width: 575px) {
    .__slide-img {
        height: 160px !important;
        object-fit: cover;
        object-position: center center;
    }
}

/* ── Vendor card: logo overlaps cover + thin white ring ─────────────────── */
.others-store-card .name-area {
    margin-top: 0 !important;
    padding-top: 6px;
    position: relative;
    z-index: 20 !important;   /* above collage panels & svg borders (z-index 10) */
}

.others-store-card .name-area .other-store-logo {
    margin-top: -46px;          /* lift logo onto the cover image */
    border: 2px solid #ffffff !important;   /* thin white ring accent */
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
    position: relative;
    z-index: 2;
}

/* ── Shop info card: mobile UX fix ──────────────────────────────────────── */
@media screen and (max-width: 575.98px) {
    /* undo the old 30px floating-circle chat button hack (it overlapped the title) */
    .seller-details .chat-with-seller-button {
        position: static !important;
        width: auto !important;
        height: 38px !important;
        padding: 0 12px !important;
        flex: 1 1 0;
    }

    /* WhatsApp / Zalo / Chat: one clean full-width row at the bottom of the card */
    .seller-details .seller-contact-actions-wrap {
        width: 100%;
    }
    .seller-details .seller-contact-actions {
        width: 100%;
        justify-content: stretch !important;
        padding: 0 10px 12px !important;
        gap: 8px;
        margin: 0 !important;
    }
    .seller-details .seller-contact-actions .vnex-contact-action,
    .seller-details .seller-contact-actions > a.btn {
        flex: 1 1 0;
        height: 38px !important;
        font-size: 12px !important;
        padding: 0 8px !important;
        white-space: nowrap;
    }

    /* tighter header: smaller logo, smaller title */
    .seller-details .w-90px {
        width: 64px !important;
    }
    .seller-details .font-weight-bolder span:first-child {
        font-size: 14.5px !important;
        line-height: 1.35;
        display: block;
    }
}
