/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #0C4DA2;
    --color-primary-dark: #093a7a;
    --color-primary-light: #e8f0fc;
    --color-header-bg: #ffffff;
    --color-nav-bg: #373737;
    --color-accent-green: #28a745;
    --color-price: #c8a415;
    --color-text: #373737;
    --color-text-light: #666;
    --color-text-muted: #999;
    --color-border: #e0e0e0;
    --color-bg: #f4f6f9;
    --color-white: #fff;
    --color-stock-ok: #28a745;
    --color-stock-low: #e67e22;
    --color-stock-no: #dc3545;
    --color-offer: #e53935;
    --color-category-bg: #f5c518;
    --color-category-text: #333;
    --font-family: 'Nunito', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --shadow-card: 0 1px 4px rgba(12,77,162,0.08);
    --shadow-card-hover: 0 6px 20px rgba(12,77,162,0.15);
    --radius: 6px;
    --radius-lg: 10px;
    --radius-pill: 9999px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    font-size: 14px;
    display: flex;
    flex-direction: column;
}

/* === Header === */
.header {
    background: var(--color-header-bg);
    color: var(--color-text);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 3px solid var(--color-primary);
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo img {
    height: 50px;
    width: auto;
}

.header-logo h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.3px;
}

.header-logo h1 span {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 14px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--color-text-light);
}

.header-info .product-count {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 12px;
}

/* === Nav bar === */
.nav-bar {
    background: var(--color-nav-bg);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    flex-shrink: 0;
}

.nav-bar a {
    color: var(--color-white);
    text-decoration: none;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.2s;
    letter-spacing: 0.3px;
}

.nav-bar a:hover,
.nav-bar a.active {
    background: var(--color-primary);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* === Layout === */
.main-layout {
    display: flex;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 15px;
    gap: 15px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* === Sidebar === */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-primary);
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 0;
}

.sidebar-header h3 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--color-white);
    letter-spacing: 0.5px;
}

.btn-clear-filters {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: var(--color-white);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.2s;
}

.btn-clear-filters:hover {
    background: rgba(255,255,255,0.2);
}

/* === Facet groups === */
.facet-group {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: none;
}

.facet-group:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.facet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-primary-dark);
}

.facet-header:hover {
    background: var(--color-primary);
}

.facet-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-white);
    letter-spacing: 0.3px;
}

.facet-chevron {
    font-size: 10px;
    color: rgba(255,255,255,0.7);
}

.facet-values {
    max-height: 220px;
    overflow-y: auto;
}

.facet-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f8f8f8;
}

.facet-value:hover {
    background: var(--color-primary-light);
}

.facet-value.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.facet-value-name {
    font-size: 12px;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.facet-value-count {
    font-size: 10px;
    color: var(--color-text-muted);
    background: #f0f0f0;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
    flex-shrink: 0;
}

.facet-value.active .facet-value-count {
    background: var(--color-primary);
    color: var(--color-white);
}

/* === Active filter chips === */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    cursor: default;
}

.chip-remove {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.chip-remove:hover {
    opacity: 1;
}

/* === Content area === */
.content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* === Search bar === */
.toolbar-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--color-bg);
    padding-bottom: 10px;
}

.search-bar-container {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    color: var(--color-text-muted);
    width: 18px;
    height: 18px;
}

.search-field-select {
    padding: 11px 18px 11px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-light);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    min-width: 150px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230C4DA2' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.search-field-select:hover {
    background: #d4e4f7;
}

.search-field-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(12, 77, 162, 0.15);
}

.search-input {
    width: 100%;
    padding: 11px 15px 11px 42px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--color-primary);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.btn-search {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 11px 28px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.btn-search:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn-search:active {
    transform: translateY(0);
}

/* === Results header === */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 8px 0;
    margin-bottom: 0;
    font-size: 13px;
    color: var(--color-text-light);
}

.results-header .results-count {
    font-weight: 600;
    color: var(--color-text);
}

.results-header .results-count strong {
    color: var(--color-primary);
}

.results-header .results-time {
    font-size: 12px;
    color: var(--color-text-muted);
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-toggle button {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 6px 10px;
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.view-toggle button.active,
.view-toggle button:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.sort-select {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 6px 28px 6px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.sort-select:hover {
    border-color: var(--color-primary);
}

.sort-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(12, 77, 162, 0.15);
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 4px;
    align-self: center;
}

.products-grid.stock-only .product-card.no-stock-card {
    display: none;
}

.products-grid.hide-prices .product-precio {
    visibility: hidden;
}

.product-modal-overlay.hide-prices .modal-price-box {
    visibility: hidden;
}

.product-modal-overlay.hide-prices .modal-price-taxes {
    visibility: hidden;
}

.product-modal-overlay.hide-prices .modal-tab[data-tab="precios"] {
    display: none;
}

/* === Product Grid === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

/* === Product Card === */
.product-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* --- Image --- */
.product-card-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px;
}

.product-card-image svg {
    width: 80px;
    height: 80px;
    color: #ddd;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- Body --- */
.product-card-body {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-marca {
    font-size: 12px;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Brand logo --- */
.marca-logo {
    height: 32px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
}

.modal-marca-logo {
    height: 64px;
    max-width: 160px;
}

.product-nombre {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-categoria {
    margin-top: 4px;
}

.product-categoria span {
    background: var(--color-category-bg);
    color: var(--color-category-text);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- Copyable codes feedback --- */
.copyable {
    cursor: pointer;
    transition: background 0.15s;
}

.copyable:hover {
    background: #d0d0d0;
}

.copyable.copied {
    background: #c8e6c9;
}

.copyable.copied::after {
    content: ' \2713';
    color: var(--color-stock-ok);
    font-weight: 700;
}

.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #323232;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Codes (ID + GTIN) --- */
.product-codes {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.product-code,
.product-gtin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--color-text);
    background: #e8e8e8;
    padding: 3px 8px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

.product-code svg,
.product-gtin svg {
    flex-shrink: 0;
    color: var(--color-text-light);
}

/* --- Footer --- */
.product-card-footer {
    padding: 12px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

/* --- Price --- */
.product-precio {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.product-precio .precio-valor {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-price);
}

.product-precio .precio-cents {
    font-size: 14px;
    font-weight: 700;
}

.product-precio .precio-unidad {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-muted);
}

.product-precio .precio-tachado {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

/* --- Master box --- */
.product-masterbox {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- Order (qty + button) --- */
.product-order {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-qty {
    width: 60px;
    padding: 6px 4px 6px 10px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font-family);
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.order-qty::-webkit-inner-spin-button,
.order-qty::-webkit-outer-spin-button {
    opacity: 1;
}

.order-qty:focus {
    border-color: var(--color-accent-green);
}

.btn-add {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 14px;
    background: var(--color-accent-green);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s;
}

.btn-add:hover {
    background: #219a38;
    transform: translateY(-1px);
}

.btn-add:active {
    transform: translateY(0);
}

.btn-add svg {
    flex-shrink: 0;
}

/* --- Stock --- */
.product-stock {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    text-align: center;
}

.product-stock.in-stock {
    color: var(--color-stock-ok);
    background: #e8f5e9;
}

.product-stock.no-stock {
    color: var(--color-stock-no);
    background: #ffebee;
}

.product-stock .stock-num {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

/* === Product Card (List view) === */
.products-grid.list-view .product-card {
    flex-direction: row;
}

.products-grid.list-view .product-card-image {
    width: 160px;
    height: 140px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid #f0f0f0;
}

.products-grid.list-view .product-card-image svg {
    width: 50px;
    height: 50px;
}

.products-grid.list-view .product-card-body {
    flex: 1;
    padding: 12px 15px;
}

.products-grid.list-view .product-card-footer {
    border-top: none;
    border-left: 1px solid #f0f0f0;
    justify-content: center;
    padding: 12px 20px;
    min-width: 200px;
}

/* === Infinite scroll === */
#scroll-sentinel {
    height: 1px;
}

.loading-more {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* === Loading === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    gap: 10px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    color: #ddd;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--color-text-light);
    margin-bottom: 5px;
}

.empty-state p {
    font-size: 13px;
}

/* === Product Modal === */
.product-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 20px;
}

.product-modal {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.modal-header h2 {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.modal-close:hover {
    opacity: 1;
}

/* Top section: image + info */
.modal-top {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: var(--radius);
    border: 1px solid #f0f0f0;
    padding: 15px;
    min-height: 250px;
}

.modal-image-download {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.modal-image-download:hover {
    background: var(--color-primary, #1976d2);
    border-color: var(--color-primary, #1976d2);
    color: #fff;
}

.modal-image-download:disabled {
    opacity: 0.5;
    cursor: wait;
}

.modal-image img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.modal-image svg {
    width: 100px;
    height: 100px;
    color: #ddd;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-info .product-marca {
    font-size: 13px;
}

.modal-info .product-nombre {
    font-size: 16px;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.modal-info .product-categoria {
    margin-bottom: 6px;
}

.modal-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.modal-codes .code-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text);
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.modal-codes .code-label {
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--color-text-light);
    font-size: 10px;
    text-transform: uppercase;
}

.modal-ventas {
    margin-top: 6px;
    font-size: 16.8px;
    color: var(--color-text-light);
}

/* Price + Order boxes */
.modal-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 20px;
    margin: -1px 0 0 0;
}

.modal-price-box,
.modal-order-box {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: #fafcff;
}

.modal-price-box h4,
.modal-order-box h4 {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.modal-price-box .modal-price-main {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-price);
}

.modal-price-box .modal-price-main .modal-price-cents {
    font-size: 16px;
}

.modal-price-box .modal-price-unit {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 400;
}

.modal-price-box .modal-price-tachado {
    font-size: 14px;
    color: var(--color-text-muted);
    text-decoration: line-through;
    margin-right: 6px;
}

.modal-price-box .modal-price-taxes {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.modal-order-box .modal-order-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.modal-order-box .modal-order-qty {
    width: 70px;
    padding: 8px 4px 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-family);
    font-weight: 600;
    text-align: center;
    outline: none;
}

.modal-order-box .modal-order-qty:focus {
    border-color: var(--color-accent-green);
}

.modal-order-box .modal-btn-add {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--color-accent-green);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.modal-order-box .modal-btn-add:hover {
    background: #219a38;
}

.modal-order-box .modal-order-info {
    font-size: 11px;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* Stock indicator */
.modal-stock {
    padding: 0 20px;
    margin-top: 12px;
}

.modal-stock-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius);
}

.modal-stock-badge.in-stock {
    color: var(--color-stock-ok);
    background: #e8f5e9;
}

.modal-stock-badge.no-stock {
    color: var(--color-stock-no);
    background: #ffebee;
}

.modal-stock-badge .stock-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

/* Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-top: 16px;
    padding: 0 20px;
    gap: 2px;
    overflow-x: auto;
}

.modal-tab {
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    font-family: var(--font-family);
}

.modal-tab:hover {
    color: var(--color-primary);
}

.modal-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

.modal-tab-content {
    padding: 20px;
    min-height: 120px;
}

/* Tables inside tabs */
.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.modal-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.modal-table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.modal-table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.modal-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-table tr:nth-child(even) td {
    background: #fafafa;
}

.modal-table tr:hover td {
    background: var(--color-primary-light);
}

.doc-download-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.doc-download-link:hover {
    text-decoration: underline;
}

.modal-table tr.tarifa-socio-highlight td {
    background: #e8f5e9;
    font-weight: 600;
}

/* Detail grid inside Detalles tab */
.modal-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-detail-item .detail-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.modal-detail-item .detail-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

/* Proveedor info grid */
.modal-prov-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Loading inside modal */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    gap: 10px;
}

/* No data text */
.modal-no-data {
    text-align: center;
    padding: 30px;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* === Brands View === */
.brands-view {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 15px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.brands-search-wrapper {
    margin-bottom: 15px;
}

.brands-search {
    width: 100%;
    max-width: 400px;
    padding: 11px 18px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color 0.2s;
}

.brands-search:focus {
    border-color: var(--color-primary);
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.brand-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.brand-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.brand-logo-wrapper {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.brand-placeholder {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 24px;
    font-weight: 800;
}

.brand-name {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.brand-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* === Oferta blocks in modal === */
.oferta-block {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fafcff;
}

.oferta-header-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.oferta-header-info strong {
    font-size: 14px;
    color: var(--color-primary);
}

.oferta-dates {
    font-size: 12px;
    color: var(--color-text-muted);
}

.oferta-pvp {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-price);
    margin-bottom: 8px;
}

/* === Socio indicator === */
.socio-indicator {
    position: relative;
    padding: 5px 28px 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: #f0f0f0;
    color: var(--color-text-muted);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.socio-indicator::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s ease-out;
    pointer-events: none;
}

.socio-indicator.is-open::after {
    transform: translateY(-25%) rotate(-135deg);
}

.socio-indicator:hover {
    background: #e0e0e0;
}

.socio-indicator.has-socio {
    background: var(--color-accent-green);
    color: var(--color-white);
}

.socio-indicator.has-socio:hover {
    background: #219a38;
}

/* === Socio card === */
.socio-card.selected {
    border-color: var(--color-accent-green);
    box-shadow: 0 0 0 2px var(--color-accent-green);
    background: #f0fff4;
}

.socio-meta {
    font-size: 10px;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.4;
}

/* === Quitar socio button === */
.btn-quitar-socio {
    background: var(--color-stock-no);
    color: var(--color-white);
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-quitar-socio:hover {
    background: #c62828;
}

/* === Responsive === */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        overflow-y: visible;
    }

    .content {
        overflow-y: visible;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .products-grid.list-view .product-card {
        flex-direction: column;
    }

    .products-grid.list-view .product-card-image {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .products-grid.list-view .product-card-footer {
        border-left: none;
        border-top: 1px solid #f0f0f0;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-bar {
        padding: 0 10px;
    }

    /* Modal responsive */
    .product-modal-overlay {
        padding: 10px;
    }

    .modal-top {
        grid-template-columns: 1fr;
    }

    .modal-image {
        min-height: 180px;
    }

    .modal-boxes {
        grid-template-columns: 1fr;
    }

    .modal-detail-grid,
    .modal-prov-grid {
        grid-template-columns: 1fr;
    }

    .modal-tabs {
        padding: 0 10px;
    }

    .modal-tab {
        padding: 10px 12px;
        font-size: 11px;
    }

    .modal-table {
        font-size: 12px;
    }

    .modal-table th,
    .modal-table td {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .search-bar-container {
        flex-direction: column;
    }

    .btn-search {
        width: 100%;
    }
}

.badge-obsoleto {
    display: inline-block;
    width: fit-content;
    align-self: flex-start;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-boletin {
    display: inline-block;
    width: fit-content;
    align-self: flex-start;
    background: #7c3aed;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-oferta {
    display: inline-block;
    width: fit-content;
    align-self: flex-start;
    background: var(--color-offer);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Login page === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 20px;
    margin: 0;
    font-family: 'Nunito', system-ui, sans-serif;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.login-logo img {
    max-height: 48px;
}

.login-title {
    margin: 0;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.login-warning {
    background: #fff8c5;
    color: #6b5900;
    border: 1px solid #e3d16a;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
}

.login-form input {
    font-family: inherit;
    font-size: 15px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.login-error {
    min-height: 20px;
    color: #b00020;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    visibility: hidden;
}

.login-error.is-visible {
    visibility: visible;
}

.login-submit {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    padding: 11px;
    border: none;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.login-submit:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === Socio mega-menú (panel inline, empuja la página) === */
.socio-menu-panel {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: socio-menu-slide-down 0.2s ease-out;
}

@keyframes socio-menu-slide-down {
    from { transform: translateY(-10px); opacity: 0; max-height: 0; }
    to   { transform: translateY(0); opacity: 1; max-height: 1000px; }
}

.socio-indicator.is-open {
    background: var(--color-primary);
    color: var(--color-white);
}

.socio-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-primary);
    color: #fff;
}

.socio-menu-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.socio-menu-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.socio-menu-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.socio-menu-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 20px 0;
}

.socio-menu-column {
    padding: 0 20px;
    border-right: 1px solid #f0f0f0;
}

.socio-menu-column:last-child {
    border-right: none;
}

.socio-menu-heading {
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.socio-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.socio-menu-list li {
    margin: 0;
}

.socio-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    border-radius: 6px;
    color: #000;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.12s, color 0.12s;
}

.socio-menu-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.socio-menu-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.socio-menu-item:hover .socio-menu-item-icon {
    color: var(--color-primary);
}

.socio-menu-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.socio-menu-item-badge {
    background: var(--color-offer);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.socio-menu-item-disabled {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 1100px) {
    .socio-menu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .socio-menu-column:nth-child(3n) {
        border-right: none;
    }
}

@media (max-width: 700px) {
    .socio-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .socio-menu-column {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    .socio-menu-column:last-child {
        border-bottom: none;
    }
}

/* === Nav badge (número de líneas en el carrito) === */
.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 4px;
    background: var(--color-offer);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    text-align: center;
    vertical-align: middle;
}

.nav-badge[hidden] {
    display: none;
}

/* === Vista del carrito === */
.cart-view {
    padding: 20px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cart-tabs {
    display: flex;
    gap: 4px;
}

.cart-tab {
    padding: 8px 18px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: none;
}

.cart-tab:hover {
    background: var(--color-primary-light);
}

.cart-tab.active {
    background: var(--color-primary);
    color: #fff;
}

.cart-tab-count {
    display: inline-block;
    min-width: 20px;
    margin-left: 6px;
    padding: 1px 6px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.cart-tab.active .cart-tab-count {
    background: rgba(255, 255, 255, 0.25);
}

.cart-warning {
    background: #fff8c5;
    color: #6b5900;
    border: 1px solid #e3d16a;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
}

.cart-table thead {
    background: var(--color-primary);
    color: #fff;
}

.cart-table th, .cart-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.cart-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.cart-table tbody tr:hover {
    background: #f8fafd;
}

.cart-num {
    text-align: right;
    white-space: nowrap;
}

.cart-codigo {
    font-family: 'Menlo', monospace;
    font-size: 13px;
    color: var(--color-primary);
    font-weight: 600;
}

.cart-marca {
    font-weight: 700;
    color: var(--color-text);
    margin-right: 6px;
}

.cart-qty {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    text-align: right;
}

.cart-qty:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.cart-subtotal {
    font-weight: 700;
    color: var(--color-price);
}

.cart-del {
    background: transparent;
    border: none;
    color: var(--color-stock-no);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.12s;
}

.cart-del:hover {
    background: #fdecea;
}

.cart-total-label {
    text-align: right;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.cart-total {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-price);
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.btn-cart-secondary, .btn-cart-primary {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-cart-secondary {
    background: #e8e8e8;
    color: var(--color-text);
}

.btn-cart-secondary:hover {
    background: #d5d5d5;
}

.btn-cart-primary {
    background: var(--color-accent-green);
    color: #fff;
}

.btn-cart-primary:hover {
    background: #219a38;
}

/* Input clave socio en la cabecera del carrito */
.cart-clave-socio {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.cart-clave-socio input {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text);
    text-transform: none;
    letter-spacing: 0;
    min-width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cart-clave-socio input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Selector de agencia (solo tipo AGENCIA) */
.cart-agencia {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.cart-agencia select {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text);
    text-transform: none;
    letter-spacing: 0;
    min-width: 200px;
}

.cart-agencia select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Formulario de entrega (DROPSHIPPING) */
.cart-entrega {
    flex-basis: 100%;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 18px;
}

.cart-entrega h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.cart-entrega-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.cart-entrega-grid label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
}

.cart-entrega-grid .cart-entrega-wide {
    grid-column: 1 / -1;
}

.cart-entrega-grid input {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text);
    text-transform: none;
    letter-spacing: 0;
}

.cart-entrega-grid input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Tipo de carrito activo dentro del link "Carrito" del nav */
.nav-cart-active {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.85;
    margin-left: 2px;
    letter-spacing: 0.2px;
}

/* Icono del carrito en el nav */
#nav-carrito {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-cart-icon {
    flex-shrink: 0;
    opacity: 0.9;
}

