/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* GLOBAL STYLES */
* {
    box-sizing: border-box;
}

body,
button,
input,
select,
textarea,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Barlow', sans-serif !important;
}

/* Display Helpers */
.mobile-only {
    display: none !important;
}

/* B2B CUSTOM SHORTCODE CART LAYOUT */
.b2b-custom-cart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.b2b-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

.b2b-cart-flex {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.b2b-cart-flex .quantity {
    margin: 0 !important;
}

.b2b-cart-flex .quantity input.qty {
    width: 64px !important;
    height: 40px !important;
    padding: 0 10px !important;
    font-size: 16px !important;
    font-family: 'Barlow', sans-serif !important;
    font-weight: 600 !important;
    color: #333 !important;
    background-color: #fff !important;
    border: 2px solid #ddd !important;
    border-radius: 3px !important;
    text-align: center !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.2s ease !important;
    -moz-appearance: textfield !important;
}

.b2b-cart-flex .quantity input.qty:focus {
    border-color: #A70006 !important;
    outline: none !important;
}

.b2b-cart-flex .single_add_to_cart_button {
    margin: 0 !important;
    background-color: #A70006 !important;
    color: #fff !important;
    border-radius: 3px !important;
    padding: 0 24px !important;
    height: 40px !important;
    font-family: 'Barlow', sans-serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.b2b-cart-flex .single_add_to_cart_button:hover {
    background-color: #8e0005 !important;
}

.b2b-cart-flex .single_add_to_cart_button.added::after {
    display: none !important;
}

.b2b-not-found {
    color: #e74c3c;
    font-weight: 500;
}

/* CUSTOM ZONE FILTER DROPDOWN */
.b2b-custom-select {
    position: relative;
    width: 100%;
    margin: 0 auto;
    font-family: 'Barlow', sans-serif;
}

.b2b-select-trigger {
    box-sizing: border-box;
    width: 100%;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s ease;
}

.b2b-select-trigger:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}

.b2b-custom-select.open .b2b-select-trigger,
.b2b-custom-select:focus .b2b-select-trigger {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
    outline: none;
}

.b2b-select-text {
    display: block;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    padding-right: 15px;
    flex: 1;
}

.b2b-select-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #222;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.b2b-custom-select.open .b2b-select-arrow {
    transform: rotate(180deg);
}

.b2b-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 350px;
    overflow-y: auto;
    display: none;
}

.b2b-custom-select.open .b2b-select-options {
    display: block;
    animation: b2bDropdownFadeIn 0.2s ease;
}

.b2b-select-option {
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
    transition: background-color 0.15s ease;
    white-space: normal;
    word-wrap: break-word;
    border-bottom: 1px solid #f0f0f0;
}

.b2b-select-option:last-child {
    border-bottom: none;
}

.b2b-select-option:hover {
    background-color: #f7f7f7;
}

.b2b-select-option.selected {
    background-color: #eef2fa;
    color: #A70006;
    font-weight: 600;
}

@keyframes b2bDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HEADER & FOOTER */
.b2b-dark-header,
.b2b-dark-footer {
    background-color: #1a1a1a;
    color: #fff;
    font-family: 'Barlow', sans-serif;
}

.b2b-header-flex,
.b2b-footer-flex {
    max-width: var(--container-width, 1200px) !important;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 27px 40px !important;
}

.b2b-header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.b2b-header-left .b2b-logo {
    height: 44px !important;
    width: auto !important;
}

.b2b-iso-logos {
    display: flex;
    gap: 15px;
}

.b2b-iso-logos img {
    height: 70px;
    width: auto;
}

.b2b-header-right {
    display: flex;
    align-items: center;
    gap: 40px;
}

.b2b-main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 35px;
}

.b2b-main-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.b2b-main-nav a:hover {
    color: #A70006;
}

.b2b-cart-icon a {
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
}

.b2b-cart-icon svg {
    width: 32px;
    height: 32px;
}

.b2b-cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #A70006;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.b2b-dark-footer .b2b-footer-flex {
    font-size: 18px;
    padding: 27px 0;
}

/* MODAL: ZONE SELECTION */
.b2b-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    backdrop-filter: blur(4px);
}

.b2b-modal-overlay.open {
    display: flex;
}

.b2b-modal-content {
    background: #fff;
    color: #333;
    padding: 40px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
    font-family: 'Barlow', sans-serif;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.b2b-modal-content h2 {
    margin-top: 0;
    color: #222;
    font-size: 24px;
}

.b2b-modal-zones {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.b2b-zone-select-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    color: #333;
}

.b2b-zone-select-btn:hover {
    background: #eef2fa;
    border-color: #A70006;
    color: #A70006;
}

/* PRODUCT CATALOG GRID */
.b2b-catalog-container {
    display: flex;
    width: 100%;
    max-width: var(--container-width, 1200px);
    margin: 40px auto;
    padding: 0 20px;
    gap: 30px;
    box-sizing: border-box;
}

/* SIDEBAR */
.b2b-sidebar {
    width: 28%;
    flex-shrink: 0;
}

.b2b-sidebar-title {
    background-color: #222425;
    color: #fff;
    padding: 12px 18px;
    margin-bottom: 2px;
    font-size: 18px;
    text-transform: uppercase;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
}

.b2b-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.b2b-category-list li {
    margin-bottom: 0;
}

.b2b-cat-link {
    text-decoration: none;
    color: #fff !important;
    font-family: 'Barlow', sans-serif;
    font-size: 17px;
    font-weight: 500;
    display: block;
    padding: 8px 15px;
    transition: background-color 0.2s;
    flex-grow: 1;
}

.b2b-cat-link:hover {
    color: #fff !important;
}

.b2b-cat-link.active {
    color: #fff !important;
    font-weight: 600;
}

/* Hierarchical Sidebar */
.b2b-cat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #a70006;
    margin-bottom: 1px;
    transition: background-color 0.2s;
}

.b2b-cat-row:hover {
    background-color: #8e0005;
}

.b2b-cat-toggle {
    background: none !important;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff !important;
    transition: none;
    flex-shrink: 0;
    box-shadow: none !important;
}

.b2b-cat-toggle:hover {
    background: rgba(167, 0, 6, 0.1);
    color: #8e0005;
}

.plus-minus {
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
}

.b2b-sub-categories {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    padding-left: 0;
    background-color: #a70006;
}

/* Depth-based indentation for links */
.depth-1 .b2b-cat-link {
    padding-left: 35px !important;
}

.depth-2 .b2b-cat-link {
    padding-left: 55px !important;
}

.depth-3 .b2b-cat-link {
    padding-left: 75px !important;
}

.depth-4 .b2b-cat-link {
    padding-left: 95px !important;
}

/* Ensure active row background covers the whole area */
.b2b-cat-row.active-row {
    background-color: #222425 !important;
}

.b2b-sub-categories.open {
    display: block;
}

/* MAIN CONTENT */
.b2b-main-content {
    flex-grow: 1;
}

/* Loading state for blocks and buttons */
.loading {
    position: relative !important;
    pointer-events: none !important;
}

/* Beautiful Loading Overlay with Spinner */
.woocommerce .blockUI.blockOverlay {
    background-color: rgba(255, 255, 255, 0.5) !important;
    background-image: none !important;
    backdrop-filter: blur(3px) !important;
    opacity: 1 !important;
    border-radius: inherit;
    cursor: wait !important;
}

.loading::before,
.b2b-loading-state::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(3px) !important;
    z-index: 9998 !important;
    cursor: wait !important;
    border-radius: inherit;
}

.loading::after,
.b2b-loading-state::after,
.woocommerce .blockUI.blockOverlay::after {
    content: "" !important;
    position: absolute !important;
    top: calc(50% - 20px) !important;
    left: calc(50% - 20px) !important;
    width: 40px !important;
    height: 40px !important;
    border: 3px solid rgba(167, 0, 6, 0.15) !important;
    border-top-color: #A70006 !important;
    border-radius: 50% !important;
    animation: b2b-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
    z-index: 9999 !important;
    display: block !important;
}

/* Do not overlay buttons directly since they change their own text */
button.loading::before,
button.loading::after,
a.loading::before,
a.loading::after {
    display: none !important;
}

@keyframes b2b-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ensure button text remains visible during loading */
.loading .wc-block-components-button,
.loading .wc-block-cart__submit-button,
.loading .checkout-button {
    background-color: #8b0000 !important;
    /* Force a dark red or your theme color */
    color: #fff !important;
}

.loading .wc-block-components-button__text,
.loading .wc-block-cart__submit-button span,
.loading .checkout-button {
    color: #fff !important;
    /* Force white text */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.b2b-products-list,
#b2b-products-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* CATEGORY GRID */
.b2b-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.b2b-category-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.b2b-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.b2b-category-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background-color: #f9f9f9;
}

.b2b-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.b2b-category-card:hover .b2b-category-image img {
    transform: scale(1.08);
}

.b2b-category-info {
    padding: 25px 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.b2b-category-info h3 {
    font-family: 'Barlow', sans-serif;
    font-size: 22px;
    margin: 0 0 15px 0;
    color: #1a1a1a;
    font-weight: 700;
}

.b2b-category-btn {
    display: inline-block;
    background-color: #a70006;
    color: #fff;
    padding: 10px 24px;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    transition: background-color 0.2s;
    align-self: center;
}

.b2b-category-card:hover .b2b-category-btn {
    background-color: #222425;
}

/* FILTER ROW */
.b2b-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 15px;
    flex-wrap: wrap;
}

.b2b-zone-dropdown-wrapper {
    flex: 1;
    min-width: 280px;
    /* Ensure it doesn't get too squeezed before wrapping */
}

/* PRODUCT ROW */
.b2b-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s;
}

.b2b-product-row:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.b2b-row-left {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 65%;
}

.b2b-row-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.b2b-row-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.b2b-row-info {
    font-family: 'Barlow', sans-serif;
}

.b2b-row-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.b2b-row-title a {
    color: #333;
    text-decoration: none;
}

.b2b-row-title a:hover {
    color: #A70006;
}

.b2b-row-sku {
    font-size: 13px;
    color: #888;
    margin-bottom: 5px;
}

.b2b-row-thumb {
    font-size: 12px;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.b2b-row-right {
    width: 35%;
    display: flex;
    justify-content: flex-end;
}

/* RESET BUTTON STYLE */
.b2b-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #A70006;
    color: #fff;
    border: none;
    padding: 10px 20px;
    height: 37px;
    border-radius: 4px;
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.b2b-reset-btn:hover {
    background-color: #8e0005;
    color: #fff;
}

.b2b-reset-btn svg {
    flex-shrink: 0;
}

/* LOADING STATE */
.b2b-loading-state {
    position: relative !important;
    pointer-events: none !important;
}

.b2b-loading-state * {
    pointer-events: none !important;
}

/* CART PAGE STYLING */
.woocommerce-cart .entry-content,
.woocommerce-cart .site-main,
.wc-block-cart {
    max-width: 100% !important;
    width: 100% !important;
}

.woocommerce-cart .grid-container {
    max-width: var(--container-width, 1200px) !important;
    padding: 40px 20px !important;
}

.woocommerce-cart .wp-block-woocommerce-cart,
.woocommerce-cart .wc-block-cart {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.woocommerce-cart .wc-block-cart__main {
    padding-right: 20px !important;
}

.woocommerce-cart .wc-block-cart__sidebar {
    padding-left: 20px !important;
}

.woocommerce-cart .inside-article {
    padding: 0 !important;
}

.wc-block-cart {
    font-family: 'Barlow', sans-serif !important;
}

.wc-block-cart__title {
    font-size: 32px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    margin-bottom: 30px !important;
}

.wc-block-cart__submit-button,
#b2b_1click_checkout_btn {
    background-color: #A70006 !important;
    color: #fff !important;
    font-family: 'Barlow', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding: 15px 30px !important;
    border-radius: 4px !important;
    font-size: 18px !important;
    transition: background-color 0.2s !important;
    border: none !important;
    width: 100%;
    display: block;
    text-align: center;
    text-decoration: none !important;
}

.wc-block-cart__submit-button:hover,
#b2b_1click_checkout_btn:hover {
    background-color: #8e0005 !important;
}

.wc-block-components-button__text {
    color: #fff !important;
}

.wc-block-cart__submit-container {
    padding: 0 !important;
    margin-top: 20px !important;
}

/* FANCYBOX CUSTOMIZATION */
.fancybox__content {
    background: #fff !important;
    padding: 10px !important;
    border-radius: 4px;
}

.fancybox__backdrop {
    background: rgba(0, 0, 0, 0.85) !important;
}

.fancybox__container {
    --f-button-color: #fff !important;
    --f-button-bg: rgba(0, 0, 0, 0.2) !important;
    --f-button-hover-bg: rgba(0, 0, 0, 0.4) !important;
    --f-button-svg-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) !important;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .b2b-header-flex {
        padding: 15px 20px;
        gap: 15px;
    }

    .b2b-header-left {
        gap: 15px;
    }

    .b2b-iso-logos img {
        height: 45px;
    }

    .b2b-header-right {
        gap: 20px;
    }

    .b2b-main-nav ul {
        gap: 15px;
    }

    .b2b-footer-flex {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
    }
}

@media (max-width: 1023px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .b2b-category-mobile-select-wrapper {
        margin-bottom: 25px;
    }

    .b2b-catalog-container {
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
    }

    .b2b-sidebar {
        width: 100%;
    }

    /* Hide old category list */
    .b2b-category-list {
        display: none !important;
    }

    .b2b-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 20px;
    }

    .b2b-zone-dropdown-wrapper {
        width: 100%;
    }

    .b2b-reset-btn {
        width: 100%;
        justify-content: center;
    }

    .b2b-product-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }

    .b2b-row-left {
        width: 100%;
        gap: 15px;
    }

    .b2b-row-right {
        width: 100%;
        justify-content: flex-start;
    }

    .b2b-custom-cart-wrapper {
        align-items: stretch;
        width: 100%;
    }

    .b2b-cart-flex {
        justify-content: space-between;
    }

    .b2b-cart-flex .single_add_to_cart_button {
        flex-grow: 1;
    }
}

@media (max-width: 768px) {
    .b2b-header-flex {
        padding: 10px 15px;
        gap: 10px;
        flex-direction: row !important;
    }

    .b2b-header-left {
        gap: 10px;
        flex-shrink: 1;
        min-width: 0;
    }

    .b2b-header-left .b2b-logo {
        height: 28px !important;
    }

    .b2b-iso-logos {
        gap: 5px;
    }

    .b2b-iso-logos img {
        height: 35px;
    }

    .b2b-header-right {
        gap: 10px;
        flex-shrink: 1;
        min-width: 0;
        flex-direction: row !important;
    }

    .b2b-main-nav ul {
        gap: 10px;
    }

    .b2b-main-nav a {
        font-size: 14px;
    }

    .b2b-cart-icon svg {
        width: 24px;
        height: 24px;
    }

    .b2b-cart-count {
        width: 16px;
        height: 16px;
        font-size: 11px;
        top: -3px;
        right: -5px;
    }

    .b2b-row-title {
        font-size: 16px;
    }

    .b2b-price {
        font-size: 1.15rem;
    }

    .b2b-row-sku {
        font-size: 12px;
    }

    .b2b-dark-footer .b2b-footer-flex {
        font-size: 14px;
        padding: 25px 15px;
        gap: 10px;
    }
}

@media (max-width: 380px) {
    .b2b-catalog-container {
        padding: 0 15px;
        margin: 15px auto;
    }

    .b2b-sidebar-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .b2b-category-mobile-select-wrapper {
        margin-bottom: 20px;
    }

    .b2b-filter-row {
        gap: 8px;
        margin-bottom: 15px;
    }

    .b2b-product-row {
        padding: 12px;
    }

    .b2b-row-title {
        font-size: 15px;
    }

    .b2b-price {
        font-size: 1rem;
    }

    .b2b-row-sku {
        font-size: 11px;
    }

    .b2b-custom-cart-wrapper {
        gap: 8px;
    }

    .b2b-cart-flex .quantity input.qty {
        width: 50px !important;
        height: 36px !important;
        font-size: 14px !important;
    }

    .b2b-cart-flex .single_add_to_cart_button {
        height: 36px !important;
        font-size: 14px !important;
        padding: 0 10px !important;
    }
}

@media (max-width: 480px) {
    .b2b-iso-logos {
        display: none;
    }

    .b2b-header-left .b2b-logo {
        height: 24px !important;
    }

    .b2b-main-nav a span {
        display: none;
    }
}

/* SINGLE PRODUCT PAGE */
.single-product .inside-article {
    padding: 10px 20px 40px 20px !important;
}

/* Flex layout for Image + Summary */
@media (min-width: 769px) {
    .single-product div.product {
        display: flex;
        flex-wrap: wrap;
        gap: 60px;
        align-items: flex-start;
        width: 100%;
    }

    .b2b-single-gallery-wrapper {
        width: calc(45% - 30px);
        flex-shrink: 0;
    }

    .single-product div.product .summary {
        width: calc(55% - 30px);
        float: none !important;
        margin: 0 !important;
        flex-grow: 1;
    }

    .single-product div.product .related,
    .single-product div.product .upsells,
    .single-product div.product .woocommerce-tabs {
        width: 100%;
        margin-top: 60px !important;
    }
}

.b2b-main-image-container {
    background: #fff;
    border: 1px solid #eee;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    max-height: 70vh;
    overflow: hidden;
    position: relative;
}

.b2b-main-image-container img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.b2b-main-image-container img.fading {
    opacity: 0;
}

.b2b-thumbnails-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.b2b-thumb {
    width: 70px;
    height: 70px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.b2b-thumb.active {
    border-color: #A70006;
}

/* Metadata & Titles */
.single-product div.product .product_title {
    font-size: 26px !important;
    /* Smaller title */
    line-height: 1.2;
    margin-top: 0;
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    color: #1a1a1a;
}

.single-product div.product p.price,
.single-product div.product span.price {
    color: #1a1a1a !important;
    /* Dark price */
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 24px !important;
    /* Smaller price */
}

.b2b-meta-zone {
    background: #f9f9f9;
    padding: 10px 15px;
    display: inline-block;
    border-left: 4px solid #A70006;
    margin: 20px 0;
    font-size: 16px;
}


.woocommerce-breadcrumb {
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    color: #999;
    margin-bottom: 45px;
    /* More space to image */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.woocommerce-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.woocommerce-breadcrumb a:hover {
    color: #A70006;
}

/* Hide the ugly variations selection table as it is automated */
.single-product .variations {
    display: none !important;
}

.single-product .variations_form {
    padding: 0;
    background: none;
    border: none;
    margin-top: 20px;
}

.single-product .single_add_to_cart_button {
    background-color: #A70006 !important;
    color: #fff !important;
    padding: 12px 35px !important;
    font-weight: 700 !important;
    font-family: 'Barlow', sans-serif !important;
    text-transform: uppercase;
}

/* Metadata Vertical */
.single-product .product_meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}

.single-product .product_meta>span {
    display: block;
    font-size: 14px;
    color: #777;
}

.single-product .product_meta .sku,
.single-product .product_meta a {
    color: #1a1a1a !important;
    font-weight: 700;
    text-decoration: none;
}

.single-product .product_meta a:hover {
    color: #A70006 !important;
}

/* RELATED PRODUCTS AS COMPACT 2-COLUMN GRID (B2B Row Style) */
.related.products h2,
.upsells.products h2 {
    font-family: 'Barlow', sans-serif;
    font-size: 20px;
    margin-bottom: 25px;
    text-transform: uppercase;
    color: #1a1a1a;
    border: none !important;
    /* Remove red underline */
    padding: 0;
}

/* RELATED PRODUCTS COMPACT DESIGN */
.related.products .products,
.upsells.products .products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Fix for the empty first slot */
.related.products .products::before,
.related.products .products::after,
.upsells.products .products::before,
.upsells.products .products::after {
    display: none !important;
}

.related.products .b2b-product-row,
.upsells.products .b2b-product-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px 15px !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    gap: 15px !important;
    box-sizing: border-box !important;
}

.related.products .b2b-product-row .b2b-row-left {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex: 1 !important;
    min-width: 0;
    /* Important for flex-wrap/overflow */
}

.related.products .b2b-product-row .b2b-row-img {
    width: 70px !important;
    height: 70px !important;
    flex-shrink: 0 !important;
}

.related.products .b2b-product-row .b2b-row-info {
    flex: 1 !important;
    min-width: 0;
}

.related.products .b2b-product-row .b2b-row-title {
    font-size: 14px !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    color: #1a1a1a;
    /* Allow 2 lines instead of nowrap */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related.products .b2b-product-row .b2b-row-sku {
    font-size: 11px !important;
    color: #888 !important;
}

.related.products .b2b-product-row .b2b-row-right {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    flex: 0 0 auto !important;
    text-align: right !important;
    padding-left: 10px;
}

.related.products .b2b-product-row .b2b-price {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin-bottom: 5px !important;
    white-space: nowrap;
}

.related.products .b2b-product-row .b2b-cart-flex {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}

/* Compact Buttons in Grid */
.related.products .b2b-product-row .quantity input.qty {
    height: 32px !important;
    width: 40px !important;
    padding: 0 !important;
    font-size: 13px !important;
    border: 1px solid #ddd !important;
    text-align: center;
}

.related.products .b2b-product-row .button {
    height: 32px !important;
    line-height: 32px !important;
    padding: 0 12px !important;
    font-size: 11px !important;
    background: #A70006 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    border-radius: 2px !important;
}

/* MAIN PRODUCT COMPACT BUTTONS */
.single-product .quantity .qty {
    height: 32px !important;
    /* Compact size */
    width: 45px !important;
    padding: 0 !important;
    font-size: 14px !important;
    text-align: center;
    border: 1px solid #ddd !important;
}

.single-product .single_add_to_cart_button {
    height: 32px !important;
    line-height: 32px !important;
    padding: 0 25px !important;
    font-size: 13px !important;
    background-color: #A70006 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

.woocommerce-variation-add-to-cart {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 20px;
}

/* Breakpoint for 1 column (at 1200px as requested) */
@media (max-width: 1200px) {

    .related.products .products,
    .upsells.products .products {
        grid-template-columns: 1fr !important;
    }
}

/* Fix mobile scroll and layout */
@media (max-width: 600px) {
    .related.products .b2b-product-row {
        flex-direction: column !important;
        text-align: center;
        padding: 15px !important;
    }

    .related.products .b2b-product-row .b2b-row-left {
        flex-direction: column !important;
        width: 100% !important;
        margin-bottom: 10px;
    }

    .related.products .b2b-product-row .b2b-row-right {
        align-items: center !important;
        padding-left: 0;
        width: 100% !important;
    }

    .related.products .b2b-product-row .b2b-row-img {
        margin-right: 0 !important;
        margin-bottom: 10px;
    }
}

/* Tabs */
.woocommerce-tabs {
    margin-top: 60px !important;
    clear: both;
}