/* =========================================
   WC Related Subcategory Slider v2.0
   Estilo: fondo blanco, marca, precio limpio
   ========================================= */

.wcrel-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 48px auto;
    padding: 0 16px;
    box-sizing: border-box;
    background: #fff;
    font-family: inherit;
}

/* ── Título ── */
.wcrel-titulo {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    text-align: left;
    border: none;
    padding: 0;
    letter-spacing: 0;
}

.wcrel-titulo::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: #e5e5e5;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* ── Slider container ── */
.wcrel-slider {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Track wrapper ── */
.wcrel-track-wrapper {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

/* ── Track ── */
.wcrel-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    align-items: stretch;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    width: 100%;
}

/* ── Item ── */
.wcrel-item {
    width: calc((100% - ((var(--wcrel-cols, 4) - 1) * 16px)) / var(--wcrel-cols, 4));
    flex-shrink: 0;
    max-width: 100%;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease;
    min-width: 0;
    box-sizing: border-box;
    cursor: pointer;
}

.wcrel-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
    border-color: #d0d0d0;
}

/* ── Imagen ── */
.wcrel-img-link {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #fff;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.wcrel-img-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease;
}

.wcrel-item:hover .wcrel-img-link img {
    transform: scale(1.04);
}

/* ── Badge oferta ── */
.wcrel-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #333;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 2;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ── Info ── */
.wcrel-info {
    padding: 10px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    border-top: 1px solid #f0f0f0;
}

/* ── Marca ── */
.wcrel-brand {
    font-size: 0.68rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ── Nombre ── */
.wcrel-name {
    font-size: 0.88rem;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
    margin-bottom: 6px;
}

.wcrel-name:hover { color: #000; text-decoration: underline; }

/* ── Precio WooCommerce ── */
.wcrel-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Precio principal */
.wcrel-price .woocommerce-Price-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* Precio tachado */
.wcrel-price del {
    font-size: 0.82rem;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

.wcrel-price del .woocommerce-Price-amount {
    font-size: inherit;
    color: inherit;
    font-weight: inherit;
}

/* Precio de oferta */
.wcrel-price ins {
    text-decoration: none;
}

.wcrel-price ins .woocommerce-Price-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* ── Badge % descuento inline ── */
.wcrel-discount-pill {
    display: inline-block;
    background: #e53935;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.2px;
}

/* ── Botón carrito ── */
.wcrel-btn-cart {
    display: block;
    text-align: center;
    background: #fff;
    color: #333;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 9px 10px;
    border-radius: 4px;
    border: 1px solid #333;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    margin-top: auto;
    margin-top: 10px;
    letter-spacing: 0.2px;
}

.wcrel-btn-cart:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

.wcrel-btn-cart.wcrel-ver {
    border-color: #999;
    color: #666;
}

.wcrel-btn-cart.wcrel-ver:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ── Botones prev/next ── */
.wcrel-btn {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.wcrel-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
    transform: scale(1.08);
}

/* ── Dots ── */
.wcrel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.wcrel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.wcrel-dot.active {
    background: #333;
    transform: scale(1.3);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .wcrel-track { --wcrel-cols: 3 !important; }
}

@media (max-width: 768px) {
    .wcrel-track { --wcrel-cols: 2 !important; }
    .wcrel-titulo { font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .wcrel-track { --wcrel-cols: 1 !important; }
    .wcrel-wrapper { padding: 0 8px; }
}
