@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

:root {
    --tm-font-family: 'Open Sans', Arial, sans-serif;
    --tm-detail-data-width: 56%;
    --tm-detail-map-width: 44%;
    --tm-map-height-desktop: 360px;
}

.tm-wrapper,
.tm-wrapper *,
.tm-modal,
.tm-modal *,
.post-type-tm_taller,
.post-type-tm_taller * {
    font-family: var(--tm-font-family);
}

.tm-wrapper {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0px;
    box-sizing: border-box;
}

/* Mantiene estable el ancho del módulo aunque los filtros devuelvan pocas fichas. */
.tm-wrapper,
.tm-results-area,
.tm-results,
.tm-pagination-wrap {
    min-width: 0;
}

.tm-filters {
    display: grid;
    grid-template-columns: minmax(210px, 1.1fr) repeat(5, minmax(135px, .85fr)) minmax(130px, .6fr);
    gap: 10px;
    margin-bottom: 16px;
}

.tm-filters input,
.tm-filters select,
.tm-filters button {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #d9d9d9;
    padding: 0 12px;
    box-sizing: border-box;
    width: 100%;
}

.tm-filters button,
.tm-btn,
.tm-page-btn {
    background: #5f4995;
    color: #fff;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    font-size: 13px;
}

.tm-filters button:hover {
    background: #7800ff;
    color: #fff;

}


.tm-btn-secondary{
    background: #eef2ff;
    color: #1e3a8a;
    cursor: pointer;
}

.tm-btn-secondary:hover{
    background: #ced5ea;
    color: #1e3a8a;

}



.tm-reset-filters {
    white-space: nowrap;
    min-width: 130px;
}

.tm-results-area {
    min-width: 0;
}

.tm-results-meta {
    margin-bottom: 14px;
    color: #475569;
    font-size: 14px;
}

@media (max-width: 1250px) {
    .tm-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .tm-filters {
        grid-template-columns: 1fr;
    }
}

.tm-results {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(var(--tm-columns, 3), minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 24px;
    justify-content: start;
    align-items: stretch;
}

.tm-results > .tm-card {
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-self: stretch;
}

.tm-card,
.tm-single-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,.05);
    box-sizing: border-box;
}

.tm-card {
    margin: 0;
}

.tm-card-media img,
.tm-card-media .tm-placeholder {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.tm-placeholder {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #6b7280;
}

.tm-card-body {
    padding: 22px;
}

.tm-card-media {
    position: relative;
}

.tm-card-category {
    position: absolute;
    left: 14px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    background: #482680;
}

.tm-status-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .16);
}

.tm-status-badge--suspended {
    background: #fee2e2;
    color: #b91c1c;
}

.tm-card.is-suspended {
    border-color: #fecaca;
    box-shadow: 0 12px 28px rgba(185, 28, 28, .08);
    background: #f9dada;
}


.tm-card-body h3 {
    margin: 0 0 13px;
    font-size: 17px;
    line-height: 1.2;
    color: #482680;
    font-weight: 600;
}

.tm-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}

.tm-meta li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.tm-horarios-card {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.tm-horarios-card strong {
    flex: 0 0 auto;
}

.tm-horarios-card .tm-horarios-list {
    display: block;
    min-width: 0;
}

.tm-horarios-card .tm-horarios-line {
    display: block;
}

.tm-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tm-empty {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
}

.tm-results.is-loading,
.tm-pagination-wrap.is-loading {
    opacity: .5;
    transition: opacity .2s ease;
}

.tm-pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.tm-single {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 16px;
}

.tm-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--tm-detail-data-width)) minmax(320px, var(--tm-detail-map-width));
    gap: 18px;
    align-items: start;
    margin-top: 16px;
}


.tm-single-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tm-single-item {
    padding: 11px 13px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #eef2f7;
}

.tm-single-item strong,
.tm-single-item span {
    display: block;
}

.tm-single-item strong {
    margin-bottom: 6px;
}

.tm-single-item span {
    line-height: 1.5;
}

.tm-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.tm-label svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: #5f4995;
}

.tm-map-card {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 18px;
    padding: 16px;
    position: sticky;
    top: 0;
}

.tm-map-card h4 {
    margin: 0 0 12px;
    font-size: 20px;
}

.tm-map-wrap iframe {
    width: 100%;
    height: var(--tm-map-height-desktop);
    border: 0;
    border-radius: 14px;
    display: block;
    margin-bottom: 10px;
}




.tm-btn-mapa {
    background: #5f4995;
    color: #fff;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 16px!important;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    font-size: 11px;
}

.tm-btn-mapa:hover {
    background: #7800ff;
    color: #fff;

}



.tm-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2147483000;
}

.tm-modal.is-open {
    display: block;
}

.tm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .78);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .25s ease;
}

.tm-modal.is-open .tm-modal-backdrop {
    opacity: 1;
}

.tm-modal-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tm-modal.is-loading .tm-modal-loader {
    display: flex;
}

.tm-loader {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255,255,255,.35);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tmspin .85s linear infinite;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    background: rgba(255,255,255,.85);
}

.tm-modal-dialog {
    position: relative;
    max-width: 1200px;
    width: calc(100% - 36px);
    margin: 32px auto;
    max-height: calc(100vh - 64px);
    overflow: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
    transform: translateY(26px);
    opacity: 0;
    transition: transform .28s ease, opacity .28s ease;
    z-index: 3;
}

.tm-modal.is-open:not(.is-loading) .tm-modal-dialog {
    transform: translateY(0);
    opacity: 1;
}

.tm-modal-dialog.is-closing {
    transform: translateY(18px);
    opacity: 0;
}

.tm-modal-close {
    position: sticky;
    top: 14px;
    float: right;
    margin: 14px 14px 0 0;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 0;
    background: #0f172a;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
}

.tm-modal-content {
    padding: 20px 24px 28px;
}

.tm-detail-title {
    margin: 0 0 18px;
    font-size: 38px;
    line-height: 1.1;
    font-size: 21px !important;
    font-weight: 700 !important;
}

.tm-detail-alert {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    margin: 0 0 18px;
    padding: 18px 20px;
    border-radius: 18px;
}

.tm-detail-alert--suspended {
    background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
    border: 1px solid #fdba74;
    color: #9a3412;
}

.tm-detail-alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.tm-detail-alert-text strong,
.tm-detail-alert-text p {
    display: block;
}

.tm-detail-alert-text strong {
    margin-bottom: 6px;
}

.tm-detail-alert-text p {
    margin: 0;
    line-height: 1.6;
}


.tm-detail-text,
.tm-rich-text {
    color: #334155;
    line-height: 1.75;
}

.tm-info-block {
    margin-top: 28px;
}

.tm-info-block h3 {
  margin: 0 0 14px;
  font-size: 18px;
  color: #5f4995;
  font-weight: 600;
}

.tm-modal-error {
    padding: 80px 24px;
    text-align: center;
}

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

@keyframes tmspin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
    .tm-results {
        grid-template-columns: repeat(min(var(--tm-columns, 3), 3), minmax(0, 1fr));
    }
    .tm-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .tm-filters {
        grid-template-columns: 1fr;
    }
    .tm-results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .tm-single-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .tm-results {
        grid-template-columns: 1fr;
    }

    .tm-detail-alert {
        grid-template-columns: 1fr;
    }

    .tm-card-body h3 {
        font-size: 20px;
    }
    .tm-detail-title {
        font-size: 30px;
    }
    .tm-modal-dialog {
        width: calc(100% - 20px);
        margin: 10px auto;
        max-height: calc(100vh - 20px);
    }
    .tm-modal-content {
        padding: 16px 16px 24px;
    }
}


@media (max-width: 1024px) {
    .tm-wrapper {
        grid-template-columns: 1fr;
    }

    .tm-filters {
        position: static;
    }
}

@media (max-width: 767px) {
    .tm-single-grid {
        grid-template-columns: 1fr;
    }
}
