/* =====================================================
   carousel-custom.css
   Carrusel estilo "Carnavales" para Yii2
   Ubicar en: web/css/carousel-custom.css
   ===================================================== */

/* ── Variables globales ── */
:root {
    --cc-bg: #fff;
    --cc-text: #1a1a2e;
    --cc-text-light: #555;
    --cc-accent: #2E7D32;          /* se sobreescribe por slide con --accent */
    --cc-radius-diamond: 20px;
    --cc-transition: 0.55s cubic-bezier(0.65, 0, 0.35, 1);
    --cc-shadow: 0 8px 32px rgba(0,0,0,0.13);
}

/* ── Contenedor principal ── */
.custom-carousel {
    position: relative;
    background: var(--cc-bg);
    overflow: hidden;
    user-select: none;
    top: 67px;
}

.carousel-track-wrapper {
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform var(--cc-transition);
    will-change: transform;
}

/* ── Slide ── */
.carousel-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 60px 80px;
    box-sizing: border-box;
    background: var(--cc-bg);
}

/* ── Lado izquierdo: texto ── */
.slide-content {
    flex: 0 0 380px;
    max-width: 380px;
    animation: slideInLeft 0.6s ease both;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

.slide-title {
    font-family: 'Montserrat', 'Trebuchet MS', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--cc-text);
    margin: 0 0 16px;
    line-height: 1.1;
}

.slide-text {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--cc-text-light);
    margin: 0 0 28px;
}

.slide-btn {
    display: inline-block;
    background: var(--accent, var(--cc-accent));
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 14px 40px;
    border-radius: 4px;
    min-width: 220px;
    text-align: center;
    transition: filter 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(155,39,175,0.25);
}

.slide-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
}

/* ── Lado derecho: imágenes en diamante ── */
.slide-images {
    position: relative;
    flex: 1;
    min-height: 340px;
    max-width: 580px;
    animation: slideInRight 0.6s ease both;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Forma diamante base ── */
.diamond {
    position: absolute;
    border-radius: var(--cc-radius-diamond);
    overflow: hidden;
    transform: rotate(45deg);
    box-shadow: var(--cc-shadow);
    background: #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Nitidez para todos los diamantes */
.diamond {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  image-rendering: -webkit-optimize-contrast; /* Safari */
  image-rendering: crisp-edges;               /* Firefox */
}

.diamond:hover {
    box-shadow: 0 14px 40px rgba(0,0,0,0.22);
    z-index: 5;
}

.diamond-inner {
  width: 141%;
  height: 141%;
  transform: rotate(-45deg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -70.5%;
  margin-left: -70.5%;
}

.diamond-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;  /* ← agrega esto */
  display: block;
}


.diamond-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);   /* fuerza aceleración GPU */
  will-change: transform;
}

/* ── Diamante principal (grande, centrado) ── */
.diamond--main {
    width: 260px;
    height: 260px;
    top: 67%;
    left: 60%;
    transform: rotate(45deg) translate(-50%, 0);
    margin-top: -130px;
    margin-left: -200px;
    z-index: 2;
}

/* ── Miniaturas ── */
.diamond--thumb {
    width: 120px;
    height: 120px;
    z-index: 3;
}

/* Posiciones de las 3 miniaturas (esquina sup-der, centro-der, inf-der) */
.diamond--thumb-1 {
    top: 10px;
    right: 50px;
}

.diamond--thumb-2 {
    top: 50%;
    right: 0;
    margin-top: -60px;
}

.diamond--thumb-3 {
    bottom: 10px;
    right: 50px;
}

.diamond--thumb-1 { top: 5px;   right: 40px; }
.diamond--thumb-2 { top: 50%;   right: -10px; margin-top: -70px; }
.diamond--thumb-3 { bottom: 5px; right: 40px; }


/* ── Flechas de navegación ── */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    color: var(--cc-text);
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.13);
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-arrow:hover {
    background: var(--accent, var(--cc-accent));
    color: #fff;
    transform: translateY(-50%) scale(1.08);
}

.carousel-arrow--prev { left: 18px; }
.carousel-arrow--next { right: 18px; }

/* ── Dots ── */
.carousel-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--cc-accent);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}

.carousel-dot.active,
.carousel-dot:hover {
    background: var(--cc-accent);
    transform: scale(1.25);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .carousel-slide {
        flex-direction: column;
        padding: 40px 24px;
        gap: 30px;
    }

    .slide-content {
        flex: unset;
        max-width: 100%;
        text-align: center;
    }

    .slide-images {
        width: 100%;
        min-height: 280px;
        max-width: 100%;
    }

    .diamond--main {
        width: 190px;
        height: 190px;
        margin-top: -95px;
        margin-left: -150px;
    }

    .diamond--thumb {
        width: 88px;
        height: 88px;
    }
}

@media (max-width: 480px) {
    .carousel-slide { padding: 30px 16px; }
    .slide-title { font-size: 1.7rem; }
    .diamond--main { width: 150px; height: 150px; }
    .diamond--thumb { width: 68px; height: 68px; }
}
