/* ============================================
   ESTILOS GLOBALES PARA M├ôVIL
   ============================================ */

/* Bloquea scroll lateral general */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Anular padding de contenedores padres para scroller horizontal */
.professional-categories,
#espacio-profesional .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

#espacio-profesional {
    padding: 0 !important;
    margin: 0 !important;
}

/* Centra toda la app en un ancho de m├│vil */
.main-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    overflow-x: hidden;
}

/* Todas las secciones centradas */
section.lj-section {
    max-width: 420px;
    margin: 0 auto;
    padding: 0.25rem 0 !important;
    text-align: center;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ============================================
   SECTION CONTAINER (Nuevo dise├▒o)
   ============================================ */
.section-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0.5rem 0.75rem !important;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .main-wrapper,
    section.lj-section,
    .section-container {
        max-width: 600px;
    }
}

@media (min-width: 1024px) {
    .main-wrapper,
    section.lj-section,
    .section-container {
        max-width: 800px;
    }
}

/* ============================================
   CONTENEDOR HORIZONTAL: SOLO estos se deslizan
   ============================================ */
.lj-horizontal-wrapper,
.horizontal-strip-wrapper {
    position: relative;
    width: 100%;
}

.lj-horizontal,
.horizontal-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.5rem 0 1rem 0 !important;
    margin: 0 !important;
    width: 100% !important;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.lj-horizontal::-webkit-scrollbar,
.horizontal-strip::-webkit-scrollbar {
    display: none;
}

/* Scrollbar oculto también en desktop - solo usar botones laterales */
@media (min-width: 768px) {
    .lj-horizontal,
    .horizontal-strip {
        scrollbar-width: none; /* Firefox */
        gap: 1.5rem;
        padding: 0.5rem 1rem 1rem 1rem !important;
    }
    
    .lj-horizontal::-webkit-scrollbar,
    .horizontal-strip::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
}

/* Cada card dentro del carrusel */
.lj-horizontal > *,
.horizontal-strip > * {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: calc(100vw - 1rem) !important;
    min-width: calc(100vw - 1rem) !important;
    max-width: calc(100vw - 1rem) !important;
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
    box-sizing: border-box !important;
}

/* Asegurar que las tarjetas no se desborden */
.category-card-horizontal,
.professional-card-horizontal,
.plan-card-horizontal {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Ancho específico para tarjetas de planes en móvil */
.lj-horizontal > .plan-card-horizontal {
    width: calc(100vw - 2rem) !important;
    min-width: calc(100vw - 2rem) !important;
    max-width: calc(100vw - 2rem) !important;
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
}

/* ├Ültimo elemento con margen derecho para permitir scroll completo */
.horizontal-strip > :last-child,
.lj-horizontal > :last-child:not(.plan-card-horizontal) {
    margin-right: 0.5rem !important;
}

.horizontal-strip > :first-child,
.lj-horizontal > :first-child:not(.plan-card-horizontal) {
    margin-left: 0.5rem !important;
}

.lj-horizontal > .plan-card-horizontal:first-child {
    margin-left: 0.5rem !important;
}

.lj-horizontal > .plan-card-horizontal:last-child {
    margin-right: 0.5rem !important;
}

@media (min-width: 420px) {
    .lj-horizontal > *,
    .horizontal-strip > * {
        width: calc(100vw - 1rem) !important;
        min-width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
        margin-left: 0.25rem !important;
        margin-right: 0.25rem !important;
    }
    
    .horizontal-strip > :last-child,
    .lj-horizontal > :last-child {
        margin-right: 0.5rem !important;
    }
    
    .horizontal-strip > :first-child,
    .lj-horizontal > :first-child {
        margin-left: 0.5rem !important;
    }
}

@media (min-width: 768px) {
    .lj-horizontal,
    .horizontal-strip {
        padding: 0.5rem 0 1rem 0 !important;
    }
    
    .lj-horizontal > *,
    .horizontal-strip > * {
        min-width: 280px !important;
        max-width: 300px !important;
        width: auto !important;
        margin-left: 1rem !important;
        margin-right: 1rem !important;
    }
    
    /* Tarjetas de planes más pequeñas en desktop */
    .lj-horizontal > .plan-card-horizontal {
        min-width: 320px !important;
        max-width: 350px !important;
        width: 350px !important;
    }
    
    /* Asegurar que tarjetas de categorías y servicios tengan el mismo tamaño en desktop */
    .lj-horizontal > .category-card-horizontal,
    .lj-horizontal > .service-card-horizontal {
        min-width: 280px !important;
        max-width: 300px !important;
        width: 300px !important;
    }
    
    .horizontal-strip > :last-child,
    .lj-horizontal > :last-child {
        margin-right: 1rem !important;
    }
    
    .horizontal-strip > :first-child,
    .lj-horizontal > :first-child {
        margin-left: 1rem !important;
    }
}

/* Centrar visualmente solo cuando hay una tarjeta */
.lj-horizontal[data-count="1"],
.horizontal-strip[data-count="1"] {
    justify-content: center;
}

/* Cuando hay 2 o m├ís, alinear a la izquierda para permitir scroll */
.horizontal-strip[data-count="2"],
.horizontal-strip[data-count]:not([data-count="1"]),
.lj-horizontal[data-count="2"],
.lj-horizontal[data-count]:not([data-count="1"]) {
    justify-content: flex-start !important;
}

/* ============================================
   HEADER DEL HORIZONTAL SCROLLER
   ============================================ */
.lj-section-header {
    padding: 0 0.5rem;
    margin-bottom: 0.25rem !important;
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .lj-section-header {
        padding: 0 2rem;
    }
}

.lj-section-title {
    font-size: 1.125rem !important;
    font-weight: 600;
    color: #881337; /* rose-900 */
    margin: 0 auto 0.25rem auto !important;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: 0 0.25rem;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3 !important;
}

@media (min-width: 768px) {
    .lj-section-title {
        font-size: 1.25rem !important;
        padding: 0;
    }
}

.lj-section-subtitle {
    font-size: 0.875rem;
    color: rgba(159, 18, 57, 0.8); /* rose-700/80 */
    margin: 0;
}

/* ============================================
   PROFESSIONAL CARD HORIZONTAL
   ============================================ */
.professional-card-horizontal,
.card-horizontal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 192, 203, 0.3); /* rose-100 */
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.professional-card-horizontal img,
.card-horizontal img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    background: #fdf2f8; /* rose-50 - fondo para imágenes que no llenan el espacio */
}

.professional-card-horizontal .placeholder-image,
.card-horizontal .placeholder-image {
    width: 100%;
    height: 200px;
    border-radius: 0.75rem;
    background: #fdf2f8; /* rose-50 */
    margin-bottom: 0.75rem;
}

.professional-card-horizontal h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #881337; /* rose-900 */
    margin: 0 0 0.25rem 0;
    text-align: center;
}

.professional-card-horizontal .professional-specialty {
    font-size: 0.75rem;
    color: #e0909f; /* pastel rosa */
    margin: 0 0 0.25rem 0;
    text-align: center;
}

.professional-card-horizontal .professional-subspecialty {
    font-size: 0.75rem;
    color: rgba(159, 18, 57, 0.8); /* rose-700/80 */
    margin: 0 0 0.75rem 0;
    text-align: center;
}

.professional-card-horizontal .professional-buttons {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.professional-card-horizontal .professional-btn {
    width: 100%;
    background: #e8a08a; /* pastel terracota */
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.professional-card-horizontal .professional-btn:hover {
    background: #d87a8f; /* pastel rosa */
}

.professional-card-horizontal .professional-btn-secondary {
    background: transparent;
    color: #881337; /* rose-900 */
    border: 1px solid #881337;
}

.professional-card-horizontal .professional-btn-secondary:hover {
    background: #881337;
    color: white;
}

/* ============================================
   SERVICE CARD HORIZONTAL
   ============================================ */
.service-card-horizontal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 192, 203, 0.3); /* rose-100 */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box !important;
}

.service-card-horizontal h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #881337; /* rose-900 */
    margin: 0 0 0.5rem 0;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.service-card-horizontal p {
    font-size: 0.875rem;
    color: rgba(159, 18, 57, 0.8); /* rose-700/80 */
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

/* ============================================
   WORKSHOP CARD HORIZONTAL
   ============================================ */
.workshop-card-horizontal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 192, 203, 0.3); /* rose-100 */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box !important;
}

.workshop-card-horizontal img,
.workshop-card-horizontal .placeholder-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    background: #fdf2f8; /* rose-50 */
}

.workshop-card-horizontal .placeholder-image {
    background: #fdf2f8; /* rose-50 */
}

.workshop-card-horizontal h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #881337; /* rose-900 */
    margin: 0 0 0.5rem 0;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.workshop-card-horizontal .workshop-description {
    font-size: 0.875rem;
    color: rgba(159, 18, 57, 0.8); /* rose-700/80 */
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workshop-card-horizontal .workshop-meta {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: rgba(159, 18, 57, 0.7);
}

.workshop-card-horizontal .workshop-date,
.workshop-card-horizontal .workshop-time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.workshop-card-horizontal .workshop-date i,
.workshop-card-horizontal .workshop-time i {
    color: #e8a08a; /* pastel terracota */
    font-size: 0.875rem;
}

.workshop-card-horizontal .workshop-btn {
    width: 100%;
    background: #e8a08a; /* pastel terracota */
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
}

.workshop-card-horizontal .workshop-btn:hover {
    background: #d87a8f; /* pastel rosa */
}

.workshop-card-horizontal .workshop-btn i {
    font-size: 0.875rem;
}

/* ============================================
   PLAN CARD HORIZONTAL
   ============================================ */
.plan-card-horizontal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 192, 203, 0.3); /* rose-100 */
    padding: 0.75rem !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box !important;
    min-height: auto !important;
    height: auto !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.plan-card-horizontal h3 {
    font-size: 0.9375rem !important;
    font-weight: 600;
    color: #881337; /* rose-900 */
    margin: 0 0 0.5rem 0 !important;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100% !important;
    max-width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
}

.plan-card-horizontal .plan-subtitle {
    font-size: 0.8125rem !important;
    color: rgba(159, 18, 57, 0.8); /* rose-700/80 */
    margin-bottom: 0.625rem !important;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.plan-card-horizontal .plan-features {
    margin-bottom: 0.625rem !important;
    flex-grow: 0;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.plan-card-horizontal .plan-features p {
    font-size: 0.8125rem !important;
    color: rgba(159, 18, 57, 0.9);
    margin-bottom: 0.5rem !important;
    line-height: 1.4 !important;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    hyphens: auto;
}

.plan-card-horizontal .plan-price {
    font-size: 0.9375rem !important;
    font-weight: 600;
    color: #881337;
    margin-bottom: 0.625rem !important;
    text-align: center;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.plan-card-horizontal .plan-button {
    width: 100% !important;
    max-width: 100% !important;
    background: #e8a08a; /* pastel terracota */
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 0.625rem 1rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
    margin-top: 0;
    white-space: nowrap;
    box-sizing: border-box !important;
}

.plan-card-horizontal .plan-button:hover {
    background: #d87a8f; /* pastel rosa */
}

/* Estilos específicos para desktop - tarjetas de planes más pequeñas */
@media (min-width: 768px) {
    .plan-card-horizontal {
        padding: 1rem !important;
    }
    
    .plan-card-horizontal h3 {
        font-size: 1rem !important;
        margin-bottom: 0.625rem !important;
    }
    
    .plan-card-horizontal .plan-subtitle {
        font-size: 0.875rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .plan-card-horizontal .plan-features {
        margin-bottom: 0.75rem !important;
    }
    
    .plan-card-horizontal .plan-features p {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.5 !important;
    }
    
    .plan-card-horizontal .plan-price {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .plan-card-horizontal .plan-button {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.875rem !important;
    }
}

/* ============================================
   CATEGORY CARD HORIZONTAL
   ============================================ */
.category-card-horizontal {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 192, 203, 0.3); /* rose-100 */
    padding: 0.875rem !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
}

.category-card-horizontal .category-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fdf2f8; /* rose-50 */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.category-card-horizontal .category-icon i {
    font-size: 2rem;
    color: #e8a08a; /* pastel terracota */
}

.category-card-horizontal h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #881337; /* rose-900 */
    margin: 0 0 0.5rem 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.category-card-horizontal p {
    font-size: 0.875rem;
    color: rgba(159, 18, 57, 0.8); /* rose-700/80 */
    margin: 0 0 1rem 0;
    line-height: 1.5;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.category-card-horizontal .btn {
    width: 100%;
    margin-top: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 9999px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.category-card-horizontal .btn-primary {
    background: #d87a8f; /* pastel rosa */
    color: white;
    border: none;
}

.category-card-horizontal .btn-primary:hover {
    background: #e0909f; /* pastel rosa más claro en hover */
}

/* ============================================
   LOADING Y EMPTY STATES
   ============================================ */
.professionals-loading,
.professionals-empty {
    padding: 2rem 1rem;
    text-align: center;
}

.professionals-loading h2,
.professionals-empty h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.professionals-loading p {
    font-size: 0.875rem;
    color: #666;
}

.professionals-empty-message {
    border-radius: 0.5rem;
    background: #fdf2f8; /* rose-50 */
    padding: 1rem;
    color: #9f1239; /* rose-800 */
    display: inline-block;
}

/* ============================================
   BOTONES DE NAVEGACIÓN HORIZONTAL (FLECHAS)
   ============================================ */
.scroll-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(232, 160, 138, 0.9); /* pastel terracota con opacidad */
    color: white;
    border: none;
    border-radius: 50%;
    display: none !important; /* OCULTO POR DEFECTO */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 1.2rem;
    line-height: 1;
    visibility: hidden !important; /* OCULTO POR DEFECTO */
}

.scroll-arrow-btn.visible {
    display: flex !important;
    visibility: visible !important;
}

.scroll-arrow-btn:hover {
    background: rgba(216, 122, 143, 0.95); /* pastel rosa */
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scroll-arrow-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.scroll-arrow-btn.scroll-left {
    left: -0.5rem !important;
}

.scroll-arrow-btn.scroll-right {
    right: -0.5rem !important;
}

/* Reglas más específicas para botones ocultos - MÁXIMA ESPECIFICIDAD */
.scroll-arrow-btn.hidden,
.scroll-arrow-btn.scroll-left.hidden,
.scroll-arrow-btn.scroll-right.hidden,
button.scroll-arrow-btn.hidden,
button.scroll-arrow-btn.scroll-left.hidden,
button.scroll-arrow-btn.scroll-right.hidden,
.scroll-arrow-btn[hidden],
button.scroll-arrow-btn[hidden] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.scroll-arrow-btn.scroll-left.hidden,
button.scroll-arrow-btn.scroll-left.hidden,
.scroll-arrow-btn.scroll-left[hidden] {
    position: absolute !important;
    left: -9999px !important;
    right: auto !important;
}

.scroll-arrow-btn.scroll-right.hidden,
button.scroll-arrow-btn.scroll-right.hidden,
.scroll-arrow-btn.scroll-right[hidden] {
    position: absolute !important;
    right: -9999px !important;
    left: auto !important;
}

@media (min-width: 768px) {
    .scroll-arrow-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .scroll-arrow-btn.scroll-left {
        left: -2rem !important;
    }
    
    .scroll-arrow-btn.scroll-right {
        right: -1.25rem !important;
    }
}
