/* Home Page Styles */
.home-four-banners {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: clamp(180px, 29vw, 400px);
    gap: 16px;
    margin-bottom: 30px;
}

.home-four-banners__item {
    display: block;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
}

.home-four-banners__item--1,
.home-four-banners__item--4 {
    grid-column: span 2;
}

.home-four-banners__item--2,
.home-four-banners__item--3 {
    grid-column: span 3;
}

.home-four-banners__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.home-four-banners__item:hover img {
    transform: scale(1.04);
}

@media (max-width: 600px) {
    .home-four-banners {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 12px;
    }

    .home-four-banners__item {
        grid-column: 1 / -1;
        aspect-ratio: 2 / 1;
    }
}

.home-slider {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.home-slider .swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 450px;
}

.home-slider .swiper-button-next,
.home-slider .swiper-button-prev {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.home-slider .swiper-button-next:after,
.home-slider .swiper-button-prev:after {
    font-size: 18px;
}

/* Promo Banners */
.home-promos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.promo-item img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.3s;
}

.promo-item:hover img {
    transform: scale(1.03);
}

/* Pill Categories (styled like tags/tabs) */
.home-pill-cats-wrapper {
    position: relative;
    padding: 0 35px;
}

.home-pill-cats-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.home-pill-cats-list::-webkit-scrollbar {
    display: none;
}

/* Custom Navigation Buttons */
.pill-cats-prev,
.pill-cats-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
}

.pill-cats-prev:hover,
.pill-cats-next:hover {
    background: #f9fafb;
    color: #111827;
}

.pill-cats-prev svg,
.pill-cats-next svg {
    width: 16px;
    height: 16px;
}

.pill-cats-prev {
    left: 0;
}

.pill-cats-next {
    right: 0;
}

.pill-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 calc((100% - 56px) / 8);
    height: 52px;
    padding: 4px 10px;
    background: #f2f2f2;
    border-radius: 8px;
    color: #333;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    text-align: center;
    transition: all 0.2s ease-in-out;
    white-space: normal;
    text-decoration: none;
    border: none;
}

.pill-item:hover,
.pill-item.active {
    background: #ffe6e6;
    color: #e53935;
}

.pill-name {
    font-size: 13px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive adjustment for mobile */
@media (max-width: 1024px) {
    /* Auto width handles responsiveness better */
}

@media (max-width: 768px) {
    /* Auto width handles responsiveness better */
}

/* Section Layout */
.products-grid.with-banner {
    grid-auto-flow: row dense;
}

.section-banner-box {
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

.section-banner-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.4s;
}

.section-banner-box:hover img {
    transform: scale(1.02);
}

.products-grid.with-banner.banner-left .section-banner-box {
    grid-column: 1 / 2;
    grid-row: 1 / span 2;
}

.products-grid.with-banner.banner-right .section-banner-box {
    grid-column: 6 / 7;
    grid-row: 1 / span 2;
}

@media (max-width: 1024px) {
    .products-grid.with-banner {
        grid-template-columns: repeat(4, 1fr);
    }

    .products-grid.with-banner.banner-left .section-banner-box,
    .products-grid.with-banner.banner-right .section-banner-box {
        grid-column: span 4;
        grid-row: auto;
    }
}

/* Flash Sale Style */
.home-section.style-flash-sale {
    background: #fff8e1;
    padding: 20px;
    border-radius: 8px;
}

.home-section.style-flash-sale .section-title {
    color: #d32f2f;
}


.home-section {
    background: var(--white);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.slider-6-section .section-header {
    border-bottom: none;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.view-all:hover {
    color: var(--secondary-color);
    transform: translateX(3px);
}

.section-actions {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.child-categories {
    display: flex;
    align-items: center;
    margin-right: 20px;
    gap: 10px;
}

.child-cat-link {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.child-cat-link:hover {
    color: var(--white);
    background: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 86, 179, 0.2);
}

.section-header-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.es-ajax-tab-link {
    color: #333;
    text-decoration: none;
}

.es-ajax-tab-link.active {
    font-weight: bold;
}

.section-header-links .sep {
    color: #ccc;
}

.b2bs-home-solutions .section-header {
    border: unset;
}

.b2bs-home-solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.b2bs-home-solution-card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
}

.b2bs-home-solution-title {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
}

.b2bs-home-solution-discount {
    margin: 8px 0 16px;
    color: var(--primary-color);
    font-weight: 700;
}

.b2bs-home-solution-group+.b2bs-home-solution-group {
    margin-top: 16px;
}

.b2bs-home-solution-group h4 {
    margin: 0 0 8px;
    color: #374151;
    font-size: 15px;
}

.b2bs-home-solution-group ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.b2bs-home-solution-group li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #4b5563;
    font-size: 14px;
}

.b2bs-home-solution-group img {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    object-fit: contain;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .home-promos {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .products-grid.with-banner {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .products-grid.with-banner.banner-left .section-banner-box,
    .products-grid.with-banner.banner-right .section-banner-box {
        grid-column: span 2;
    }

    .section-banner-box {
        max-width: 100%;
        overflow: hidden;
    }

    .section-banner-box img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 8px;
    }

    /* Removed .home-pill-cats media query as it's now handled globally */
    .pill-item {
        white-space: nowrap;
        padding: 6px 14px;
        font-size: 13px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    .section-header-links {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 5px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .section-header-links::-webkit-scrollbar {
        display: none;
    }

    .es-ajax-tab-link,
    .view-all {
        white-space: nowrap;
        font-size: 12.5px;
    }

    .child-categories {
        margin-right: 0;
        margin-bottom: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 5px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .child-categories::-webkit-scrollbar {
        display: none;
    }

    .child-cat-link {
        white-space: nowrap;
        font-size: 12.5px;
    }

    .section-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .home-promos {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .section-title {
        font-size: 17px;
    }
}

/* Homepage solution carousel */
.b2bs-home-solutions {
    overflow: hidden;
}

.b2bs-home-solutions .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.b2bs-home-solutions-header-actions,
.b2bs-home-solutions-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.b2bs-home-solutions-view-all,
.b2bs-home-solutions-controls button,
.b2bs-home-solution-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 20px;
    border: 0;
    border-radius: 25px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.b2bs-home-solutions-view-all,
.b2bs-home-solution-detail {
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    background: var(--primary-color);
    color: #fff;
}

.b2bs-home-solutions-view-all:hover,
.b2bs-home-solution-detail:hover {
    border-color: #e53935;
    background: #e53935;
    color: #fff;
    transform: translateY(-2px);
}

.b2bs-home-solutions-controls button:hover {
    background: #e66a00;
    color: #fff;
    transform: translateY(-2px);
}

.b2bs-home-solutions-controls button:disabled,
.b2bs-home-solution-buy:disabled {
    cursor: wait;
    opacity: .65;
}

.b2bs-home-solutions-viewport {
    overflow: hidden;
}

.b2bs-home-solutions-track {
    margin-top: 10px;
    display: flex !important;
    align-items: stretch;
    gap: 16px;
    transition: transform .35s ease;
    will-change: transform;
}

.b2bs-home-solutions-track .b2bs-home-solution-card {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 calc((100% - 32px) / 3) !important;
    flex-direction: column;
    width: calc((100% - 32px) / 3) !important;
    max-width: calc((100% - 32px) / 3) !important;
    min-width: 0;
}

.b2bs-home-solution-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.b2bs-home-solution-card-link:hover .b2bs-home-solution-title {
    color: #d85c0b;
}

.b2bs-home-solution-actions {
    margin-top: auto;
    padding-top: 12px;
}

.b2bs-home-solution-message {
    margin: 8px 0 0;
    color: #475569;
    font-size: 13px;
}

.b2bs-home-solution-message.is-error {
    color: #b91c1c;
}

.b2bs-home-solution-message.is-success {
    color: #047857;
}

@media (max-width: 900px) {
    .b2bs-home-solutions-track .b2bs-home-solution-card {
        flex-basis: calc((100% - 16px) / 2) !important;
        width: calc((100% - 16px) / 2) !important;
        max-width: calc((100% - 16px) / 2) !important;
    }
}

@media (max-width: 600px) {
    .b2bs-home-solutions .section-header {
        align-items: flex-start;
    }

    .b2bs-home-solutions-track .b2bs-home-solution-card {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Keep WooCommerce purchase buttons consistently rounded site-wide. */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce-page a.button,
.woocommerce-page button.button,
.woocommerce-page input.button,
.woocommerce-page #respond input#submit,
.single_add_to_cart_button,
.add_to_cart_button,
.product_type_simple,
.product_type_variable,
.btn-buy,
.b2bs-home-solution-buy {
    border-radius: 5px !important;
}

.b2bs-home-solutions-track .b2bs-home-solution-card {
    padding: 0;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #e6e9ee;
    border-radius: 18px;
    background: linear-gradient(155deg, #ffffff 0%, #f8fbff 100%);
    transition: transform .25s ease, box-shadow .25s ease;
}

.b2bs-home-solutions-track .b2bs-home-solution-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(19, 35, 58, .13);
}

.b2bs-home-solution-content {
    flex: 1;
    padding: 25px 24px 20px;
}

.b2bs-home-solution-eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    color: #cb651d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.b2bs-home-solution-categories {
    display: grid;
    gap: 9px;
    margin-top: 20px;
}

.b2bs-home-solution-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e8edf3;
    border-radius: 9px;
    background: #fff;
    color: #26364a;
    font-weight: 650;
}

.b2bs-home-solution-category small {
    flex: none;
    color: #697a91;
    font-size: 12px;
    font-weight: 500;
}

.b2bs-home-solution-detail {
    align-self: flex-start;
    margin: 0 24px 24px;
}

.b2bs-home-solution-detail:focus-visible,
.b2bs-home-solutions-view-all:focus-visible,
.b2bs-home-solutions-controls button:focus-visible {
    outline: 3px solid #7c1d1d;
    outline-offset: 3px;
}

.b2bs-home-solution-detail span {
    font-size: 20px;
    line-height: 1;
}