/* ibsizetable — Tabla de tallas y precio por cantidad — IBINN */

.ibst-wrapper {
    margin: 1.5rem 0;
}

/* ── Ocultar el botón nativo de añadir al carrito cuando la tabla está activa ── */
/* .ibst-wrapper y .product-add-to-cart son hermanos dentro del <form>.
   Se ocultan solo los hijos del bloque nativo de compra, no el contenedor: otros
   módulos cuelgan contenido del hook displayProductActions dentro de
   .product-add-to-cart (p. ej. los iconos de propiedad de ibgesplanet) y ese
   contenido debe seguir visible con la tabla activa. */
.ibst-wrapper ~ .product-add-to-cart {
    padding-top: 0 !important;
}

.ibst-wrapper ~ .product-add-to-cart > .product-quantity,
.ibst-wrapper ~ .product-add-to-cart > .product-minimal-quantity {
    display: none !important;
}

/* ── Sección título ───────────────────────────────────────────────────── */
.ibst-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
    color: #333;
}

/* Combinación cuyos tramos se están mostrando */
.ibst-tiers-for {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #0073e6;
}

.ibst-tiers-for:not(:empty)::before {
    content: '— ';
    color: #999;
}

/* Con varias tallas el rótulo forma parte del título: solo la talla va resaltada */
.ibst-tiers-for[data-label]:not(:empty)::before {
    content: '| ' attr(data-label) ' - ';
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #333;
}

/* ── Tabla precio por cantidad ────────────────────────────────────────── */
.ibst-price-tiers {
    margin-bottom: 1.4rem;
}

.ibst-tiers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ibst-tiers-table th,
.ibst-tiers-table td {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.ibst-tiers-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.ibst-tier-row {
    transition: background 0.2s;
}

.ibst-tier-row.active {
    background: #e8f4fd;
    font-weight: 600;
}

.ibst-tier-discount {
    color: #c0392b;
    font-weight: 600;
}

/* ── Tabla de tallas ──────────────────────────────────────────────────── */
.ibst-size-table-wrap {
    position: relative;
}

.ibst-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    font-size: 1.5rem;
    z-index: 10;
}

.ibst-size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.ibst-size-table th,
.ibst-size-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    vertical-align: middle;
}

.ibst-size-table thead th {
    background: #f5f5f5;
    font-weight: 600;
    text-align: center;
}

.ibst-size-table tbody td {
    text-align: center;
}

.ibst-size-table tbody td.ibst-size-name {
    text-align: left;
    font-weight: 600;
}

.ibst-no-stock {
    opacity: 0.6;
}

/* ── Fila seleccionada: manda en la tabla de precio por cantidad ───────── */
.ibst-size-row {
    cursor: pointer;
    transition: background 0.15s;
}

.ibst-size-row:hover {
    background: #fafafa;
}

.ibst-size-row.ibst-row-active {
    background: #e8f4fd;
}

/* Una talla agotada no se puede seleccionar: ni cursor de enlace ni hover */
.ibst-size-row.ibst-no-stock {
    cursor: default;
}

.ibst-size-row.ibst-no-stock:hover {
    background: transparent;
}

.ibst-size-row.ibst-row-active td.ibst-size-name {
    box-shadow: inset 3px 0 0 #0073e6;
}

.ibst-in-stock {
    color: #27ae60;
    font-weight: 600;
}

.ibst-out-stock {
    color: #e74c3c;
    font-size: 0.8rem;
}

.ibst-qty-input {
    width: 70px;
    text-align: center;
    padding: 0.3rem 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.ibst-qty-input:focus {
    outline: none;
    border-color: #0073e6;
    box-shadow: 0 0 0 2px rgba(0,115,230,0.2);
}

.ibst-unit-price {
    font-weight: 600;
    white-space: nowrap;
}

/* ── Footer / resumen ─────────────────────────────────────────────────── */
.ibst-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid #e0e0e0;
}

.ibst-summary {
    flex: 1;
    font-size: 0.875rem;
    color: #444;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.ibst-separator {
    color: #ccc;
}

.ibst-total-qty,
.ibst-effective-price,
.ibst-total-amount {
    font-weight: 600;
    color: #222;
}

.ibst-add-to-cart {
    white-space: nowrap;
}

.ibst-spinner {
    margin-left: 0.4rem;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .ibst-size-table th:nth-child(5),
    .ibst-size-table td:nth-child(5) {
        display: none;
    }

    .ibst-tiers-table th:last-child,
    .ibst-tiers-table td:last-child {
        display: none;
    }
}
