/* Ficha producto — Mostrador limpio (opción A refinada) */

.ficha-v9-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 14px;
    margin-top: 8px;
}

.ficha-v9-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ficha-v9-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 6px 18px rgba(38, 37, 45, 0.07);
}

.ficha-v9-media-row {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 14px 12px;
    background: #f6f7f8;
    min-height: 0;
}

.ficha-v9-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 132px;
    text-decoration: none;
}

.ficha-v9-img-wrap img {
    width: auto;
    max-width: 88%;
    max-height: 148px;
    min-height: 96px;
    object-fit: contain;
}

.ficha-v9-badges {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    max-width: 48%;
    min-width: 0;
    pointer-events: none;
}

.ficha-v9-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.94);
    color: #4b5563;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
}

.ficha-v9-badge.badge-espacio {
    border-color: rgba(74, 222, 128, 0.45);
    color: #166534;
    background: rgba(240, 253, 244, 0.9);
}

.ficha-v9-badge.badge-brillo {
    border-color: rgba(248, 113, 113, 0.45);
    color: #991b1b;
    background: rgba(254, 242, 242, 0.9);
}

.ficha-v9-badge.badge-sistema,
.ficha-v9-badge.badge-secado {
    border-color: rgba(96, 165, 250, 0.45);
    color: #1e40af;
    background: rgba(239, 246, 255, 0.9);
}

.ficha-v9-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid #f0f0f0;
}

.ficha-v9-title-link {
    text-decoration: none;
    color: inherit;
}

.ficha-v9-title {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #26252d;
    text-transform: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ficha-v9-title-link:hover .ficha-v9-title {
    color: #c81c24;
}

.ficha-v9-sub {
    margin: 0 0 4px;
    font-size: 0.625rem;
    color: #6b7280;
    line-height: 1.3;
}

.ficha-v9-precios {
    margin: 0 0 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ficha-v9-precio-consultar {
    margin: 0 0 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
}

.ficha-v9-precio-actual {
    margin: 0 0 2px;
    font-size: 1.45rem;
    font-weight: 700;
    color: #c81c24;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ficha-v9-por-litro {
    margin: 0 0 2px;
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.3;
    opacity: 1;
}

.ficha-v9-por-litro[hidden] {
    display: none;
}

.ficha-v9-precio-neto {
    margin: 0 0 8px;
    font-size: 0.68rem;
    color: #6b7280;
    line-height: 1.3;
}

.ficha-v9-financia {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
    margin: 0 0 6px;
    padding: 8px 0 0;
    border-top: 1px solid #eef0f3;
}

.ficha-v9-cuota {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 500;
    color: #4b5563;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.ficha-v9-cuota[hidden] {
    display: none;
}

.ficha-v9-cuota strong {
    font-weight: 700;
    color: #26252d;
}

.ficha-v9-cuota-ico {
    flex: 0 0 auto;
    width: 14px;
    height: 11px;
    border: 1.5px solid #9ca3af;
    border-radius: 2px;
    position: relative;
    display: inline-block;
}

.ficha-v9-cuota-ico::before {
    content: "";
    position: absolute;
    left: 1px;
    right: 1px;
    top: 3px;
    height: 2px;
    background: #9ca3af;
}

.ficha-v9-ver-promos {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #07008a;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.3;
    flex: 0 0 auto;
    transition: color 0.15s;
}

.ficha-v9-ver-promos::after {
    content: "\2192";
    font-weight: 600;
}

.ficha-v9-ver-promos:hover {
    background: transparent;
    color: #c81c24;
    border-color: transparent;
    text-decoration: underline;
}

.ficha-v9-ref-web {
    display: block;
    margin: 0 0 8px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.62rem;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.3;
    white-space: nowrap;
}

.ficha-v9-envases,
.ficha-v9-brillos {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    margin: 0 0 8px;
    width: 100%;
}

.ficha-v9-brillo,
.ficha-v9-envase {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 4px;
    padding: 7px 11px;
    min-height: 36px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ficha-v9-brillo:hover:not(.ficha-v9-brillo--nat),
.ficha-v9-brillo.activo:not(.ficha-v9-brillo--nat),
.ficha-v9-envase:hover,
.ficha-v9-envase.activo {
    border-color: #07008a;
    color: #07008a;
    background: rgba(7, 0, 138, 0.05);
}

.ficha-v9-brillo--nat {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 3px;
    padding: 5px 7px 6px;
    min-width: 60px;
    max-width: 78px;
    min-height: 0;
    text-align: center;
    border-radius: 4px;
    background: #fff !important;
    color: #374151 !important;
}

.ficha-v9-brillo--nat:hover,
.ficha-v9-brillo--nat.activo {
    border-color: #07008a;
    box-shadow: 0 0 0 1px rgba(7, 0, 138, 0.2);
    background: #f8fafc !important;
}

.ficha-v9-brillo-swatch {
    display: block;
    width: 100%;
    min-height: 32px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background-color: #e5e7eb;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.ficha-v9-brillo-cap {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.15;
    word-break: break-word;
}

.ficha-v9-colores {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px 6px;
    margin: 0 0 8px;
    width: 100%;
}

.ficha-v9-color-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    max-width: 52px;
    flex: 0 0 auto;
}

.ficha-v9-color-label {
    display: block;
    width: 100%;
    font-size: 0.58rem;
    font-weight: 500;
    line-height: 1.15;
    text-align: left;
    color: #6b7280;
    word-break: break-word;
    hyphens: auto;
}

.ficha-v9-color-item:has(.ficha-v9-color.activo) .ficha-v9-color-label {
    color: #07008a;
    font-weight: 700;
}

.ficha-v9-color {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 5px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45);
    background-color: var(--swatch, #eee);
    background-image: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

/* PNG de texturas (ej. tintas tipo madera): chip más grande + <img> nítido */
.ficha-v9-color--pic {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
}

.ficha-v9-color-chip {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.25),
        0 1px 3px rgba(15, 23, 42, 0.12);
    background: var(--swatch, #eee);
}

.ficha-v9-color-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.ficha-v9-color:not(.ficha-v9-color--pic).activo {
    border-color: #07008a;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        0 0 0 2px rgba(7, 0, 138, 0.2);
}

.ficha-v9-color--pic.activo .ficha-v9-color-chip {
    border-color: #07008a;
    outline: 2px solid rgba(7, 0, 138, 0.45);
    outline-offset: 1px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.3),
        0 0 0 1px rgba(7, 0, 138, 0.15);
}

.ficha-v9-litros-link {
    margin: 4px 0 8px;
    font-size: 0.65rem;
}

.ficha-v9-litros-link a {
    color: #07008a;
    text-decoration: none;
}

.ficha-v9-litros-link a:hover {
    text-decoration: underline;
    color: #c81c24;
}

.ficha-v9-cotizar,
.ficha-v9-cotizar.tienda-btn-cotizar {
    width: 100%;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #c81c24 !important;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 12px 14px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease;
}

.ficha-v9-cotizar i,
.ficha-v9-cotizar .fa,
.ficha-v9-cotizar svg {
    display: none !important;
}

.ficha-v9-cotizar:hover,
.ficha-v9-cotizar.tienda-btn-cotizar:hover {
    filter: none;
    background: #a60000 !important;
}

/* Tintas madera: mismo ancho que el resto; 5 colores en una fila dentro de la ficha */
.ficha-v9-card--maderas .ficha-v9-colores {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px 5px;
}

.ficha-v9-card--maderas .ficha-v9-color-item {
    max-width: none;
    width: 100%;
}

.ficha-v9-card--maderas .ficha-v9-color-chip {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
}

/* Notebook / tablet ancha: 3 columnas compactas */
@media (max-width: 1280px) {
    .ficha-v9-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .ficha-v9-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

/* Móvil */
@media (max-width: 520px) {
    .ficha-v9-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ficha-v9-media-row {
        padding: 14px 12px 10px;
    }

    .ficha-v9-img-wrap {
        min-height: 120px;
    }

    .ficha-v9-img-wrap img {
        max-height: 130px;
        min-height: 90px;
    }

    .ficha-v9-title {
        font-size: 0.9rem;
    }

    .ficha-v9-precio-actual {
        font-size: 1.35rem;
    }

    .ficha-v9-color-chip {
        width: 36px;
        height: 36px;
    }

    .ficha-v9-color-item {
        max-width: 42px;
    }

    .ficha-v9-color-label {
        font-size: 0.52rem;
    }
}

/* Vista lista */
.catalogo-productos.ficha-v9-grid[data-vista="lista"] {
    grid-template-columns: 1fr;
    gap: 12px;
}

.catalogo-productos.ficha-v9-grid[data-vista="lista"] .ficha-v9-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
}

.catalogo-productos.ficha-v9-grid[data-vista="lista"] .ficha-v9-media-row {
    flex: 0 0 160px;
    border-radius: 0;
    border-right: 1px solid #f0f0f0;
}

.catalogo-productos.ficha-v9-grid[data-vista="lista"] .ficha-v9-body {
    flex: 1;
    min-width: 220px;
    border-top: none;
}

@media (max-width: 640px) {
    .catalogo-productos.ficha-v9-grid[data-vista="lista"] .ficha-v9-card {
        flex-direction: column;
    }

    .catalogo-productos.ficha-v9-grid[data-vista="lista"] .ficha-v9-media-row {
        flex: none;
        width: 100%;
        border-right: none;
    }

    .catalogo-productos.ficha-v9-grid[data-vista="lista"] .ficha-v9-body {
        border-top: 1px solid #f0f0f0;
    }
}
