
/* BMart Homepage Styles */
:root {
    --bm-primary: #2563eb;
    --bm-primary-hover: #1d4ed8;
    --bm-accent: #f59e0b;
    --bm-bg-subtle: #f8fafc;
    --bm-border: #e2e8f0;
    --bm-text: #0f172a;
    --bm-text-muted: #64748b;
    --bm-card-bg: #ffffff;
    --bm-radius: 12px;
    --bm-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --bm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.bmart-home {
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
    font-family: inherit;
}

/* Hide default loop on home if needed or integrate cleanly */
.home .site-main > article.post {
    display: none !important;
}
.home .site-main > nav.navigation {
    display: none !important;
}

/* Live Search */
.bmart-search-wrap {
    position: relative;
    max-width: 680px;
    margin: 1.5rem auto 2.5rem auto;
    z-index: 50;
}
.bmart-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--bm-border);
    border-radius: 9999px;
    padding: 0.5rem 1.25rem;
    box-shadow: var(--bm-shadow);
    transition: all 0.2s ease;
}
.bmart-search-box:focus-within {
    border-color: var(--bm-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.bmart-search-icon {
    font-size: 1.15rem;
    margin-right: 0.75rem;
    user-select: none;
}
#bmart-live-search {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    font-size: 1.05rem;
    padding: 0.25rem 0;
    background: transparent;
    color: var(--bm-text);
}
.bmart-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-top-color: var(--bm-primary);
    border-radius: 50%;
    animation: bmart-spin 0.6s linear infinite;
}
@keyframes bmart-spin {
    to { transform: rotate(360deg); }
}
.bmart-live-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow-lg);
    max-height: 420px;
    overflow-y: auto;
    z-index: 100;
}
.bmart-search-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none !important;
    color: var(--bm-text) !important;
    border-bottom: 1px solid var(--bm-border);
    transition: background 0.15s ease;
}
.bmart-search-item:last-child {
    border-bottom: none;
}
.bmart-search-item:hover,
.bmart-search-item.is-selected {
    background: var(--bm-bg-subtle);
}
.bmart-search-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}
.bmart-search-info {
    flex-grow: 1;
    min-width: 0;
}
.bmart-search-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bmart-search-meta {
    font-size: 0.75rem;
    color: var(--bm-text-muted);
    margin-top: 0.2rem;
}
.bmart-search-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--bm-text-muted);
    font-size: 0.9rem;
}

/* Featured Slider */
.bmart-slider {
    position: relative;
    border-radius: var(--bm-radius);
    overflow: hidden;
    margin-bottom: 3.5rem;
    background: #0f172a;
    box-shadow: var(--bm-shadow-lg);
}
.bmart-slider-track {
    position: relative;
    height: 380px;
}
.bmart-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    display: block;
    text-decoration: none !important;
}
.bmart-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}
.bmart-slide img,
.bmart-thumb-ph {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    transition: transform 0.4s ease;
}
.bmart-slide:hover img {
    transform: scale(1.02);
}
.bmart-thumb-ph {
    background: linear-gradient(135deg, #1e293b, #334155);
}
.bmart-slide-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 2rem 2rem 2rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 60%, transparent 100%);
    color: #fff;
}
.bmart-badge {
    display: inline-block;
    background: var(--bm-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}
.bmart-slide-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.bmart-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.bmart-slider-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}
.bmart-slider-btn.prev { left: 1rem; }
.bmart-slider-btn.next { right: 1rem; }
.bmart-slider-dots {
    position: absolute;
    bottom: 1rem;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
.bmart-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}
.bmart-slider-dot.is-active {
    background: #fff;
    transform: scale(1.3);
}

/* Category Sections & Grid */
.bmart-cat-grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    margin-bottom: 4rem;
}
.bmart-cat-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--bm-border);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}
.bmart-cat-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--bm-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.bmart-cat-desc {
    color: var(--bm-text-muted);
    font-size: 0.9rem;
    margin: 0 0 0 1rem;
    flex-grow: 1;
}
.bmart-cat-more {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bm-primary) !important;
    text-decoration: none !important;
}
.bmart-cat-more:hover {
    text-decoration: underline !important;
}

.bmart-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.bmart-card {
    background: var(--bm-card-bg);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    overflow: hidden;
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--bm-shadow);
}
.bmart-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--bm-shadow-lg);
}
.bmart-card-thumb {
    height: 180px;
    background: #f1f5f9;
    overflow: hidden;
}
.bmart-card-thumb img,
.bmart-thumb-ph.sm {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.bmart-card:hover .bmart-card-thumb img {
    transform: scale(1.05);
}
.bmart-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.bmart-card-date {
    font-size: 0.75rem;
    color: var(--bm-text-muted);
    margin-bottom: 0.4rem;
}
.bmart-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
    color: var(--bm-text);
}
.bmart-card:hover .bmart-card-title {
    color: var(--bm-primary);
}
.bmart-card-excerpt {
    font-size: 0.85rem;
    color: var(--bm-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* CTA Box */
.bmart-cta-box {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid var(--bm-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}
.bmart-cta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.bmart-cta-card {
    background: #fff;
    border-radius: var(--bm-radius);
    padding: 1.5rem;
    box-shadow: var(--bm-shadow);
    display: flex;
    flex-direction: column;
}
.bmart-cta-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--bm-text);
}
.bmart-cta-card p {
    font-size: 0.875rem;
    color: var(--bm-text-muted);
    line-height: 1.5;
    margin: 0 0 1rem 0;
    flex-grow: 1;
}
.bmart-cta-form {
    display: flex;
    gap: 0.5rem;
}
.bmart-cta-form input {
    flex-grow: 1;
    border: 1px solid var(--bm-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}
.bmart-cta-form button {
    background: var(--bm-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s;
}
.bmart-cta-form button:hover {
    background: var(--bm-primary-hover);
}
.bmart-cta-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.bmart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}
.bmart-btn.primary {
    background: var(--bm-primary);
    color: #fff !important;
}
.bmart-btn.primary:hover {
    background: var(--bm-primary-hover);
}
.bmart-btn.ghost {
    background: var(--bm-bg-subtle);
    color: var(--bm-text) !important;
    border: 1px solid var(--bm-border);
}
.bmart-btn.ghost:hover {
    background: #e2e8f0;
}
.bmart-btn.small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}
.bmart-prompt-text {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0 0 1rem 0;
    color: #334155;
    max-height: 90px;
    overflow-y: auto;
}
.bmart-sub-msg {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #16a34a;
    font-weight: 600;
}

/* Single Copybar */
.bmart-copybar {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--bm-border);
    border-left: 4px solid var(--bm-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .bmart-post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bmart-cta-grid {
        grid-template-columns: 1fr;
    }
    .bmart-slider-track {
        height: 280px;
    }
    .bmart-slide-title {
        font-size: 1.15rem;
    }
}
@media (max-width: 600px) {
    .bmart-post-grid {
        grid-template-columns: 1fr;
    }
    .bmart-cat-desc {
        display: none;
    }
    .bmart-slider-track {
        height: 220px;
    }
}
