/* ============================================================
   Catálogo de Productos/Servicios — filtros, paginación,
   comparador, stepper de solicitud y calculadora con desglose.
   Reutiliza .pr-* (productos-modern.css) y variables --inst-*.
   ============================================================ */

/* ---------- Transición de tarjetas al filtrar/paginar ---------- */
.ct-item {
    transition: opacity 180ms ease;
}

.ct-item.ct-fading {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .ct-item { transition: none; }
}

/* ---------- Toolbar de catálogo (filtros + búsqueda) ---------- */
.ct-toolbar {
    background: #FFFFFF;
    border: 1px solid var(--inst-border);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.ct-search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.ct-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--inst-muted-fg);
}

.ct-search-box input {
    width: 100%;
    border: 1.5px solid var(--inst-border);
    border-radius: 100px;
    padding: 10px 16px 10px 38px;
    font-size: 14px;
    background: var(--inst-bg-light);
}

.ct-search-box input:focus {
    outline: none;
    border-color: var(--inst-accent);
    background: #FFFFFF;
}

.ct-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-filter-pill {
    background: var(--inst-bg-light);
    border: 1.5px solid var(--inst-border);
    color: var(--inst-primary);
    font-weight: 600;
    font-size: 13.5px;
    padding: 8px 16px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 150ms ease;
}

.ct-filter-pill:hover {
    border-color: var(--inst-accent);
}

.ct-filter-pill.active {
    background: var(--inst-primary);
    border-color: var(--inst-primary);
    color: #FFFFFF;
}

/* ---------- Catálogo: layout con categorías en columna vertical
   (en vez de pastillas horizontales, para dar cabida a muchas
   categorías sin desbordar el ancho) ---------- */
.ct-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 991px) {
    .ct-layout { grid-template-columns: 1fr; }
}

.ct-category-sidebar {
    background: #FFFFFF;
    border: 1px solid var(--inst-border);
    border-radius: 14px;
    padding: 22px;
    position: sticky;
    top: 24px;
}

@media (max-width: 991px) {
    .ct-category-sidebar { position: static; }
}

.ct-category-sidebar h4 {
    font-size: 15px;
    color: var(--inst-primary);
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}

.ct-category-sidebar h4::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 3px;
    background: var(--inst-accent);
    border-radius: 2px;
}

.ct-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ct-category-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--inst-bg-light);
    border: none;
    color: var(--inst-primary);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.ct-category-btn:hover {
    background: var(--inst-muted);
}

.ct-category-btn.active {
    background: var(--inst-primary);
    color: #FFFFFF;
}

.ct-category-btn span {
    background: var(--inst-muted);
    color: var(--inst-muted-fg);
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 100px;
    flex-shrink: 0;
}

.ct-category-btn.active span {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

@media (max-width: 991px) {
    .ct-category-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .ct-category-list li { flex-shrink: 0; }
    .ct-category-btn { white-space: nowrap; }
}

.ct-result-count {
    font-size: 13px;
    color: var(--inst-muted-fg);
    white-space: nowrap;
}

.ct-result-count strong {
    color: var(--inst-primary);
}

/* ---------- Tarjeta de catálogo (con checkbox comparar) ---------- */
.ct-card-compare {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 100px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--inst-primary);
    cursor: pointer;
}

.ct-card-compare input {
    accent-color: var(--inst-accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ---------- Paginación ---------- */
.ct-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
}

.ct-page-btn {
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid var(--inst-border);
    background: #FFFFFF;
    color: var(--inst-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.ct-page-btn:hover {
    border-color: var(--inst-accent);
}

.ct-page-btn.active {
    background: var(--inst-primary);
    border-color: var(--inst-primary);
    color: #FFFFFF;
}

.ct-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Bandeja flotante de comparación ---------- */
.ct-compare-tray {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    background: var(--inst-primary);
    color: #FFFFFF;
    padding: 16px 0;
    transform: translateY(100%);
    transition: transform 300ms ease;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

.ct-compare-tray.visible {
    transform: translateY(0);
}

.ct-compare-tray-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.ct-compare-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-compare-chip {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 100px;
    padding: 6px 12px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ct-compare-chip button {
    background: none;
    border: none;
    color: #FFFFFF;
    opacity: 0.7;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.ct-compare-chip button:hover {
    opacity: 1;
}

/* ---------- Modal comparador ---------- */
.ct-compare-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 68, 41, 0.85);
    z-index: 2500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.ct-compare-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ct-compare-modal {
    background: #FFFFFF;
    border-radius: 16px;
    max-width: 960px;
    width: 100%;
    padding: 30px;
    transform: scale(0.96) translateY(8px);
    transition: transform 240ms ease;
}

.ct-compare-overlay.open .ct-compare-modal {
    transform: scale(1) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .ct-compare-overlay { transition: none; }
    .ct-compare-modal { transition: none; }
}

.ct-compare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ct-compare-modal-header h3 {
    color: var(--inst-primary);
    margin: 0;
}

.ct-compare-table-wrap {
    overflow-x: auto;
}

.ct-compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.ct-compare-table th, .ct-compare-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--inst-border);
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

.ct-compare-table th {
    color: var(--inst-muted-fg);
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.ct-compare-table td:first-child, .ct-compare-table th:first-child {
    color: var(--inst-primary);
    font-weight: 700;
    white-space: nowrap;
}

.ct-compare-table td.ct-cell-rate {
    color: var(--inst-accent);
    font-weight: 700;
}

/* ---------- Stepper (solicitud paso a paso) ---------- */
.ct-stepper {
    display: flex;
    justify-content: space-between;
    max-width: 700px;
    margin: 0 auto 44px;
    position: relative;
}

.ct-stepper::before {
    content: "";
    position: absolute;
    top: 19px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: var(--inst-border);
    z-index: 0;
}

.ct-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.ct-step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid var(--inst-border);
    color: var(--inst-muted-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 200ms ease;
}

.ct-step.active .ct-step-circle {
    background: var(--inst-accent);
    border-color: var(--inst-accent);
    color: #FFFFFF;
}

.ct-step.done .ct-step-circle {
    background: var(--inst-primary);
    border-color: var(--inst-primary);
    color: #FFFFFF;
}

.ct-step span.ct-step-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--inst-muted-fg);
    text-align: center;
}

.ct-step.active span.ct-step-label {
    color: var(--inst-primary);
}

.ct-wizard-card {
    background: #FFFFFF;
    border: 1px solid var(--inst-border);
    border-radius: 16px;
    padding: 36px;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 12px 32px rgba(20, 83, 45, 0.06);
}

.ct-wizard-panel {
    display: none;
}

.ct-wizard-panel.active {
    display: block;
    animation: ct-fade-in 300ms ease;
}

@keyframes ct-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ct-branch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 575px) { .ct-branch-grid { grid-template-columns: 1fr; } }

.ct-branch-option {
    border: 1.5px solid var(--inst-border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
    position: relative;
}

.ct-branch-option:hover {
    border-color: var(--inst-accent);
}

.ct-branch-option.selected {
    border-color: var(--inst-accent);
    background: var(--inst-muted);
}

.ct-branch-option h4 {
    font-size: 15px;
    color: var(--inst-primary);
    margin-bottom: 4px;
}

.ct-branch-option p {
    font-size: 13px;
    color: var(--inst-muted-fg);
    margin: 0;
}

.ct-branch-option .ct-branch-check {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--inst-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
}

.ct-branch-option.selected .ct-branch-check {
    background: var(--inst-accent);
    border-color: var(--inst-accent);
    color: #FFFFFF;
}

.ct-upload-box {
    border: 2px dashed var(--inst-border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.ct-upload-box:hover {
    border-color: var(--inst-accent);
    background: var(--inst-bg-light);
}

.ct-upload-box i {
    font-size: 32px;
    color: var(--inst-accent);
    margin-bottom: 10px;
    display: inline-block;
}

.ct-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ct-summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--inst-bg-light);
    border-radius: 8px;
    font-size: 14px;
}

.ct-summary-list li span:first-child {
    color: var(--inst-muted-fg);
}

.ct-summary-list li span:last-child {
    color: var(--inst-primary);
    font-weight: 600;
}

.ct-wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.ct-success-state {
    text-align: center;
    padding: 30px 0;
}

.ct-success-state i {
    font-size: 56px;
    color: var(--inst-secondary);
    margin-bottom: 16px;
    display: inline-block;
}

/* ---------- Calculadora: modo tabs + tabla de desglose ---------- */
.ct-calc-modes {
    display: inline-flex;
    background: #FFFFFF;
    border: 1px solid var(--inst-border);
    border-radius: 100px;
    padding: 6px;
    margin-bottom: 30px;
}

.ct-calc-mode-btn {
    padding: 10px 22px;
    border-radius: 100px;
    border: none;
    background: none;
    font-weight: 700;
    font-size: 14px;
    color: var(--inst-muted-fg);
    cursor: pointer;
    transition: all 200ms ease;
}

.ct-calc-mode-btn.active {
    background: var(--inst-accent);
    color: #FFFFFF;
}

.ct-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 30px 0;
}

@media (max-width: 767px) { .ct-summary-cards { grid-template-columns: 1fr; } }

.ct-summary-card {
    background: #FFFFFF;
    border: 1px solid var(--inst-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.ct-summary-card p {
    font-size: 12.5px;
    color: var(--inst-muted-fg);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.ct-summary-card h3 {
    font-size: 24px;
    color: var(--inst-primary);
    margin: 0;
}

.ct-summary-card.ct-highlight h3 {
    color: var(--inst-accent);
}

.ct-schedule-wrap {
    background: #FFFFFF;
    border: 1px solid var(--inst-border);
    border-radius: 14px;
    overflow: hidden;
}

.ct-schedule-scroll {
    max-height: 460px;
    overflow-y: auto;
}

.ct-schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.ct-schedule-table thead th {
    position: sticky;
    top: 0;
    background: var(--inst-primary);
    color: #FFFFFF;
    padding: 12px 16px;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: right;
    z-index: 1;
}

.ct-schedule-table thead th:first-child {
    text-align: left;
}

.ct-schedule-table td {
    padding: 10px 16px;
    font-size: 13.5px;
    text-align: right;
    color: var(--inst-fg, #16241C);
    border-bottom: 1px solid var(--inst-border);
}

.ct-schedule-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--inst-primary);
}

.ct-schedule-table tbody tr:nth-child(even) {
    background: var(--inst-bg-light);
}

/* Aviso de progreso restaurado (wizard, ver catalogo-modern.js: restaurarProgreso) */
.ct-restore-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto 20px;
}

.ct-restore-clear {
    border: none;
    background: none;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
}
