/* ==========================================================
   CP Casos Antes/Después — estilos front (prefijo .cp-cad-)
   ========================================================== */

.cp-cad-section {
    /* Fondo transparente: hereda el del blog */
    background: transparent;
    position: relative;
    padding: 2.5rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cp-cad-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* Header */
.cp-cad-header { text-align: center; margin-bottom: 2.5rem; }
.cp-cad-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3c6e71, #2d5457);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}
.cp-cad-title {
    font-size: 2rem;
    font-weight: 700;
    color: #3c6e71;
    margin: 0 0 1rem;
    line-height: 1.2;
}
.cp-cad-subtitle {
    font-size: 1.1rem;
    color: #404040;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Carousel */
.cp-cad-carousel-wrapper { position: relative; max-width: 600px; margin: 0 auto; }

/* Borde + sombra estilo Google Maps alrededor del carrusel */
.cp-cad-overflow {
    overflow: hidden;
    border: 3px solid #3C6E71;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(60, 110, 113, 0.15),
                0 8px 20px rgba(60, 110, 113, 0.2),
                0 20px 50px rgba(60, 110, 113, 0.25);
    transform: translateY(-2px);
    background: #fff;
}
.cp-cad-track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.cp-cad-slide { min-width: 100%; box-sizing: border-box; }

.cp-cad-card {
    background: #fff;
    overflow: hidden;
}

/* Before/After slider */
.cp-cad-ba {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    background: #f0f0f0;
}
.cp-cad-ba img { display: block; pointer-events: none; -webkit-user-drag: none; }
.cp-cad-ba-after { position: relative; z-index: 1; width: 100%; height: auto; }
.cp-cad-ba-before { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; object-fit: cover; }
.cp-cad-ba-clip { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; overflow: hidden; }

.cp-cad-ba-divider {
    position: absolute; top: 0; bottom: 0;
    width: 3px; background: #fff; z-index: 4;
    box-shadow: 0 0 12px rgba(0,0,0,0.35);
    transform: translateX(-50%);
    pointer-events: none;
}
.cp-cad-ba-handle {
    position: absolute; top: 50%; z-index: 5;
    transform: translate(-50%, -50%);
    width: 52px; height: 52px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    cursor: col-resize;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cp-cad-ba-handle:hover, .cp-cad-ba-handle:active {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}
.cp-cad-ba-handle svg { width: 24px; height: 24px; color: #3c6e71; flex-shrink: 0; }

.cp-cad-ba-label {
    position: absolute; top: 16px; z-index: 3;
    padding: 6px 16px; border-radius: 50px;
    font-size: 0.75rem; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
    pointer-events: none; color: #fff;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.cp-cad-ba-label-antes { left: 16px; background: rgba(0,0,0,0.55); }
.cp-cad-ba-label-despues { right: 16px; background: rgba(60,110,113,0.85); }

.cp-cad-ba-hint {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; z-index: 6;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; opacity: 1;
    transition: opacity 0.5s ease;
}
.cp-cad-ba-hint.hidden { opacity: 0; }
.cp-cad-ba-hint-text {
    background: rgba(60,110,113,0.85); color: #fff;
    padding: 10px 22px; border-radius: 50px;
    font-size: 0.8rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    animation: cp-cad-hint-pulse 2s ease-in-out infinite;
}
@keyframes cp-cad-hint-pulse {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.04); opacity: 1; }
}

/* Info panel */
.cp-cad-info { padding: 1.75rem 2rem; }
.cp-cad-info-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.cp-cad-caso-titulo {
    font-size: 1.3rem; font-weight: 700; color: #3c6e71;
    line-height: 1.3; margin: 0;
}
.cp-cad-duracion {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #3c6e71, #2d5457);
    color: #fff; padding: 5px 14px; border-radius: 50px;
    font-size: 0.8rem; font-weight: 600;
    white-space: nowrap; flex-shrink: 0;
}
.cp-cad-descripcion { color: #404040; font-size: 0.95rem; line-height: 1.65; margin: 0; }

/* Navigation arrows */
.cp-cad-nav {
    position: absolute; top: 38%; transform: translateY(-50%);
    z-index: 10; width: 48px; height: 48px; border-radius: 50%;
    background: #fff; border: 2px solid rgba(60,110,113,0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; color: #3c6e71; padding: 0;
}
.cp-cad-nav:hover {
    background: #3c6e71; color: #fff; border-color: #3c6e71;
    box-shadow: 0 6px 24px rgba(60,110,113,0.35);
    transform: translateY(-50%) scale(1.08);
}
.cp-cad-nav svg { width: 20px; height: 20px; }
.cp-cad-nav-prev { left: -24px; }
.cp-cad-nav-next { right: -24px; }

@media (max-width: 720px) {
    .cp-cad-nav-prev { left: 6px; }
    .cp-cad-nav-next { right: 6px; }
    .cp-cad-nav { width: 40px; height: 40px; top: 32%; }
    .cp-cad-nav svg { width: 18px; height: 18px; }
    .cp-cad-info { padding: 1.25rem; }
    .cp-cad-caso-titulo { font-size: 1.1rem; }
    .cp-cad-title { font-size: 1.6rem; }
}

/* Dots */
.cp-cad-dots { display: flex; justify-content: center; gap: 10px; margin-top: 1.75rem; }
.cp-cad-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #d9d9d9; border: none; cursor: pointer;
    transition: all 0.3s ease; padding: 0;
}
.cp-cad-dot.active {
    background: linear-gradient(135deg, #3c6e71, #2d5457);
    transform: scale(1.2); box-shadow: 0 2px 8px rgba(60,110,113,0.4);
}
.cp-cad-dot:hover:not(.active) { background: #b0c4c5; transform: scale(1.1); }

/* Counter */
.cp-cad-counter {
    text-align: center; margin-top: 1rem;
    font-size: 0.875rem; font-weight: 600; color: #3c6e71;
}

/* CTA */
.cp-cad-cta-wrap { text-align: center; margin-top: 2rem; }
.cp-cad-cta {
    background: linear-gradient(135deg, #3c6e71 0%, #2d5457 100%);
    color: #fff !important;
    padding: 1.1rem 2.5rem; border-radius: 50px;
    font-weight: 700; font-size: 1.05rem;
    text-transform: uppercase; letter-spacing: 0.5px;
    display: inline-flex; align-items: center; gap: 0.75rem;
    text-decoration: none !important;
    box-shadow: 0 10px 30px rgba(60,110,113,0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cp-cad-cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(60,110,113,0.5);
    color: #fff !important;
}
@media (max-width: 640px) {
    .cp-cad-cta { padding: 1rem 1.5rem; font-size: 0.95rem; width: 100%; justify-content: center; box-sizing: border-box; }
}
