/* ===================================================================
   NivoSearch Equivalencia Grouping - v4
   =================================================================== */

.neq-results-container,
.neq-results-container * { box-sizing: border-box; }

.neq-results-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1b3146;
    -webkit-font-smoothing: antialiased;
}

/* ── Card ── */
.neq-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid #e8edf3;
}

/* ── Header ── */
.neq-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem 0.6rem;
    gap: 0.5rem;
}
.neq-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.neq-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0faf4;
    border: 1px solid #c8e6d5;
    transition: all 0.15s ease;
}
.neq-whatsapp-btn:hover {
    background: #dcf5e7;
    border-color: #25D366;
    transform: scale(1.1);
}
.neq-whatsapp-btn svg {
    display: block;
}
.neq-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0b1a2b;
    margin: 0;
    line-height: 1.3;
}
.neq-equi-badge {
    background: #f0f4fa;
    padding: 0.3rem 0.8rem;
    border-radius: 60px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a3a5e;
    border: 1px solid #d9e1ec;
    white-space: nowrap;
}

/* ── Desc + imagen + tags ── */
.neq-card-desc-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: #f7faff;
    margin: 0.4rem 1.2rem 1rem;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    border: 1px solid #e3eaf3;
    align-items: center;
}
.neq-card-desc-image { flex: 0 0 120px; }
.neq-card-desc-image a { display: block; cursor: pointer; }
.neq-card-desc-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #dce5f0;
    background: #fff;
    padding: 2px;
    transition: transform 0.15s ease;
}
.neq-card-desc-image a:hover img {
    transform: scale(1.05);
}
.neq-card-desc-content { flex: 1 1 200px; min-width: 150px; }
.neq-card-desc-text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #1c2d44;
    margin: 0 0 0.5rem;
}
.neq-card-long-desc { margin-bottom: 0.75rem; }
.neq-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.neq-tag {
    display: inline-block;
    background: #eef4fc;
    border: 1px solid #d0ddee;
    border-radius: 60px;
    padding: 0.15rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a3a5e;
}

/* ── Tabla ── */
.neq-table-wrapper {
    overflow-x: auto;
    margin: 0 1.2rem;
    border-radius: 10px;
    border: 1px solid #e6edf6;
}
.neq-brand-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 720px;
}
.neq-brand-table thead { background: #f2f6fc; border-bottom: 1px solid #dbe3ef; }
.neq-brand-table th {
    padding: 0.65rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #38526e;
    border-right: 1px solid #e2eaf5;
    white-space: nowrap;
}
.neq-brand-table th:last-child { border-right: none; }
.neq-brand-table td {
    padding: 0.6rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f9;
    border-right: 1px solid #edf2f9;
    color: #1b3146;
}
.neq-brand-table td:last-child { border-right: none; }
.neq-brand-table tbody tr:last-child td { border-bottom: none; }
.neq-brand-table tbody tr:hover { background-color: #f6faff; }

.neq-product-name {
    font-weight: 700;
    color: #0b1f33;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
}
a.neq-product-name:hover {
    color: #2b5b8c;
    text-decoration: underline;
}
.neq-brand-cell {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1d3857;
}
.neq-discount-col {
    background: #f0f7f0;
    color: #1a6b3c;
}
.neq-discount-cell {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1a6b3c;
    background: #f9fcf9;
}
.neq-brand-cell { vertical-align: middle; }
.neq-brand-img { max-height: 30px; width: auto; vertical-align: middle; }
.neq-code-cell, .neq-ubi-cell, .neq-equi-cell {
    font-weight: 500; font-size: 0.8rem; color: #1d3857;
}
.neq-stock-cell { font-weight: 500; font-size: 0.8rem; color: #1f3f60; }
.neq-price-cell { font-weight: 700; font-size: 0.85rem; color: #11263e; white-space: nowrap; }
.neq-price-cell del { color: #8899aa; font-weight: 400; font-size: 0.75rem; margin-right: 4px; }

/* ── Actions (Ver + Agregar) ── */
.neq-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    white-space: nowrap;
}
.neq-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f0f4fa;
    border: 1px solid #cbd8e9;
    border-radius: 60px;
    padding: 0.22rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1d3b60;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}
.neq-btn-cart {
    background: #1a6b3c;
    border-color: #1a6b3c;
    color: #fff;
}
.neq-btn-cart:hover {
    background: #145a31;
    border-color: #145a31;
}
.neq-btn-cart.neq-atc-loading {
    opacity: 0.6;
    pointer-events: none;
}
.neq-btn-cart.neq-atc-added {
    background: #37946a;
    border-color: #37946a;
}
.neq-btn-cart.neq-btn-disabled {
    background: #9aabbf;
    border-color: #9aabbf;
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── WAC Cart Buttons (C2/C3) ── */
.neq-btn-wac {
    background: #f0f0f0;
    border: 1px solid #bbb;
    color: #555;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.22rem 0.5rem;
    min-width: 28px;
    border-radius: 60px;
}
.neq-btn-wac:hover {
    background: #e0e0e0;
    border-color: #999;
    color: #333;
}

/* ── Footer ── */
.neq-card-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.8rem 1.2rem 0.4rem;
    font-size: 0.82rem;
    color: #294766;
    font-weight: 500;
    border-top: 1px solid #e7eef8;
    margin: 0 1.2rem;
}
.neq-card-footer strong { font-weight: 700; color: #123456; margin-left: 3px; }

/* ── Gallery Modal ── */
.neq-gallery-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.neq-gallery-overlay.neq-gallery-open {
    display: flex;
}
.neq-gallery-modal {
    position: relative;
    max-width: 800px;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.neq-gallery-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    padding: 0 0.3rem;
    opacity: 0.8;
}
.neq-gallery-close:hover { opacity: 1; }
.neq-gallery-main {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    max-height: 70vh;
}
.neq-gallery-main img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}
.neq-gallery-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    background: #111;
    justify-content: center;
}
.neq-gallery-thumbs img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.neq-gallery-thumbs img:hover { opacity: 0.9; }
.neq-gallery-thumbs img.neq-thumb-active {
    border-color: #fff;
    opacity: 1;
}

/* ── Paginación ── */
.neq-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
    gap: 4px;
}
.neq-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1d3857;
    text-decoration: none;
    background: #fff;
    transition: all 0.15s ease;
}
.neq-pagination .page-numbers:hover {
    background: #f0f4fa;
    border-color: #a3bddb;
    color: #0b1a2b;
}
.neq-pagination .page-numbers.current {
    background: #1a3a5e;
    border-color: #1a3a5e;
    color: #fff;
    font-weight: 700;
}
.neq-pagination .page-numbers.prev,
.neq-pagination .page-numbers.next {
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .neq-card-header { padding: 1rem 1rem 0.4rem; }
    .neq-card-title { font-size: 1.1rem; }
    .neq-card-desc-wrapper { margin: 0.3rem 0.8rem 0.8rem; padding: 0.7rem 0.8rem; }
    .neq-table-wrapper { margin: 0 0.8rem; }
    .neq-brand-table { min-width: 620px; }
    .neq-brand-table th, .neq-brand-table td { padding: 0.5rem 0.35rem; font-size: 0.75rem; }
    .neq-card-footer { margin: 0 0.8rem; padding: 0.6rem 0 0.3rem; }
    .neq-ungrouped-item { flex-wrap: wrap; gap: 0.4rem; }
    .neq-gallery-overlay { padding: 1rem; }
}
@media (max-width: 480px) {
    .neq-card-header { flex-direction: column; align-items: flex-start; }
}

/* ===================================================================
   AJAX Dropdown Grouping
   =================================================================== */
.nivo-group-separator {
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.82em;
    color: #1a3a5e;
    background: linear-gradient(to right, #f0f4fa, #fff);
    border-bottom: 1px solid #e3eaf3;
    border-top: 1px solid #e3eaf3;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nivo-group-separator::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    background: #2b5b8c;
    border-radius: 2px;
}
.nivo-group-separator-text { text-transform: uppercase; letter-spacing: 0.4px; font-size: 0.92em; }
.nivo-group-separator[data-term-id="0"] { background: linear-gradient(to right, #fff3cd, #fff); border-top-color: #ffc107; }
.nivo-group-separator[data-term-id="0"]::before { background: #ffc107; }
