/**
 * B2Bcyc - B2B Dealer Portal Theme
 * Custom styles for B2B functionality
 * 
 * Brand Colors:
 * - Primary: #1e40af (Blue)
 * - Secondary: #0f766e (Teal)
 * - Accent: #f59e0b (Amber)
 * - Success: #16a34a (Green)
 * - Warning: #ea580c (Orange)
 * - Danger: #dc2626 (Red)
 */

:root {
    --b2b-primary: #1e40af;
    --b2b-primary-dark: #1e3a8a;
    --b2b-secondary: #0f766e;
    --b2b-accent: #f59e0b;
    --b2b-success: #16a34a;
    --b2b-warning: #ea580c;
    --b2b-danger: #dc2626;
    --b2b-gray-50: #f9fafb;
    --b2b-gray-100: #f3f4f6;
    --b2b-gray-200: #e5e7eb;
    --b2b-gray-600: #4b5563;
    --b2b-gray-800: #1f2937;
}

/* ==========================================
   HEADER STYLES
   ========================================== */
.b2b-header {
    background: var(--b2b-primary);
    color: white;
}

.b2b-header .logo {
    max-height: 50px;
}

.dealer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 0.5rem;
}

.dealer-tier-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dealer-tier-1 { background: #fef3c7; color: #92400e; }
.dealer-tier-2 { background: #dbeafe; color: #1e40af; }
.dealer-tier-3 { background: #dcfce7; color: #166534; }

.credit-info {
    font-size: 0.875rem;
}

.credit-balance {
    color: var(--b2b-warning);
    font-weight: 600;
}

.credit-limit {
    color: var(--b2b-success);
}

/* ==========================================
   STATS DASHBOARD
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--b2b-gray-200);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon.orders { background: #dbeafe; color: var(--b2b-primary); }
.stat-icon.credit { background: #fef3c7; color: var(--b2b-warning); }
.stat-icon.limit { background: #dcfce7; color: var(--b2b-success); }
.stat-icon.warranty { background: #fce7f3; color: #db2777; }

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--b2b-gray-800);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--b2b-gray-600);
    margin-top: 0.5rem;
}

/* ==========================================
   PRODUCT CARD B2B
   ========================================== */
.product-card.b2b-card {
    position: relative;
    border: 1px solid var(--b2b-gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s;
}

.product-card.b2b-card:hover {
    border-color: var(--b2b-primary);
    box-shadow: 0 4px 12px rgba(30,64,175,0.15);
}

.product-card .card-checkbox {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
}

.product-card .card-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.product-card .product-sku {
    font-size: 0.75rem;
    color: var(--b2b-gray-600);
    font-family: monospace;
    margin-bottom: 0.25rem;
}

.product-card .stock-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.stock-status.in-stock {
    background: #dcfce7;
    color: #166534;
}

.stock-status.out-stock {
    background: #fee2e2;
    color: #991b1b;
}

.stock-status.low-stock {
    background: #fef3c7;
    color: #92400e;
}

.product-card .card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--b2b-gray-200);
}

.product-card .qty-input {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--b2b-gray-200);
    border-radius: 0.375rem;
    text-align: center;
}

.product-card .btn-add-cart {
    flex: 1;
    background: var(--b2b-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.product-card .btn-add-cart:hover {
    background: var(--b2b-primary-dark);
}

/* ==========================================
   BULK ACTIONS
   ========================================== */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--b2b-gray-100);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.bulk-actions .select-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-actions .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-actions .btn-primary {
    background: var(--b2b-primary);
    color: white;
    border: none;
}

.bulk-actions .btn-secondary {
    background: white;
    color: var(--b2b-gray-800);
    border: 1px solid var(--b2b-gray-200);
}

/* ==========================================
   PRICE DISPLAY B2B
   ========================================== */
.price-box {
    margin: 1rem 0;
}

.price-box .dealer-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--b2b-primary);
}

.price-box .retail-price {
    font-size: 1rem;
    color: var(--b2b-gray-600);
    text-decoration: line-through;
}

.price-box .savings {
    font-size: 0.875rem;
    color: var(--b2b-success);
    font-weight: 500;
}

/* ==========================================
   HERO BANNER
   ========================================== */
.hero-banner {
    background: linear-gradient(135deg, var(--b2b-primary) 0%, var(--b2b-secondary) 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.hero-banner h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-banner p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.hero-actions .btn-primary {
    background: white;
    color: var(--b2b-primary);
}

.hero-actions .btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .hero-banner {
        padding: 2rem 1rem;
    }
    
    .hero-banner h1 {
        font-size: 1.75rem;
    }
    
    .dealer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================
   B2B TOP BAR STYLES
   ========================================== */
.b2b-dealer-bar {
    background: linear-gradient(135deg, #1e40af 0%, #0f766e 100%);
}

.b2b-guest-bar {
    background: #1e40af;
}

.dealer-tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dealer-tier-1 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.dealer-tier-2 {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.dealer-tier-3 {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #22c55e;
}

/* Credit Info Styling */
#credit-balance {
    color: #fbbf24;
    font-weight: 700;
}

#credit-remaining {
    color: #4ade80;
    font-weight: 700;
}

/* B2B Navigation Menu */
.b2b-nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.b2b-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.b2b-nav-item:hover {
    background: #f3f4f6;
    color: #1e40af;
}

.b2b-nav-item.active {
    background: #dbeafe;
    color: #1e40af;
}

.b2b-nav-item i {
    font-size: 1.125rem;
}

/* Quick Order Button in Header */
.btn-quick-order {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-quick-order:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Mobile Header B2B */
@media (max-width: 1024px) {
    .b2b-dealer-bar,
    .b2b-guest-bar {
        display: none;
    }
    
    .b2b-mobile-info {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: linear-gradient(135deg, #1e40af 0%, #0f766e 100%);
        color: white;
        font-size: 0.75rem;
    }
    
    .b2b-mobile-info .dealer-name {
        font-weight: 600;
    }
    
    .b2b-mobile-info .credit-row {
        display: flex;
        justify-content: space-between;
    }
}

/* Header Sticky Enhancement */
header.shadow-gray {
    transition: box-shadow 0.3s ease;
}

header.shadow-gray.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   B2B HOMEPAGE STYLES
   ========================================== */

/* Hero Banner */
.b2b-hero-banner {
    min-height: 500px;
}

.b2b-hero-banner h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Stats Dashboard */
.b2b-stats-dashboard .stat-card {
    transition: all 0.3s ease;
}

.b2b-stats-dashboard .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Tier Cards */
.tier-card {
    transition: all 0.3s ease;
}

.tier-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.2);
}

/* Why Us Section */
.b2b-why-us .grid > div {
    transition: all 0.3s ease;
}

.b2b-why-us .grid > div:hover {
    transform: translateY(-5px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .b2b-hero-banner {
        min-height: auto;
        padding: 3rem 0;
    }
    
    .b2b-hero-banner h1 {
        font-size: 2rem;
    }
    
    .tier-card {
        padding: 1.5rem;
    }
    
    .b2b-stats-dashboard .stat-card {
        padding: 1rem;
    }
    
    .b2b-stats-dashboard .stat-card p.text-2xl {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .b2b-hero-banner h1 {
        font-size: 1.5rem;
    }
    
    .b2b-hero-banner p {
        font-size: 1rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .category-card .text-4xl {
        font-size: 2rem;
    }
}

/* Animation for scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.b2b-hero-banner,
.b2b-stats-dashboard,
.b2b-tiers-info,
.b2b-categories,
.b2b-why-us {
    animation: fadeInUp 0.6s ease-out;
}

/* ==========================================
   B2B PRODUCT CARD STYLES
   ========================================== */
.b2b-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.b2b-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.b2b-product-card .b2b-quick-add input[type="number"] {
    -moz-appearance: textfield;
}

.b2b-product-card .b2b-quick-add input[type="number"]::-webkit-outer-spin-button,
.b2b-product-card .b2b-quick-add input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* B2B Price Display Override */
.b2b-product-card .price-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.b2b-product-card .special-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
}

.b2b-product-card .regular-price {
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: line-through;
}

/* Product List Card */
.b2b-product-card-list {
    background: white;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.b2b-product-card-list:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Category Page Grid */
.b2b-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .b2b-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Quick Order Banner */
.b2b-quick-order-banner {
    background: linear-gradient(135deg, #1e40af 0%, #0f766e 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.b2b-quick-order-banner h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.b2b-quick-order-banner p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* ==========================================
   B2B PRODUCT DETAIL STYLES
   ========================================== */
.b2b-product-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.b2b-bulk-order {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

/* Product Detail Page */
.b2b-product-detail {
    max-width: 1400px;
    margin: 0 auto;
}

.b2b-product-detail .product-gallery {
    border-radius: 16px;
    overflow: hidden;
}

.b2b-product-detail .product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e40af;
}

.b2b-product-detail .product-price-original {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.b2b-product-detail .product-savings {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
}

/* Quantity Selector Enhanced */
.b2b-qty-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.b2b-qty-selector button {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border: none;
    font-size: 1.25rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.b2b-qty-selector button:hover {
    background: #e5e7eb;
}

.b2b-qty-selector input {
    width: 80px;
    height: 48px;
    text-align: center;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    background: white;
}

.b2b-qty-selector input:focus {
    outline: none;
}

/* Add to Cart Button Enhanced */
.b2b-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.b2b-add-to-cart:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3);
}

.b2b-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Request Quote Button */
.b2b-request-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: white;
    color: #1e40af;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: 2px solid #1e40af;
    cursor: pointer;
    transition: all 0.3s;
}

.b2b-request-quote:hover {
    background: #1e40af;
    color: white;
}

/* Product Tabs Enhanced */
.b2b-product-tabs {
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.b2b-product-tabs button {
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.b2b-product-tabs button:hover,
.b2b-product-tabs button.active {
    color: #1e40af;
    border-bottom-color: #1e40af;
}

/* ==========================================
   B2B ACCOUNT DASHBOARD STYLES
   ========================================== */
.b2b-dashboard-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%);
}

.b2b-stat-card {
    transition: all 0.3s ease;
}

.b2b-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Dashboard Table */
.b2b-dashboard table {
    width: 100%;
}

.b2b-dashboard table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.b2b-dashboard table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.b2b-dashboard table tr:hover {
    background: #f9fafb;
}

/* Quick Action Cards */
.b2b-quick-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.b2b-quick-action:hover {
    transform: translateX(4px);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background: #dcfce7;
    color: #166534;
}

.status-canceled {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================================
   B2B CHECKOUT STYLES
   ========================================== */

/* Checkout Header */
.b2b-checkout-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%);
    padding: 1rem 0;
}

/* Checkout Steps */
.b2b-checkout-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.b2b-checkout-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
}

.b2b-checkout-step.active {
    color: #1e40af;
}

.b2b-checkout-step.completed {
    color: #059669;
}

.b2b-checkout-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: #e5e7eb;
}

.b2b-checkout-step.active .b2b-checkout-step-number {
    background: #1e40af;
    color: white;
}

.b2b-checkout-step.completed .b2b-checkout-step-number {
    background: #059669;
    color: white;
}

/* Checkout Summary */
.b2b-checkout-summary {
    border-radius: 12px;
}

/* Checkout Cards */
.b2b-checkout-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.b2b-checkout-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.b2b-checkout-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

/* Checkout Success */
.b2b-checkout-success {
    text-align: center;
    padding: 3rem 1rem;
}

.b2b-checkout-success-icon {
    width: 80px;
    height: 80px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.b2b-checkout-success-icon svg {
    width: 40px;
    height: 40px;
    color: #16a34a;
}

/* Order Summary in Checkout */
.b2b-order-summary {
    background: #f9fafb;
    border-radius: 16px;
    padding: 1.5rem;
    position: sticky;
    top: 1rem;
}

.b2b-order-summary-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.b2b-order-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.b2b-order-item:last-child {
    border-bottom: none;
}

.b2b-order-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #e5e7eb;
}

.b2b-order-item-info {
    flex: 1;
}

.b2b-order-item-name {
    font-weight: 500;
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.25;
}

.b2b-order-item-sku {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: monospace;
}

.b2b-order-item-price {
    font-weight: 600;
    color: #111827;
}

/* Place Order Button */
.b2b-place-order-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.b2b-place-order-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.3);
}

.b2b-place-order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Checkout Totals */
.b2b-checkout-totals {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.b2b-checkout-total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.b2b-checkout-total-row.grand-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Animation */
@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.b2b-checkout-success-icon svg {
    animation: checkmark 0.5s ease-out;
}

/* ================================================
   MOBILE SMART SCROLL HEADER
   ================================================ */

/* Top Bar */
.b2b-mobile-topbar {
    background: linear-gradient(90deg, #060C3B 0%, #4D7EA8 100%);
    padding: 8px 16px;
    text-align: center;
}
.b2b-mobile-topbar p {
    color: #FBC256;
    font-size: 12px;
    font-weight: 500;
    margin: 0;
}

/* Mobile Header Wrapper */
.b2b-mobile-wrapper {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
}

/* Search Section - Normal State */
.b2b-mobile-wrapper .b2b-search-wrap {
    transition: all 0.3s ease;
    max-height: 100px;
    overflow: hidden;
}

/* Search Section - Scrolled State (Hidden) */
.b2b-mobile-wrapper.scrolled .b2b-search-wrap {
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
}

/* Compact Search Icon */
.b2b-search-icon-btn {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
}
.b2b-search-icon-btn .icon-search {
    font-size: 16px;
}

/* Show Icon when scrolled */
.b2b-mobile-wrapper.scrolled .b2b-search-icon-btn {
    display: flex !important;
}

/* Search Popup Overlay */
.b2b-search-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: none;
    padding: 16px;
}
.b2b-search-popup.active {
    display: block;
}
.b2b-search-popup-inner {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.b2b-search-popup input[type="text"] {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #060C3B;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
}
.b2b-search-popup .close-btn {
    width: 48px;
    height: 48px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Only apply on mobile */
@media (min-width: 1024px) {
    .b2b-mobile-topbar,
    .b2b-search-popup {
        display: none !important;
    }
}

/* Fix: Target trực tiếp search form container */
.b2b-mobile-wrapper.scrolled .shadow-sm > div:last-child,
.b2b-mobile-wrapper.scrolled form.w-full,
.b2b-mobile-wrapper.scrolled .w-full:has(form),
.b2b-mobile-wrapper.scrolled .w-full:has(input[name="query"]) {
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    transition: all 0.3s ease;
}

/* Ẩn div chứa search - cách khác */
.b2b-mobile-wrapper.scrolled > .shadow-sm > .w-full:not(.items-center) {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* ==========================================
   FIX: MOBILE HEADER LOGO CENTER
   ========================================== */
@media (max-width: 1023px) {
    /* Container cha - relative positioning */
    .shadow-sm > div:first-child {
        position: relative !important;
    }
    
    /* Logo container - center absolute */
    .shadow-sm > div:first-child > a[href="https://b2bcyc.com"],
    .shadow-sm > div:first-child > a[href*="shop.home"] {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    /* Logo image size */
    .shadow-sm > div:first-child > a img {
        height: 48px !important;
        width: auto !important;
    }
}

/* ==========================================
   FIX: MOBILE HEADER LOGO - ALL PAGES
   Đồng bộ logo header mobile cho tất cả trang
   ========================================== */
@media (max-width: 1023px) {
    /* Main header container */
    .flex.flex-wrap.gap-4.px-4.pb-4.pt-6.shadow-sm.lg\:hidden {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Row chứa hamburger + logo + icons */
    .flex.flex-wrap.gap-4.px-4.pb-4.pt-6.shadow-sm.lg\:hidden > .relative.flex.w-full.items-center.justify-between {
        min-height: 40px !important;
        position: relative !important;
    }
    
    /* Logo link - căn giữa tuyệt đối */
    .flex.flex-wrap.gap-4.px-4.pb-4.pt-6.shadow-sm.lg\:hidden a[href="/"],
    .flex.flex-wrap.gap-4.px-4.pb-4.pt-6.shadow-sm.lg\:hidden a[style*="absolute"] {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    /* Logo image - kích thước đồng nhất */
    .flex.flex-wrap.gap-4.px-4.pb-4.pt-6.shadow-sm.lg\:hidden a img {
        height: 48px !important;
        width: auto !important;
        max-width: 200px !important;
    }
    
    /* Đảm bảo hamburger menu luôn ở trái */
    .flex.flex-wrap.gap-4.px-4.pb-4.pt-6.shadow-sm.lg\:hidden .flex.items-center:first-child {
        z-index: 10;
    }
    
    /* Đảm bảo icons luôn ở phải */
    .flex.flex-wrap.gap-4.px-4.pb-4.pt-6.shadow-sm.lg\:hidden > .relative > div:last-child {
        z-index: 10;
    }
}

/* ==========================================
   LOGO SIZE 160% (48px)
   ========================================== */
@media (max-width: 1023px) {
    /* Logo trong header mobile */
    .b2b-mobile-wrapper .shadow-sm a[href*="b2bcyc.com"] img,
    .b2b-mobile-wrapper .shadow-sm a[href="/"] img,
    .shadow-sm.lg\:hidden a img,
    .flex.flex-wrap.gap-4.px-4 a[style*="absolute"] img {
        height: 48px !important;
        width: auto !important;
    }
    
    /* Container row phải có min-height phù hợp */
    .b2b-mobile-wrapper .shadow-sm > div:first-child,
    .shadow-sm.lg\:hidden > div:first-child {
        min-height: 56px !important;
    }
}

/* ==========================================
   SEARCH ICON & TRANSITIONS v5
   ========================================== */
@media (max-width: 1023px) {
    /* Search icon transition */
    .b2b-search-icon {
        transition: opacity 0.3s ease;
    }
    
    /* Search wrap transition */
    .b2b-search-wrap {
        transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    }
    
    /* Logo size 39px (130% of 30px) */
    .b2b-header-logo img {
        height: 39px !important;
        width: auto !important;
    }
}

/* ==========================================
   SEARCH ROW TRANSITION v6
   ========================================== */
@media (max-width: 1023px) {
    #b2b-search-row {
        transition: all 0.3s ease;
    }
    
    #b2b-search-toggle {
        transition: opacity 0.2s ease;
    }
}

/* ==========================================
   MOBILE HEADER LOGO ALIGNMENT v2
   Logo nằm cùng hàng với hamburger và icons
   ========================================== */
@media (max-width: 1023px) {
    /* Container row 1 - đảm bảo đủ chiều cao cho logo lớn */
    .shadow-sm.lg\:hidden > div:first-child {
        min-height: 60px !important;
    }
    
    /* Logo - căn giữa theo chiều dọc của row 1 */
    .shadow-sm.lg\:hidden > div:first-child > a[href*="b2bcyc"],
    .shadow-sm.lg\:hidden > div:first-child > a:has(img[alt="Bagisto"]) {
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    /* Logo image size */
    .shadow-sm.lg\:hidden > div:first-child > a img {
        height: 59px !important;
        width: auto !important;
        max-width: 180px !important;
    }
}

/* ==========================================
   MOBILE HEADER LOGO ALIGNMENT v3
   Logo nằm cùng hàng với hamburger và icons
   ========================================== */
@media (max-width: 1023px) {
    /* Row 1 container - chứa menu, logo, icons */
    .shadow-sm.lg\:hidden > div:first-child > div:first-child {
        align-items: center !important;
        min-height: 50px !important;
    }
    
    /* Logo link - căn giữa theo chiều dọc */
    .shadow-sm.lg\:hidden > div:first-child > div:first-child > a {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    /* Logo image - tăng kích thước */
    .shadow-sm.lg\:hidden > div:first-child > div:first-child > a > img,
    .shadow-sm.lg\:hidden img[alt="Bagisto"] {
        height: 45px !important;
        width: auto !important;
    }
}
