
/* === Modal Transitions & Animations Patch === */

/* General Modal Overlays (Hide by default, use opacity/pointer-events instead of display:none) */
.cart-modal-overlay,
.site-modal-overlay,
.cal-modal-overlay,
.lightbox-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex !important; /* Keep flex always to allow transform animations on children */
}

/* Active State for Overlays */
.cart-modal-overlay.active,
.site-modal-overlay.active,
.cal-modal-overlay.active,
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Cart Modal Slide Animation */
.cart-modal {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: none; /* Override old keyframe */
}
.cart-modal-overlay.active .cart-modal {
    transform: translateX(0);
}

/* Site Details & Calendar Modal Pop Animation */
.site-modal-content,
.cal-modal-content {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-modal-overlay.active .site-modal-content,
.cal-modal-overlay.active .cal-modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Lightbox Image Scale Animation */
.lightbox-image {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.lightbox-image.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Lightbox Indicators */
.lightbox-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}
.lightbox-indicators .indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}
.lightbox-indicators .indicator.active {
    background: white;
    transform: scale(1.2);
}

/* Site Details Image Crossfade */
#detailsImg1, #detailsImg2 {
    transition: opacity 0.3s ease;
}
#detailsImg1.fading, #detailsImg2.fading {
    opacity: 0;
}

/* Directory Filter Fade Animation */
.sites-container {
    transition: opacity 0.3s ease;
}
.sites-container.fading-out {
    opacity: 0;
}

/* === Landing dinámica (Visual Group) — ajustes sobre el prototipo === */

/* Fondo base del hero mientras carga la imagen destacada (PRO-244) */
.hero-item {
    background-color: #1a1d24;
}

/* Botón para quitar un sitio del carrito */
.cart-item {
    position: relative;
    align-items: center;
}
.cart-item-remove {
    margin-left: auto;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
    transition: color 0.2s;
}
.cart-item-remove:hover {
    color: #dc3545;
}

/* Categoría del sitio bajo el ID clicable (PRO-248) */
.card-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #dc3545;
    font-weight: 600;
    margin: 0.15rem 0 0.35rem;
}
.details-category {
    display: inline-block;
    margin-left: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

/* === Calendarios de disponibilidad real: 6 meses (colchón opción b) === */
.cal-day-cell.past {
    background: #f1f3f5;
    color: #ced4da;
    text-decoration: line-through;
}
.legend-color.past {
    background: #f1f3f5;
    border: 1px solid #ced4da;
}

/* Carrusel de calendario: uno o varios meses visibles con flechas y transición sutil. */
.calendar-carousel {
    max-width: 340px;
    margin: 0 auto;
}
/* En el modal de detalles mostramos 2 meses: usar el ancho disponible. */
#detailsCalendars .calendar-carousel {
    max-width: 720px;
}
.calendar-months {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
#detailsCalendars .calendar-months {
    grid-template-columns: 1fr 1fr;
}
.calendar-month-name {
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}
/* Con un solo mes visible, el label superior ya indica el mes: ocultar subtítulo. */
.calendar-months.is-single .calendar-month-name {
    display: none;
}
/* En pantallas chicas, aunque sean 2 meses, se apilan en una columna. */
@media (max-width: 768px) {
    #detailsCalendars .calendar-months {
        grid-template-columns: 1fr;
    }
}
.calendar-carousel .calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.calendar-carousel .cal-month {
    font-weight: 700;
    font-size: 1rem;
    color: #231833;
    text-transform: capitalize;
}
.calendar-carousel .cal-nav {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border, #e6e5e6);
    border-radius: 50%;
    background: #fff;
    color: #dc3545;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}
.calendar-carousel .cal-nav:hover:not(:disabled) {
    background: #fdeaec;
}
.calendar-carousel .cal-nav:disabled {
    opacity: 0.35;
    cursor: default;
}
.calendar-carousel .calendar-grid {
    will-change: transform, opacity;
}

/* Transiciones sutiles al cambiar de mes */
.cal-slide-out-left  { opacity: 0; transform: translateX(-10px); transition: opacity .14s ease, transform .14s ease; }
.cal-slide-out-right { opacity: 0; transform: translateX(10px);  transition: opacity .14s ease, transform .14s ease; }
.cal-slide-in-right  { animation: calInRight .22s ease; }
.cal-slide-in-left   { animation: calInLeft .22s ease; }
@keyframes calInRight { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes calInLeft  { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

/* === Feedback Modal (resultado del envío de cotización) === */
.feedback-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 17, 21, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.feedback-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.feedback-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 2.25rem 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(15, 17, 21, 0.35);
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}
.feedback-overlay.active .feedback-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.feedback-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.25rem;
}
.feedback-icon svg {
    width: 100%;
    height: 100%;
    display: none;
}
/* Mostrar el ícono según el tipo de resultado */
.feedback-overlay.is-success .fb-check { display: block; }
.feedback-overlay.is-error .fb-cross { display: block; }

/* Check de éxito (verde) */
.fb-check-circle {
    stroke: #2ecc71;
    stroke-width: 3;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
}
.fb-check-mark {
    stroke: #2ecc71;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
}
.feedback-overlay.active.is-success .fb-check-circle {
    animation: fbStroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.feedback-overlay.active.is-success .fb-check-mark {
    animation: fbStroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

/* Cross de error (rojo de marca) */
.fb-cross-circle {
    stroke: #dc3545;
    stroke-width: 3;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
}
.fb-cross-line {
    stroke: #dc3545;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
}
.feedback-overlay.active.is-error .fb-cross-circle {
    animation: fbStroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.feedback-overlay.active.is-error .fb-cross-line {
    animation: fbStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}
@keyframes fbStroke { to { stroke-dashoffset: 0; } }

.feedback-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #231833;
    margin: 0 0 0.5rem;
}
.feedback-message {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #5c5665;
    margin: 0 0 1.5rem;
}
.feedback-message strong { color: #231833; }

.feedback-btn {
    display: inline-block;
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}
.feedback-btn:hover { background: #c02b3a; }
.feedback-btn:active { transform: scale(0.97); }

/* === Skeleton loader del catálogo (sensación de carga) === */
.skeleton-card {
    /* Anula la animación de aparición de .site-card para que el shimmer se vea de una */
    opacity: 1 !important;
    transform: none !important;
    pointer-events: none;
    overflow: hidden;
}
.skeleton {
    position: relative;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}
/* Barrido de brillo (shimmer) */
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: skeletonShimmer 1.3s infinite;
}
@keyframes skeletonShimmer {
    100% { transform: translateX(100%); }
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 0;
}
.skeleton-line {
    height: 12px;
    margin: 0.55rem 0;
}
.skeleton-title { width: 45%; height: 18px; margin-top: 0.9rem; }
.skeleton-badge { width: 35%; height: 12px; background: #f3d0d4; }
.skeleton-text { width: 80%; }
.skeleton-text.short { width: 55%; }
.skeleton-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}
.skeleton-pill { width: 70px; height: 26px; border-radius: 999px; }
.skeleton-pill.wide { width: 96px; }

/* Respeta usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .skeleton::after { animation: none; }
}
