/* =============================================
   WC TABLA PRODUCTOS — Estilos
   Inspirado en MisterWorker
   ============================================= */

/* Variables de color — edita aquí para ajustar a tu marca */
:root {
    --wctp-rojo:        #e30613;
    --wctp-rojo-hover:  #c0000f;
    --wctp-gris-claro:  #f5f5f5;
    --wctp-gris-borde:  #e0e0e0;
    --wctp-gris-texto:  #555;
    --wctp-negro:       #1a1a1a;
    --wctp-verde:       #2e7d32;
    --wctp-naranja:     #e65100;
    --wctp-precio-tach: #999;
    --wctp-sku-color:   #c0000f;
    --wctp-font:        inherit;
    --wctp-radius:      4px;
    --wctp-shadow:      0 1px 4px rgba(0,0,0,.08);
}

/* Wrapper */
.wctp-wrapper {
    margin: 24px 0;
    font-family: var(--wctp-font);
}

/* Scroll horizontal en móvil */
.wctp-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--wctp-gris-borde);
    border-radius: var(--wctp-radius);
    box-shadow: var(--wctp-shadow);
}

/* Tabla */
.wctp-tabla {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    background: #fff;
    font-size: 13px;
    line-height: 1.4;
}

/* Cabecera */
.wctp-tabla thead tr {
    background: var(--wctp-gris-claro);
    border-bottom: 2px solid var(--wctp-gris-borde);
}
.wctp-tabla thead th {
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--wctp-gris-texto);
    white-space: nowrap;
}
.wctp-th-precio,
.wctp-th-accion { text-align: right; }
.wctp-th-accion { min-width: 280px; }

/* Filas */
.wctp-fila {
    border-bottom: 1px solid var(--wctp-gris-borde);
    transition: background .15s;
}
.wctp-fila:last-child { border-bottom: none; }
.wctp-fila:hover { background: #fafafa; }

/* Celdas */
.wctp-tabla td {
    padding: 13px 14px;
    vertical-align: middle;
    color: var(--wctp-negro);
}

/* SKU */
.wctp-td-sku { min-width: 130px; }
.wctp-sku-link {
    display: block;
    font-weight: 700;
    color: var(--wctp-sku-color);
    text-decoration: none;
    font-size: 13px;
    transition: color .15s;
}
.wctp-sku-link:hover { color: var(--wctp-rojo-hover); text-decoration: underline; }
.wctp-ean {
    display: block;
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

/* Disponibilidad */
.wctp-td-disp {
    min-width: 160px;
    font-size: 12px;
    color: var(--wctp-gris-texto);
    white-space: nowrap;
}
.wctp-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}
.wctp-dot--instock     { background: var(--wctp-verde); }
.wctp-dot--outofstock  { background: #aaa; }
.wctp-dot--onbackorder { background: var(--wctp-naranja); }

/* Medidas */
.wctp-td-medida {
    text-align: center;
    white-space: nowrap;
    font-size: 13px;
}

/* Precio */
.wctp-td-precio {
    text-align: right;
    white-space: nowrap;
    min-width: 110px;
}
.wctp-precio-bloque {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 2px;
}
.wctp-precio-reg {
    font-size: 12px;
    color: var(--wctp-precio-tach);
    text-decoration: line-through;
}
.wctp-precio-reg .woocommerce-Price-amount { color: var(--wctp-precio-tach) !important; }

.wctp-badge-dto {
    display: inline-block;
    background: var(--wctp-rojo);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
}

.wctp-precio-sale {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--wctp-negro);
}
.wctp-precio-sale .woocommerce-Price-amount { color: var(--wctp-negro); }

/* Acción */
.wctp-td-accion {
    text-align: right;
    min-width: 280px;
}
.wctp-accion-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Control de cantidad */
.wctp-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1px solid var(--wctp-gris-borde);
    border-radius: var(--wctp-radius);
    overflow: hidden;
    height: 36px;
}
.wctp-qty-btn {
    background: var(--wctp-gris-claro);
    border: none;
    width: 28px;
    height: 100%;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    color: var(--wctp-negro);
    transition: background .15s;
    padding: 0;
    flex-shrink: 0;
}
.wctp-qty-btn:hover { background: #e0e0e0; }
.wctp-qty-input {
    width: 38px;
    height: 100%;
    border: none;
    border-left: 1px solid var(--wctp-gris-borde);
    border-right: 1px solid var(--wctp-gris-borde);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    -moz-appearance: textfield;
    outline: none;
    color: var(--wctp-negro);
}
.wctp-qty-input::-webkit-inner-spin-button,
.wctp-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Botón añadir */
.wctp-add-btn {
    background: var(--wctp-rojo);
    color: #fff;
    border: none;
    padding: 0 14px;
    height: 36px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    border-radius: var(--wctp-radius);
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, transform .1s;
    flex-shrink: 0;
}
.wctp-add-btn:hover  { background: var(--wctp-rojo-hover); }
.wctp-add-btn:active { transform: scale(.97); }
.wctp-add-btn:disabled { background: #bbb; cursor: not-allowed; }

.wctp-add-btn--backorder { background: var(--wctp-naranja); }
.wctp-add-btn--backorder:hover { background: #bf360c; }

/* Botón "Ver producto" (sin stock) */
.wctp-ver-btn {
    display: inline-block;
    border: 1px solid var(--wctp-gris-borde);
    color: var(--wctp-gris-texto);
    padding: 0 14px;
    height: 36px;
    line-height: 34px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--wctp-radius);
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
.wctp-ver-btn:hover { border-color: #aaa; color: var(--wctp-negro); }

/* Toast de confirmación */
.wctp-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a1a1a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    z-index: 99999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.wctp-toast.wctp-toast--show {
    opacity: 1;
    transform: translateY(0);
}
.wctp-toast.wctp-toast--error { background: #c62828; }

/* Responsive */
@media (max-width: 600px) {
    .wctp-tabla { font-size: 12px; }
    .wctp-add-btn { font-size: 10px; padding: 0 10px; }
    .wctp-precio-sale { font-size: 15px; }
    .wctp-accion-wrap { gap: 5px; }
}
