/* 
 * MODERN B2B FOR HEADLESS - MIGRATED & REDESIGNED (Screenshot Match)
 */

/* GLOBAL RESET FOR LAYOUT SAFETY */
* {
    box-sizing: border-box;
}

:root {
    --c-primary: #2fb5d2;
    /* Cyan/Blue from button "AÑADIR AL CARRITO" and "NUEVO" */
    --c-green: #28a745;
    /* Green from Price and Stock */
    --c-dark: #333;
    --c-grey-bg: #f5f5f5;
    --c-border: #e1e1e1;
    --font-main: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius: 5px;
    /* Screenshot has small rounded corners */
}

body {
    background-color: var(--c-grey-bg) !important;
    color: var(--c-dark);
    font-family: var(--font-main) !important;
    line-height: 1.5;
    margin: 0;
}

/* --- HEADER MIGRADO --- */
header {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Limit container width to show grey background on sides */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- PRODUCT DETAIL PAGE (Screenshot Match) --- */
/* Ensure the body or main container also follows this width constraint */
/* --- PRODUCT DETAIL PAGE (Screenshot Match) --- */
/* Ensure the body or main container also follows this width constraint */
body>.container,
.b2b-container,
.product-detail-wrapper {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 95%;
    /* Responsive fallback */
}

.product-detail-wrapper {
    display: flex;
    gap: 30px;
    background: transparent;
}

/* 1. Main Card Container */
.product-card-main {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    /* Subtle shadow like image */
    padding: 30px;
    display: flex;
    flex-wrap: wrap;
    /* Standard flex wrap */
    align-items: flex-start;
    /* IMPORTANT: Align top */
    position: relative;
    width: 100%;
}

/* Badge NUEVO */
.badge-new {
    background-color: var(--c-primary);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 2px;
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 10;
}

/* Image Column */
.col-img {
    flex: 0 0 40%;
    max-width: 40%;
    padding-right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-cover img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 350px;
    mix-blend-mode: multiply;
}

.product-thumbs {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.thumb-item {
    border: 1px solid #ddd;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 4px;
}

.thumb-item:hover,
.thumb-item.selected {
    border-color: var(--c-primary);
    border-width: 2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.thumb-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Info Column */
.col-info {
    flex: 0 0 60%;
    max-width: 60%;
    padding-left: 20px;
}

.product-title-h1 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 5px 0;
    /* Reduced */
}

.product-model {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    /* Reduced */
    font-weight: 600;
}

/* Prices Section */
.price-section {
    margin-bottom: 20px;
    margin-top: 0;
    /* Close to model */
}

.main-price-green {
    font-size: 32px;
    font-weight: 800;
    /* Reverted to 800 as requested */
    color: var(--c-green);
    /* The big green price from screenshot */
    line-height: 1;
    margin-bottom: 5px;
}

.tax-label {
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-left: 5px;
}

.your-price-row {
    font-size: 17px;
    /* Increased from 16px */
    color: #000;
    font-weight: 700;
    margin-bottom: 0px;
    /* Even tighter */
    line-height: 1.2;
}

.discount-row {
    font-size: 16px;
    /* Increased from 15px */
    color: var(--c-green);
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.stock-status {
    font-size: 13px;
    color: var(--c-green);
    margin-top: 5px;
}

/* Description & Data */
.short-desc {
    font-size: 14px;
    color: #666;
    margin: 15px 0 10px 0;
    line-height: 1.5;
}

.tech-data-inline {
    margin-bottom: 25px;
    font-size: 14px;
}

.tech-data-inline h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
    margin-bottom: 10px;
}

.tech-row {
    display: block;
    margin-bottom: 4px;
    color: #555;
}

.tech-row strong {
    color: #333;
    font-weight: 700;
    margin-right: 5px;
}

/* Add to Cart */
.add-to-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.qty-input-group {
    position: relative;
    display: flex;
    width: 60px;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 2px;
    align-items: center;
}

.qty-input-group input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-weight: 600;
    outline: none;
}

.btn-add-cart {
    background-color: var(--c-primary);
    color: white;
    border: none;
    height: 44px;
    padding: 0 30px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    border-radius: 2px;
    /* Screenshot rectangular button */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.btn-add-cart:hover {
    background-color: #25a0ba;
}

/* Social & Security */
.social-share {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    align-items: center;
}

.social-share i,
.social-share svg {
    color: #777;
    cursor: pointer;
    font-size: 16px;
}

.security-text {
    margin-top: 20px;
    font-size: 12px;
    color: #888;
}

/* --- BOTTOM CARD (TABS) --- */
.product-card-bottom {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 30px;
}

.tabs-nav {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.tab-link {
    padding-bottom: 15px;
    font-weight: 600;
    color: #999;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.tab-link.active {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
}

.tab-content {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

/* Helper for responsiveness */
@media (max-width: 900px) {
    .product-card-main {
        flex-direction: column;
    }

    .col-img,
    .col-info {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
    }

    .col-img {
        margin-bottom: 30px;
    }
}

/* --- HEADER SEARCH Styles (Revised) --- */
.header-search-container {
    display: flex;
    gap: 15px;
    flex: 1;
    max-width: 900px;
    margin: 0 40px;
}

.search-group {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    /* Ensure they fill space */
}

/* Base input styles */
.search-group input {
    width: 100%;
    padding: 10px 18px;
    border: 1px solid #ddd;
    outline: none;
    background: #f9f9f9;
    color: #333;
    transition: all 0.3s;
    box-sizing: border-box;
    font-size: 0.95rem;
    height: 44px;
    border-radius: 4px;
}

.search-group input:focus {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Stronger shadow */
    border-color: var(--c-primary);
    z-index: 2;
}

#search-category {
    /* Category specific - maybe visually distinct? */
    border-radius: 4px;
}

#search-product {
    /* Product specific */
    border-radius: 4px;
    border-left: 1px solid #ddd;
    /* Restore separation if next to category */
    font-size: 1.05rem;
    /* Slightly bigger text */
}

/* Button inside input logic was removed in HTML, now we rely on pure input. 
   If svg button is added back, position it absolute. */
.search-group button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--c-primary);
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 3;
}

/* Dropdown Results */
.search-dropdown {
    position: absolute;
    top: 48px;
    /* Push slightly below 44px input */
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    display: none;
    max-height: 500px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: background 0.1s;
}

.search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.search-result-item:hover {
    background: #f0f9ff;
}

.search-result-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-right: 15px;
    border: 1px solid #f0f0f0;
    background: #fff;
    border-radius: 4px;
    padding: 2px;
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 2px;
}

.search-result-ref {
    font-size: 0.75rem;
    color: #999;
}

/* --- GRID PRODUCTOS --- */
.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-miniature {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 15px;
    flex: 0 0 calc(25% - 15px);
    max-width: calc(25% - 15px);
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 410px;
}

.product-miniature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: #ccc;
    z-index: 5;
}

.thumbnail-container {
    text-align: center;
    margin-bottom: 15px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    /* Make white background transparent */
}

.product-description {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Push content apart */
}

.product-ref {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 5px;
    display: block;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.4;
    min-height: 40px;
}

.product-title a {
    text-decoration: none;
    color: var(--c-dark);
}

.product-prices {
    margin-top: auto;
    margin-bottom: 15px;
    min-height: 45px;
}

.pvp-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.product-price {
    font-weight: 800;
    color: var(--c-green);
    font-size: 1.3rem;
}

.btn-add {
    width: 100%;
    background: white;
    color: var(--c-primary);
    border: 2px solid var(--c-primary);
    /* Thicker border */
    padding: 8px 10px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-add:hover {
    background: var(--c-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(47, 181, 210, 0.3);
}

@media (max-width: 1200px) {
    .product-miniature {
        flex: 0 0 calc(33.33% - 14px);
        max-width: calc(33.33% - 14px);
    }
}

@media (max-width: 900px) {
    .product-miniature {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .product-miniature {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .header-search-container {
        flex-direction: column;
    }

    .search-group {
        width: 100% !important;
        flex: auto !important;
    }
}


/* --- CATEGORY PILLS (Home) --- */
.cat-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 30px;
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #ddd transparent;
}

.cat-pills::-webkit-scrollbar {
    height: 6px;
}

.cat-pills::-webkit-scrollbar-track {
    background: transparent;
}

.cat-pills::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 20px;
}

.cat-pill {
    background: #fff;
    border: 1px solid #eee;
    padding: 8px 15px;
    border-radius: 20px;
    white-space: nowrap;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.cat-pill:hover {
    background: var(--c-primary);
    color: white;
    border-color: var(--c-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(47, 181, 210, 0.2);
}

/* --- VOLUME DISCOUNTS TABLE --- */
.volume-discounts table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    margin-top: 15px;
    border: 1px solid #eee;
}

.volume-discounts th {
    text-align: center;
    padding: 12px;
    color: #444;
    background: #f8f8f8;
    font-weight: 700;
    border-bottom: 1px solid #ddd;
}

.volume-discounts td {
    text-align: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.volume-discounts tr:last-child td {
    border-bottom: none;
}

.volume-discounts tr:nth-child(even) {
    background-color: #fbfbfb;
}

/* [STOCK_VISIBILITY_START] */

.availability, .availability-list, .product-availability, 
.product-quantities, .out-of-stock, .available-now, .available-later,
.stock-notification, [class*='availability'], .card-availability,
.label-availability, .product-flags .availability,
.warning_inline, span.warning, .alert-warning,
.product-last-items, .last-items, .product-unavailable,
/* CLASES ESPECÍFICAS DE B2BHelper: */
.product-stock-status, .stock-ok, .stock-warning, .stock-backorder, .stock-ko {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0 !important;
    content: '' !important;
}
.availability span, .product-availability span, .product-stock-status span { display:none !important; }
/* [STOCK_VISIBILITY_END] */

/* SEO & ACCESSIBILITY HELPERS */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}