/* ─────────────────────────────────────────────
   CarrouselProducts – Estilos
   ───────────────────────────────────────────── */

.cp-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

/* ── Título ── */
.cp-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 20px;
    text-align: center;
    letter-spacing: 0.01em;
}

/* ── Fila con botones + track ── */
.cp-carousel-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Contenedor con overflow hidden ── */
.cp-track-container {
    flex: 1;
    overflow: hidden;
}

/* ── Pista de tarjetas ── */
.cp-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

/* ── Tarjeta individual ── */
.cp-card {
    flex: 0 0 calc(100% / 4);
    box-sizing: border-box;
    padding: 0 8px;
}

@media (max-width: 1024px) {
    .cp-card { flex: 0 0 calc(100% / 3); }
}

@media (max-width: 768px) {
    .cp-card { flex: 0 0 calc(100% / 2); }
}

@media (max-width: 480px) {
    .cp-card { flex: 0 0 100%; }
}

/* ── Enlace de tarjeta ── */
.cp-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cp-card-link:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ── Imagen ── */
.cp-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f4f6;
}

.cp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.cp-card-link:hover .cp-card-image img {
    transform: scale(1.05);
}

/* ── Badge de oferta ── */
.cp-badge-sale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 1;
}

/* ── Cuerpo de la tarjeta ── */
.cp-card-body {
    padding: 12px 14px 16px;
}

.cp-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
    color: #1f2937;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Precios (salida de get_price_html) ── */
.cp-card-price {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cp-card-price .amount {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.cp-card-price del {
    font-size: 0.85rem;
    font-weight: 400;
    color: #9ca3af;
}

.cp-card-price del .amount {
    font-size: 0.85rem;
    font-weight: 400;
    color: #9ca3af;
}

.cp-card-price ins {
    text-decoration: none;
}

.cp-card-price ins .amount {
    color: #e74c3c;
}

/* ── Botones de navegación ── */
.cp-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    padding: 0;
    z-index: 1;
}

.cp-btn:hover:not(:disabled) {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}

.cp-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ── Error ── */
.cp-error {
    color: #b91c1c;
    font-style: italic;
}
@media (max-width: 728px) {
.cp-btn {
    width: 30px;
    height: 30px;
}
}