/* Custom CSS for Home Page & Taxonomy Archives */

/* --- 0. Hero Slider Section --- */
.baoan-slider-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 560px;
    max-height: 620px;
    overflow: hidden;
}
.baoan-slider-inner {
    position: relative;
    width: 100%;
    height: 100%;
}
.baoan-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    z-index: 1;
}
.baoan-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.baoan-hero-section {
    display: block;
    background-color: #f5f5f5; /* Light fallback */
    background-size: cover; /* Full-bleed, no black bars */
    background-position: center;
    background-repeat: no-repeat;
}

.baoan-slide-btn-container {
    position: absolute;
    bottom: 60px; /* Above the dots */
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    text-align: center;
    width: 100%;
}

.baoan-hero-btn {
    display: inline-block;
    font-size: 1.1rem;
    padding: 12px 35px;
    background: #d4af37;
    color: #fff;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.baoan-hero-btn:hover {
    background: #b5952f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Slider Nav & Dots */
.baoan-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    font-size: 2rem;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    border-radius: 5px;
}
.baoan-slider-nav:hover { background: rgba(0,0,0,0.7); }
.baoan-slider-prev { left: 20px; }
.baoan-slider-next { right: 20px; }

.baoan-slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
}
.baoan-dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}
.baoan-dot:hover, .baoan-dot.active {
    background: #d4af37;
    transform: scale(1.2);
}

@media (max-width: 992px) {
    .baoan-slider-wrapper { 
        aspect-ratio: 16 / 9;
        min-height: 450px;
        max-height: 500px;
    }
}
@media (max-width: 768px) {
    .baoan-slider-wrapper { 
        aspect-ratio: 4 / 3;
        min-height: 420px;
        max-height: 460px;
    } /* Fixed mobile height */
    .baoan-slide-btn-container { bottom: 40px; }
    .baoan-hero-btn { font-size: 1rem; padding: 10px 25px; }
    .baoan-slider-nav { padding: 5px 10px; font-size: 1.5rem; }
}
@media (max-width: 576px) {
    .baoan-slider-wrapper { 
        aspect-ratio: 1 / 1;
        min-height: 380px;
        max-height: 420px;
    } /* Fixed small mobile height */
    .baoan-slide-btn-container { bottom: 30px; }
}


/* --- 1. Product Categories Marquee --- */
.baoan-categories-marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.baoan-categories-marquee {
    display: inline-flex;
    animation: baoanMarquee 25s linear infinite;
    gap: 30px;
    padding-right: 30px; /* Crucial for exact 50% loop math */
}
.baoan-categories-marquee-wrapper:hover .baoan-categories-marquee {
    animation-play-state: paused;
}

.baoan-cat-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 280px; /* Fixed width for horizontal scrolling */
    white-space: normal; /* Allow text inside to wrap */
    flex-shrink: 0;
}
.baoan-cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.baoan-cat-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.baoan-cat-card-body {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.baoan-cat-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    line-height: 1.4;
}
.baoan-cat-card-title a:hover {
    color: #d4af37 !important;
}
.baoan-cat-card-body .baoan-btn {
    margin-top: auto;
}

@keyframes baoanMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.baoan-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #d4af37;
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}
.baoan-btn:hover {
    background: #b5952f;
    color: #fff;
}
.baoan-btn-zalo {
    background: #0068ff;
    margin-right: 10px;
}
.baoan-btn-zalo:hover {
    background: #0054cc;
}


/* --- 2. Featured Products Grid --- */
.baoan-products-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}
.baoan-products-grid > * {
    width: calc(25% - 15px);
}
.baoan-product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}
.baoan-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}
.baoan-product-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.baoan-product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.baoan-product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #222;
}
.baoan-product-price {
    font-size: 1.1rem;
    color: #d4af37;
    font-weight: bold;
    margin-bottom: 15px;
}
.baoan-product-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
}
.baoan-product-actions .baoan-btn {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    font-size: 0.95rem;
    margin-right: 0;
}


/* --- 3. Timeline Section --- */
.baoan-timeline-section {
    padding: 60px 0;
}

/* --- Section Backgrounds & Utilities --- */
.baoan-dark-section {
    background-color: #0b0b06;
    padding: 80px 0;
    border-bottom: 2px solid rgba(216, 173, 47, 0.15); /* Soft gold separator */
}
.baoan-light-section {
    background-color: #fffaf0; /* Light cream */
    padding: 80px 0;
}
.baoan-light-section-alt {
    background-color: #f7f1e6; /* Slightly darker cream */
    padding: 80px 0;
}
.baoan-section-title-dark {
    font-size: 2.2rem;
    color: #d8ad2f;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}
.baoan-section-title-dark::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #d8ad2f;
    margin: 15px auto 0;
}
@media (max-width: 768px) {
    .baoan-dark-section, .baoan-light-section, .baoan-light-section-alt {
        padding: 50px 0;
    }
}
.baoan-timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 0 15px;
}
.baoan-timeline-item {
    position: relative;
    width: 100%;
}
.baoan-timeline-content {
    padding: 30px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}
.baoan-timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.baoan-timeline-content h4 {
    margin-top: 0;
    color: #d4af37;
    font-size: 1.15rem;
    margin-bottom: 15px;
}
.baoan-timeline-content p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.6;
    color: #555;
}
.baoan-section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 50px;
    color: #222;
}

@media screen and (max-width: 992px) {
    .baoan-products-grid > * {
        width: calc(50% - 10px);
    }
    .baoan-timeline-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- 4. Single Product Page --- */
body.single-san_pham .site-content,
body.single-san_pham .ast-container,
body.single-san_pham #primary,
body.single-san_pham #main {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
.baoan-single-product-main {
    background: transparent;
    padding-bottom: 0;
    padding-top: 0;
    margin-top: 0;
}

/* --- 5. Catalog Page (Products Archive/Custom Page) --- */
html {
    scroll-behavior: smooth;
}
.baoan-pill-btn {
    display: inline-block;
    padding: 8px 18px;
    background: #fff;
    color: #444;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    white-space: nowrap;
}
.baoan-pill-btn:hover,
.baoan-pill-btn.active {
    background: #d4af37;
    color: #fff;
    border-color: #d4af37;
    box-shadow: 0 4px 10px rgba(212,175,55,0.2);
}
.baoan-page-header {
    background-image: radial-gradient(circle at center, #fffdf9 0%, #f9f6ef 100%);
}

/* Horizontal Catalog Group Card */
.baoan-catalog-group-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    display: flex;
    padding: 30px;
    gap: 30px;
    margin-bottom: 40px;
}
.baoan-catalog-group-info {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.baoan-group-title {
    font-size: 1.6rem;
    color: #222;
    margin-bottom: 15px;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
    display: inline-block;
    align-self: flex-start;
}
.baoan-group-desc {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.baoan-view-all-link {
    color: #d4af37;
    font-weight: 600;
    text-decoration: none;
    margin-top: auto; /* Push to bottom of info column if content is short */
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.baoan-view-all-link:hover {
    color: #b5952f;
}
.baoan-catalog-products-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    align-items: stretch;
}
.baoan-term-description p {
    margin-bottom: 15px;
}
.baoan-term-description p:last-child {
    margin-bottom: 0;
}
@media screen and (max-width: 992px) {
    .baoan-catalog-group-card {
        flex-direction: column;
        padding: 20px;
    }
    .baoan-catalog-group-info {
        width: 100%;
        border-bottom: 1px dashed #e0e0e0;
        padding-bottom: 20px;
        margin-bottom: 10px;
    }
    .baoan-view-all-link {
        margin-top: 15px;
    }
}

/* --- 6. Contact Page --- */
.baoan-contact-page-wrapper {
    max-width: 1200px;
    margin: 30px auto 60px;
    padding: 0 15px;
}
.baoan-contact-grid {
    display: flex;
    gap: 40px;
    align-items: stretch;
}
.baoan-contact-info-card {
    flex: 1;
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}
.baoan-contact-map-card {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    background: #fafafa;
    border: 1px solid #f0f0f0;
    display: flex;
}
.baoan-contact-title {
    font-size: 1.8rem;
    color: #222;
    margin-bottom: 15px;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 15px;
    display: inline-block;
}
.baoan-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}
.baoan-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}
.baoan-contact-list li:last-child {
    margin-bottom: 0;
}
.baoan-contact-list i.dashicons {
    color: #d4af37;
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-top: 2px;
}
.baoan-contact-list strong {
    display: block;
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 5px;
}
.baoan-contact-list p {
    margin: 0;
    color: #555;
    font-size: 1.1rem;
    line-height: 1.5;
}
.baoan-contact-list a {
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
}
.baoan-contact-list a:hover {
    color: #b5952f;
    text-decoration: underline;
}
.baoan-contact-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.baoan-contact-actions .baoan-btn {
    width: 180px;
    text-align: center;
    justify-content: center;
}
.baoan-map-embed {
    width: 100%;
    height: 100%;
    min-height: 450px;
}
.baoan-map-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: 16px; /* Bo góc map */
}
.baoan-map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    width: 100%;
    min-height: 450px;
    background: #fdfcf9;
}
@media screen and (max-width: 992px) {
    .baoan-contact-grid {
        flex-direction: column;
    }
    .baoan-contact-info-card {
        padding: 30px 20px;
    }
    .baoan-contact-actions .baoan-btn {
        width: 100%;
    }
    .baoan-map-embed, .baoan-map-placeholder {
        min-height: 350px;
    }
}

/* --- 7. Tu Van / Knowledge Hub --- */
.baoan-tu-van-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    align-items: start;
}
.baoan-article-card {
    background: #fffdf9;
    border-radius: 12px;
    border: 1px solid #f5eedc;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.baoan-card-img-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    padding-bottom: 0 !important; /* Override inline padding */
}
.baoan-card-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.baoan-article-card:hover .baoan-card-img-link img {
    transform: scale(1.05);
}
.baoan-article-card .baoan-card-content {
    padding: 18px 20px 20px;
}
.baoan-article-card .baoan-card-actions {
    padding-top: 15px;
}
.baoan-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.baoan-article-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255,255,255,0.95);
    color: #d4af37;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.baoan-tu-van-cat-card:hover {
    transform: translateY(-5px);
}
.baoan-tu-van-cat-card:hover .cat-info h3 {
    color: #d4af37 !important;
}
.baoan-pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 5px;
    color: #444;
    text-decoration: none;
    font-weight: 600;
}
.baoan-pagination .page-numbers.current,
.baoan-pagination .page-numbers:hover {
    background: #d4af37;
    color: #fff;
    border-color: #d4af37;
}
.baoan-card-title {
    margin: 0 0 10px 0;
}
.baoan-card-title a {
    color: #222 !important;
    font-size: 1.15rem;
    font-weight: bold;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: color 0.3s;
}
.baoan-card-title a:hover {
    color: #d4af37 !important;
}
.baoan-card-desc {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.baoan-single-article-content p {
    margin-bottom: 20px;
}
.baoan-single-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}
.baoan-single-article-content h2,
.baoan-single-article-content h3 {
    color: #222;
    margin-top: 30px;
    margin-bottom: 15px;
}
@media screen and (max-width: 768px) {
    .baoan-tu-van-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 8. About Page --- */
.baoan-value-card:hover, .baoan-eco-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1) !important;
}
.baoan-eco-card:hover img {
    transform: scale(1.05) !important;
}
.baoan-eco-card:hover h3 a {
    color: #d4af37 !important;
}

/* Editor content typography fixes */
.baoan-story-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #444;
}
.baoan-story-content p {
    color: #444 !important;
    margin-bottom: 20px;
}
.baoan-story-content h2,
.baoan-story-content h3,
.baoan-story-content h4 {
    color: #222 !important;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: 700;
}
.baoan-story-content h2 {
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 10px;
    display: inline-block;
}
.baoan-story-content h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: #d4af37;
}
.baoan-story-content h3 {
    font-size: 1.5rem;
}
.baoan-story-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 20px;
    color: #444;
}
.baoan-story-content li {
    margin-bottom: 10px;
}
.baoan-about-section-title {
    font-size: 2rem;
    color: #d4af37 !important;
    text-transform: uppercase;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Ensure contrast on any dark background */
}

.baoan-single-card {
    background: #fffdf9; /* Light cream/warm white */
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.04);
    margin-bottom: 10px;
    border: 1px solid #f5eedc;
    margin-top: 10px;
}
.baoan-single-top {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
}
.baoan-single-gallery {
    flex: 1 1 500px;
}
.baoan-single-gallery img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
.baoan-single-info {
    flex: 1 1 400px;
    display: flex;
    flex-direction: column;
}
.baoan-single-title {
    font-size: 2.2rem;
    color: #222;
    margin-bottom: 10px;
    margin-top: 0;
}
.baoan-single-category {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}
.baoan-single-category a {
    color: #d4af37;
    text-decoration: none;
    font-weight: 500;
}
.baoan-single-price {
    font-size: 1.8rem;
    color: #d4af37;
    font-weight: 700;
    margin-bottom: 25px;
}
.baoan-single-short-desc {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.baoan-single-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.baoan-quality-box {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.baoan-quality-box h4 {
    margin-top: 0;
    color: #222;
    font-size: 1.15rem;
    margin-bottom: 15px;
    font-weight: 600;
}
.baoan-quality-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.baoan-quality-box ul li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.5;
}
.baoan-quality-box ul li i {
    color: #d4af37;
    margin-right: 10px;
    font-size: 1.2rem;
    margin-top: 2px;
}
.baoan-single-content {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px dashed #e6e6e6;
}
.baoan-single-section-title {
    font-size: 1.4rem;
    color: #222;
    text-align: left;
    margin-bottom: 20px;
    font-weight: 600;
}
.baoan-entry-content {
    line-height: 1.8;
    color: #444;
    font-size: 1.05rem;
}
.baoan-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

@media screen and (max-width: 768px) {
    .baoan-products-grid > * {
        width: 100%;
    }
    .baoan-timeline-container {
        grid-template-columns: 1fr;
    }
    .baoan-single-card {
        padding: 15px;
        margin-top: 10px;
    }
    .baoan-single-top {
        gap: 20px;
    }
    .baoan-single-gallery {
        flex: 1 1 100%;
    }
    .baoan-single-info {
        flex: 1 1 100%;
    }
    .baoan-single-title {
        font-size: 1.8rem;
    }
    .baoan-single-actions {
        flex-direction: column;
    }
    .baoan-single-actions .baoan-btn {
        width: 100%;
        text-align: center;
    }
}
