/* ===================================================================================

* Theme Name: Metobuild Child
* Theme URI: https://themexriver.com/wp/metobuild
* Author: ThemeXriver
* Author URI: https://themexriver.com
* Description: Construction Wordpress Theme
* Version: 1.1.0
* Template: metobuild
* Text Domain: metobuild-child
* License: GNU General Public License version 3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Tags: one-column, right-sidebar, left-sidebar, custom-menu, featured-images, post-formats, sticky-post, translation-ready
* Tested up to: 6.6
* Requires PHP: 7.4

====================================================================================== */

/* ==========================================================================
   XPERT EGYPT - BSMART PRODUCT CATALOG DESIGN SYSTEM TOKENS
   ========================================================================== */
:root {
    --bsmart-primary: var(--xc-blue, #0866f5);
    --bsmart-primary-hover: #0052cc;
    --bsmart-primary-soft: #e5efff;
    --bsmart-navy: var(--xc-navy, #0b1f50);
    --bsmart-navy-deep: #012063;
    --bsmart-text: var(--xc-text, #50658f);
    --bsmart-muted: #667085;
    --bsmart-border: var(--xc-border, #d3e1fa);
    --bsmart-border-subtle: #e4ecf7;
    --bsmart-surface: #f8fbff;
    --bsmart-card-bg: #ffffff;
    --bsmart-badge-bg: #ecfdf3;
    --bsmart-badge-border: #abefc6;
    --bsmart-badge-text: #067647;
    --bsmart-radius-lg: 20px;
    --bsmart-radius-md: 14px;
    --bsmart-radius-sm: 10px;
    --bsmart-radius-pill: 999px;
}

/* ==========================================================================
   SINGLE PRODUCT SECTION & CONTAINER
   ========================================================================== */
.bsmart-single-product-section.pt-120.pb-120 {
    padding-top: 64px;
    padding-bottom: 100px;
    background-color: #ffffff;
}

.bsmart-product-container {
    max-width: 1240px;
}

.bsmart-catalog-product {
    color: var(--bsmart-navy);
    margin: 0 0 40px;
    padding-top: 36px;
    border-top: 1px solid var(--bsmart-border-subtle);
    clear: both;
}

/* ==========================================================================
   HERO 2-COLUMN LAYOUT (GALLERY + PRODUCT OVERVIEW)
   ========================================================================== */
.bsmart-product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(32px, 5vw, 64px);
}

.bsmart-product-layout > * {
    min-width: 0;
}

/* ==========================================================================
   LEFT COLUMN: PRODUCT GALLERY & ACTIVE-RING THUMBNAILS
   ========================================================================== */
.bsmart-catalog-product .woocommerce-product-gallery {
    float: none !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
}

.bsmart-catalog-product .flex-viewport,
.bsmart-catalog-product .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper {
    border: 1px solid var(--bsmart-border-subtle);
    border-radius: var(--bsmart-radius-lg);
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(11, 31, 80, 0.04);
}

.bsmart-catalog-product .woocommerce-product-gallery__wrapper {
    margin: 0;
    padding: 0;
}

.bsmart-catalog-product .woocommerce-product-gallery__image {
    border: none;
    border-radius: var(--bsmart-radius-lg);
    overflow: hidden;
    background: #ffffff;
    padding: clamp(16px, 2.5vw, 28px);
}

.bsmart-catalog-product .woocommerce-product-gallery__image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.bsmart-catalog-product .woocommerce-product-gallery__image img {
    display: block;
    width: 100%;
    max-height: 460px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    border-radius: var(--bsmart-radius-sm);
}

/* Thumbnail Grid below Main Image (Matches Reference Image) */
.bsmart-catalog-product .flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(105px, 136px));
    gap: 16px;
    margin: 18px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.bsmart-catalog-product .flex-control-thumbs li {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    aspect-ratio: 1 / 1;
    border: 1.5px solid var(--bsmart-border-subtle);
    border-radius: var(--bsmart-radius-md);
    background: #ffffff;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.bsmart-catalog-product .flex-control-thumbs li:hover {
    border-color: #9bbfff;
    transform: translateY(-2px);
}

.bsmart-catalog-product .flex-control-thumbs li.is-active-thumb,
.bsmart-catalog-product .flex-control-thumbs li:has(img.flex-active) {
    border: 2px solid var(--bsmart-primary);
    box-shadow: 0 4px 14px rgba(8, 102, 245, 0.12);
}

.bsmart-catalog-product .flex-control-thumbs li img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0.82 !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.bsmart-catalog-product .flex-control-thumbs li:hover img,
.bsmart-catalog-product .flex-control-thumbs li.is-active-thumb img,
.bsmart-catalog-product .flex-control-thumbs li img.flex-active {
    opacity: 1 !important;
}

/* ==========================================================================
   RIGHT COLUMN: PRODUCT INFO, PILLS & UNCHANGED CTAs
   ========================================================================== */
.bsmart-product-info {
    padding-top: 8px;
}

.bsmart-product-eyebrow {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--bsmart-primary);
}

.bsmart-product-categories.bsmart-category-eyebrow {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--bsmart-primary);
}

.bsmart-product-categories.bsmart-category-eyebrow a {
    color: var(--bsmart-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bsmart-product-categories.bsmart-category-eyebrow a:hover {
    color: var(--bsmart-navy);
    text-decoration: underline;
}

/* Title + Status Badge Inline Row */
.bsmart-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.bsmart-catalog-product .bsmart-product-title {
    margin: 0;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--bsmart-navy);
}

.bsmart-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--bsmart-radius-pill);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.bsmart-status-badge.is-instock {
    background-color: var(--bsmart-badge-bg);
    border: 1px solid var(--bsmart-badge-border);
    color: var(--bsmart-badge-text);
}

.bsmart-status-badge.is-request {
    background-color: var(--bsmart-primary-soft);
    border: 1px solid var(--bsmart-border);
    color: var(--bsmart-primary);
}

/* Brand & SKU Meta Row */
.bsmart-product-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--bsmart-muted);
}

.bsmart-product-brand strong,
.bsmart-product-sku strong {
    color: var(--bsmart-navy);
    font-weight: 600;
}

.bsmart-product-sku {
    margin: 0;
    font-size: 14px;
    color: var(--bsmart-muted);
}

/* Short Description */
.bsmart-product-description {
    margin-bottom: 26px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--bsmart-text);
}

.bsmart-product-description p {
    margin: 0 0 12px;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.bsmart-product-description p:last-child {
    margin-bottom: 0;
}

/* Quick-Spec / Size Pill Selector (Matches Reference Image Pills) */
.bsmart-quick-specs {
    margin-bottom: 28px;
}

.bsmart-quick-specs-label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--bsmart-navy);
}

.bsmart-quick-specs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bsmart-spec-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--bsmart-border-subtle);
    border-radius: var(--bsmart-radius-pill);
    background-color: #ffffff;
    color: var(--bsmart-navy);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.bsmart-spec-pill:hover {
    border-color: var(--bsmart-primary);
    color: var(--bsmart-primary);
    background-color: var(--bsmart-surface);
}

.bsmart-spec-pill.is-active {
    background-color: var(--bsmart-primary);
    border-color: var(--bsmart-primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(8, 102, 245, 0.2);
}

.bsmart-spec-pill:focus-visible {
    outline: 3px solid rgba(8, 102, 245, 0.3);
    outline-offset: 2px;
}

/* Call to Actions (Preserved Structure, Refined Pill/Button Styling) */
.bsmart-product-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.bsmart-catalog-product .bsmart-action-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    margin: 0;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: var(--bsmart-radius-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.bsmart-action-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bsmart-catalog-product .bsmart-action-quote {
    background: var(--bsmart-navy-deep);
    border-color: var(--bsmart-navy-deep);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(1, 32, 99, 0.16);
}

.bsmart-catalog-product .bsmart-action-quote:hover {
    background: var(--bsmart-primary);
    border-color: var(--bsmart-primary);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(8, 102, 245, 0.24);
    transform: translateY(-2px);
}

.bsmart-catalog-product .bsmart-action-whatsapp {
    background: #ffffff;
    border-color: #cfe8d9;
    color: #168744;
}

.bsmart-catalog-product .bsmart-action-whatsapp:hover {
    background: #f0fbf4;
    border-color: #25d366;
    color: #12813d;
    box-shadow: 0 8px 20px rgba(22, 135, 68, 0.12);
    transform: translateY(-2px);
}

.bsmart-catalog-product .bsmart-action-btn:focus-visible {
    outline: 3px solid rgba(8, 102, 245, 0.35);
    outline-offset: 2px;
}

.bsmart-actions-divider {
    margin-top: 28px;
    border-top: 1px solid var(--bsmart-border-subtle);
}

.bsmart-product-reference {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 20px;
    padding: 18px 20px;
    border: 1px solid var(--bsmart-border-subtle);
    border-radius: 12px;
    background: var(--bsmart-surface);
}

.bsmart-product-reference > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bsmart-product-reference strong {
    font-size: 13.5px;
    color: var(--bsmart-navy);
}

.bsmart-product-reference span {
    font-size: 12px;
    color: var(--bsmart-muted);
}

.bsmart-product-reference a {
    color: var(--bsmart-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.bsmart-product-reference a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   BOTTOM HORIZONTAL UNDERLINE TABS (MATCHES REFERENCE IMAGE)
   ========================================================================== */
.bsmart-tabs-wrapper {
    margin-top: 64px;
}

.bsmart-tabs-nav {
    display: flex;
    align-items: center;
    gap: clamp(28px, 4vw, 48px);
    border-bottom: 1px solid var(--bsmart-border-subtle);
    margin-bottom: 32px;
    overflow-x: auto;
    scrollbar-width: none;
}

.bsmart-tabs-nav::-webkit-scrollbar {
    display: none;
}

.bsmart-tab-trigger {
    position: relative;
    padding: 0 4px 16px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 500;
    color: #98a2b3;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.bsmart-tab-trigger:hover {
    color: var(--bsmart-navy);
}

.bsmart-tab-trigger.is-active {
    color: var(--bsmart-navy);
    font-weight: 700;
}

.bsmart-tab-trigger.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2.5px;
    border-radius: 3px;
    background-color: var(--bsmart-navy);
}

.bsmart-tab-trigger:focus-visible {
    outline: 2px solid var(--bsmart-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.bsmart-tab-panel[hidden] {
    display: none !important;
}

.bsmart-tab-panel {
    animation: bsmartTabFadeIn 0.22s ease;
}

@keyframes bsmartTabFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bsmart-section-body {
    max-width: 920px;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--bsmart-text);
}

.bsmart-section-body p {
    margin: 0 0 14px;
    color: inherit;
}

/* ==========================================================================
   SPECIFICATION TABLES (WC SPEC TABLES MU-PLUGIN & ATTRIBUTES)
   ========================================================================== */
.wc-spec-tables-wrapper {
    margin-top: 0;
}

.wc-spec-table-container {
    margin-bottom: 28px !important;
    border: 1px solid var(--bsmart-border);
    border-radius: var(--bsmart-radius-md);
    background: #ffffff;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(11, 31, 80, 0.04);
    overflow-x: auto;
}

.wc-spec-table-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--bsmart-navy) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-spec-table-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--bsmart-primary);
}

table.wc-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    background-color: #ffffff;
    border: 1px solid var(--bsmart-border-subtle);
    border-radius: 10px;
    overflow: hidden;
}

table.wc-spec-table thead th {
    background-color: #f0f6ff;
    color: var(--bsmart-navy);
    font-weight: 700;
    font-size: 13.5px;
    padding: 12px 14px;
    border: 1px solid var(--bsmart-border);
    text-align: center;
}

table.wc-spec-table tbody td {
    padding: 11px 14px;
    border: 1px solid var(--bsmart-border-subtle);
    text-align: center;
    color: var(--bsmart-text);
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

table.wc-spec-table tbody tr:nth-child(even) {
    background-color: var(--bsmart-surface);
}

table.wc-spec-table tbody tr:hover td {
    background-color: #eef5ff;
    color: var(--bsmart-navy);
}

table.wc-spec-table tbody tr.is-highlighted-row td {
    background-color: var(--bsmart-primary-soft) !important;
    color: var(--bsmart-navy) !important;
    font-weight: 700;
}

/* Standard WooCommerce Visible Attributes Table */
.bsmart-specifications {
    overflow-x: auto;
    border: 1px solid var(--bsmart-border);
    border-radius: var(--bsmart-radius-md);
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(11, 31, 80, 0.04);
}

.bsmart-specifications table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.bsmart-specifications tr {
    border-bottom: 1px solid var(--bsmart-border-subtle);
}

.bsmart-specifications tr:last-child {
    border-bottom: 0;
}

.bsmart-specifications th,
.bsmart-specifications td {
    padding: 16px 20px;
    border: 0;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.bsmart-specifications th {
    width: 34%;
    background: var(--bsmart-surface);
    color: var(--bsmart-navy);
    font-weight: 600;
}

.bsmart-specifications td {
    color: var(--bsmart-text);
}

/* ==========================================================================
   CATALOG LOOP PRODUCT CARDS (content-product.php)
   ========================================================================== */
.bsmart-LoopProduct-col {
    margin-bottom: 30px;
}

.products .product.bsmart-catalog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--bsmart-border-subtle);
    border-radius: 18px;
    text-align: left;
    box-shadow: 0 4px 16px rgba(11, 31, 80, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.products .product.bsmart-catalog-card:hover {
    transform: translateY(-4px);
    border-color: var(--bsmart-border);
    box-shadow: 0 14px 32px rgba(11, 31, 80, 0.08);
}

.products .product.bsmart-catalog-card .bsmart-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: var(--bsmart-surface);
    border: 1px solid #eef4fc;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.products .product.bsmart-catalog-card .bsmart-card-media::before {
    display: none !important;
}

.products .product.bsmart-catalog-card .bsmart-card-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.products .product.bsmart-catalog-card .bsmart-card-media img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 220px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.products .product.bsmart-catalog-card:hover .bsmart-card-media img {
    transform: scale(1.04);
}

.products .product.bsmart-catalog-card .bsmart-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 16px 6px 4px;
}

.bsmart-card-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--bsmart-primary);
    margin-bottom: 6px;
}

.bsmart-card-category a {
    color: var(--bsmart-primary);
    text-decoration: none;
}

.products .product.bsmart-catalog-card .bsmart-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--bsmart-navy);
}

.products .product.bsmart-catalog-card .bsmart-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.products .product.bsmart-catalog-card .bsmart-card-title a:hover {
    color: var(--bsmart-primary);
}

.bsmart-card-sku {
    font-size: 12.5px;
    color: var(--bsmart-muted);
    margin-bottom: 12px;
}

.bsmart-card-sku span {
    color: var(--bsmart-navy);
    font-weight: 600;
}

.bsmart-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--bsmart-border-subtle);
}

.bsmart-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--bsmart-navy-deep);
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease;
}

.bsmart-card-cta svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.products .product.bsmart-catalog-card:hover .bsmart-card-cta {
    color: var(--bsmart-primary);
}

.products .product.bsmart-catalog-card:hover .bsmart-card-cta svg {
    transform: translateX(3px);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 991px) {
    .bsmart-single-product-section.pt-120.pb-120 {
        padding-top: 48px;
        padding-bottom: 80px;
    }

    .bsmart-product-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .bsmart-catalog-product .flex-control-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(96px, 120px));
    }
}

@media (max-width: 600px) {
    #bsmart-quote-modal {
        padding: 12px;
    }

    #bsmart-quote-modal .bsmart-quote-dialog {
        padding: 30px 20px;
        max-height: 92dvh;
    }

    #bsmart-quote-modal .bsmart-quote-heading h2 {
        font-size: 25px;
    }
}

@media (max-width: 480px) {
    .bsmart-catalog-product {
        padding-top: 24px;
    }

    .bsmart-catalog-product .flex-control-thumbs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .bsmart-product-actions {
        gap: 10px;
    }

    .bsmart-catalog-product .bsmart-action-btn {
        min-height: 48px;
        padding: 10px 12px;
        gap: 6px;
        font-size: 12.5px;
    }

    .bsmart-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .bsmart-tabs-wrapper {
        margin-top: 44px;
    }

    .wc-spec-table-container {
        padding: 14px 12px;
    }

    .bsmart-specifications th,
    .bsmart-specifications td,
    table.wc-spec-table thead th,
    table.wc-spec-table tbody td {
        padding: 10px 8px;
        font-size: 12.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bsmart-catalog-product *,
    .bsmart-catalog-card,
    .bsmart-tab-panel {
        animation: none !important;
        transition: none !important;
    }
}
