/**
 * Estilos del Wizard de Ganado
 */

/* Container principal */
.ebiolab-wizard {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Loading overlay */
#ebiolab-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bar */
.ebiolab-progress {
    display: flex;
    justify-content: space-between;
    margin: 0px;
    position: relative;
}

.ebiolab-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #ddd;
    z-index: 0;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    font-weight: bold;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.progress-step.active .step-number {
    background: #2E75B6;
    color: white;
    box-shadow: 0 2px 10px rgba(46, 117, 182, 0.3);
}

.step-label {
    display: block;
    font-size: 14px;
    color: #666;
}

.progress-step.active .step-label {
    color: #2E75B6;
    font-weight: 600;
}

/* Steps */
.ebiolab-wizard-step {
    display: none;
}

.ebiolab-wizard-step.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ebiolab-wizard-step h2 {
    color: #2E75B6;
    font-size: 24px;
    margin-bottom: 10px;
}

.step-description {
    color: #666;
    font-size: 16px;
    margin: 0px;
    padding: 0px;
}

/* Selection counter */
.container-description{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0px;
}

#selection-counter {
    margin: 0px;
    padding: 0px;
    background: #f0f7ff;
    border-radius: 8px;
    text-align: center;
}

#selection-counter .counter {
    font-size: 18px;
    color: #666;
}

#selection-counter .counter.active {
    color: #2E75B6;
    font-weight: 600;
}

/* Carousel Wrapper and Navigation */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    padding: 15px 30px;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: #2E75B6;
    color: white;
    border-color: #2E75B6;
}

.carousel-prev {
    left: -20px;
}

.carousel-next {
    right: -20px;
}

/* Donadoras grid (Carousel) */
.donadoras-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 10px 5px 15px 5px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Hide scrollbar for cleaner look with arrows */
.donadoras-grid::-webkit-scrollbar {
    display: none;
}
.donadoras-grid {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.ebiolab-donadora-card {
    flex: 0 0 275px;
    scroll-snap-align: start;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.ebiolab-donadora-card:hover {
    border-color: #2E75B6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.img-donadora-wrap {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.ebiolab-donadora-card .img-donadora {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    transition: transform 0.3s ease;
}

.img-donadora-wrap:hover .img-donadora {
    transform: scale(1.04);
}

.img-donadora-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 8px;
}

.img-donadora-wrap:hover .img-donadora-overlay {
    opacity: 1;
}

.img-donadora-eye {
    width: 48px;
    height: 48px;
    color: #fff;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* ── Modal ─────────────────────────────────────────────────────── */
.ebiolab-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.ebiolab-modal.open {
    display: flex;
}

body.ebiolab-modal-open {
    overflow: hidden;
}

.ebiolab-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.ebiolab-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 24px;
    width: min(680px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ebiolab-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    transition: color 0.2s;
}

.ebiolab-modal-close:hover {
    color: #333;
}

.ebiolab-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
    padding-right: 32px;
}

/* Carousel del modal */
.ebiolab-modal-carousel {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-height: 260px;
    display: flex;
    align-items: center;
}

.ebiolab-modal-slides {
    width: 100%;
}

.ebiolab-modal-slide {
    display: none;
}

.ebiolab-modal-slide.active {
    display: block;
}

.ebiolab-modal-slide img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

.ebiolab-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ebiolab-modal-nav:hover {
    background: #fff;
}

.ebiolab-modal-prev { left: 10px; }
.ebiolab-modal-next { right: 10px; }

/* Descripción del modal */
.ebiolab-modal-descripcion:not(:empty) {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

.ebiolab-modal-descripcion p {
    margin: 0;
}

/* Video del modal */
.ebiolab-modal-video:not(:empty) {
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.ebiolab-modal-video video {
    width: 100%;
    max-height: 320px;
    display: block;
}

.ebiolab-donadora-card h3 {
    color: #333;
    font-size: 18px;
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #c7c7c7;
}

.marcar-como-principal-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.marcar-como-principal-label:hover {
    color: #2E75B6;
}

.marcar-como-principal-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2E75B6;
    cursor: pointer;
    margin: 0;
}

.ebiolab-fechas-disponibles {
    margin-top: 8px;
}

/* Select2 dentro de la card de donadora */
.ebiolab-donadora-card .select2-container {
    width: 100% !important;
}

.ebiolab-donadora-card .select2-selection--multiple {
    border: 1px solid #d0d7de !important;
    border-radius: 8px !important;
    min-height: 42px !important;
    padding: 0px 4px !important;
    cursor: pointer !important;
}

.ebiolab-donadora-card .select2-selection--multiple:focus,
.ebiolab-donadora-card .select2-container--open .select2-selection--multiple {
    border-color: #2E75B6 !important;
    box-shadow: 0 0 0 3px rgba(46, 117, 182, 0.15) !important;
    outline: none !important;
}

.ebiolab-donadora-card .select2-selection__choice {
    background-color: #e8f0fa !important;
    border: 1px solid #b3cce8 !important;
    border-radius: 5px !important;
    color: #2E75B6 !important;
    font-size: 13px !important;
    padding: 2px 8px !important;
}

.ebiolab-donadora-card .select2-selection__choice__remove {
    color: #2E75B6 !important;
    margin-right: 5px !important;
}

/* Dropdown adjunto al body — con dropdownParent:body el dropdown NO es
   descendiente de .select2-container--open, así que hay que apuntarlo directo */
.select2-dropdown {
    z-index: 99999 !important;
}

.select2-dropdown--below {
    margin-top: 2px;
}

.select2-dropdown--above {
    margin-bottom: 2px;
}

/* Opciones del dropdown con checkbox */
.select2-fecha-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px;
    font-size: 14px;
    color: #333;
}

.select2-fecha-label {
    flex: 1;
    font-weight: 500;
    color: inherit;
}

.select-costo-oportunidad {
    color: #2E75B6;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    margin-left: auto;
}

.select2-fecha-check {
    width: 16px;
    height: 16px;
    accent-color: #2E75B6;
    flex-shrink: 0;
    pointer-events: none;
}

.select2-results__option--highlighted .select2-fecha-option {
    color: #fff;
}

.select2-results__option--highlighted .select2-fecha-label {
    color: #fff;
}

.select2-results__option--highlighted .select-costo-oportunidad {
    color: #c8dff5;
}

.select2-results__option--highlighted .select2-fecha-check {
    accent-color: #fff;
}

.select2-results__option--selected .select2-fecha-check {
    accent-color: #2E75B6;
}

/* Total section */
.total-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px;
    margin: 10px 0;
}

.total-breakdown {
    font-size: 16px;
}

.total-breakdown .item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.total-breakdown .item.subtotal {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
}

.total-breakdown .item.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 3px solid #2E75B6;
    font-size: 20px;
    color: #2E75B6;
}

/* Receptoras */
.receptoras-option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.receptoras-option label {
    display: block;
    font-size: 18px;
    cursor: pointer;
    margin-bottom: 20px;
}

.receptoras-option input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#receptoras-details {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

#receptoras-details h4 {
    color: #2E75B6;
    margin-bottom: 15px;
}

.costos-list {
    list-style: none;
    padding: 0;
}

.costos-list > li {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.costos-list > li:last-child {
    border-bottom: none;
}

.costos-list ul {
    margin-top: 10px;
    padding-left: 20px;
    font-size: 14px;
    color: #666;
}

/* Resumen */
.resumen-section {
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.resumen-section h3 {
    color: #2E75B6;
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.resumen-section ul {
    list-style: none;
    padding: 0;
}

.resumen-section ul li {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.resumen-section ul li small {
    color: #666;
    font-size: 13px;
}

.desglose-costos .item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Tabla de cuotas */
.ebiolab-table {
    width: 100%;
    border-collapse: collapse;
}

.ebiolab-table thead {
    background: #2E75B6;
    color: white;
}

.ebiolab-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.ebiolab-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.ebiolab-table tbody tr:hover {
    background: #f8f9fa;
}

.ebiolab-table td {
    padding: 12px;
}

.ebiolab-table .text-right {
    text-align: right;
}

/* Opciones de pago */
.pago-options {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.pago-option {
    display: flex;
    align-items: start;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.pago-option:hover {
    border-color: #2E75B6;
    background: #f8f9fa;
}

.pago-option input[type="radio"] {
    margin-right: 15px;
    margin-top: 5px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2E75B6;
}

.pago-option .option-content {
    flex: 1;
}

.pago-option strong {
    display: block;
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
}

.pago-option p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.monto-info {
    padding: 20px;
    background: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #2E75B6;
}

.monto-info p {
    margin: 5px 0;
}

.monto-info .small-text {
    font-size: 13px;
    color: #666;
}

/* Navigation buttons */
.wizard-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.ebiolab-wizard-prev,
.ebiolab-wizard-next,
#finalizar-compra {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.ebiolab-wizard-prev {
    background: #f0f0f0;
    color: #333;
}

.ebiolab-wizard-prev:hover {
    background: #e0e0e0;
}

.ebiolab-wizard-next,
#finalizar-compra {
    background: #2E75B6;
    color: white;
    flex: 1;
    max-width: 300px;
    margin-left: auto;
}

.ebiolab-wizard-next:hover,
#finalizar-compra:hover {
    background: #1e5a8f;
    box-shadow: 0 4px 12px rgba(46, 117, 182, 0.3);
}

.ebiolab-wizard-next:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-primary {
    background: #28a745;
}

.btn-primary:hover {
    background: #218838;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Formulario datos del comprador */
.comprador-form {
    max-width: 480px;
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comprador-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comprador-field label {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.comprador-field input {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color .2s;
}

.comprador-field input:focus {
    border-color: #2E75B6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46,117,182,.15);
}

/* No data message */
.ebiolab-no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .donadoras-grid .ebiolab-donadora-card {
        flex: 0 0 90%;
    }

    .ebiolab-progress::before {
        display: none;
    }

    .wizard-navigation {
        flex-direction: column;
    }

    .ebiolab-wizard-next,
    #finalizar-compra {
        max-width: 100%;
        margin-left: 0;
    }
}


/* ── Flujograma de pagos ── */
.fpc-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
    border: 1px solid #bbb;
    border-radius: 6px;
}

.fpc-table {
    border-collapse: collapse;
    min-width: 100%;
    font-size: 12px;
    white-space: nowrap;
    background: #fff;
}

/* Cabecera años */
.fpc-table thead tr:first-child th {
    background: #222;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 6px 10px;
    border: 1px solid #111;
}

.fpc-col-concepto {
    background: #333 !important;
    color: #fff !important;
    min-width: 240px;
    text-align: left !important;
    font-weight: 700;
    font-size: 12px !important;
    padding: 6px 12px !important;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Cabecera meses */
.fpc-table thead tr:last-child th.fpc-mes {
    background: #e8e8e8;
    color: #222;
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    padding: 5px 8px;
    border: 1px solid #ccc;
    min-width: 72px;
}

/* Filas de conceptos */
.fpc-table tbody tr:nth-child(even) {
    background: #f5f5f5;
}
.fpc-table tbody tr:nth-child(odd) {
    background: #fff;
}
.fpc-table tbody tr:hover {
    background: #ebebeb;
}

.fpc-label {
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
    font-size: 12px;
    font-weight: 500;
    color: #222;
    padding: 6px 12px;
    border: 1px solid #ddd;
    min-width: 240px;
}

.fpc-valor {
    text-align: right;
    padding: 6px 10px;
    color: #222;
    border: 1px solid #ddd;
}

.fpc-vacio {
    border: 1px solid #ddd;
    background: #fafafa;
}

/* Fila PAGO MENSUAL */
.fpc-row-total {
    border-top: 2px solid #333;
}

.fpc-label-total {
    background: #333 !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 12px !important;
}

.fpc-total {
    text-align: right;
    padding: 6px 10px;
    font-weight: 700;
    background: #e0e0e0;
    color: #111;
    border: 1px solid #ccc;
}

/* ── Ajustes de espaciado de la página del wizard ── */
.page-template-default:has(.ebiolab-wizard) main.wp-block-group,
.page-template-default:has(.ebiolab-wizard) .wp-block-group.has-global-padding,
.page-template-default:has(.ebiolab-wizard) .is-layout-constrained {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Fallback para navegadores sin soporte a :has() */
body.page:has(.ebiolab-wizard) .entry-content,
body.page:has(.ebiolab-wizard) .wp-block-post-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ajuste del propio container del wizard */
.ebiolab-wizard {
    margin-top: 0;
}

.select2-container .select2-search--inline .select2-search__field{
    font-size: 75%;
}

.wp-block-woocommerce-customer-account, .wp-block-woocommerce-mini-cart{
    display: none !important;
}

.wp-block-post-title{
    text-align: center;
}
