/* TH Reformas Widget CSS v2.1 */

/* ── GRID CON PANEL ── */
.th-rg-wrap { position: relative; }

.th-rg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    background: #E2E2E0;
    width: 100%;
}

.th-rg-card {
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border-top: 3px solid transparent;
    transition: border-color .2s, background .2s;
}
.th-rg-card:hover  { border-top-color: #C91C1C; }
.th-rg-card.active { border-top-color: #C91C1C; background: #FEF0F0; }

.th-rg-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #F0F0EE;
    flex-shrink: 0;
}
.th-rg-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .35s;
}
.th-rg-card:hover .th-rg-img img { transform: scale(1.05); }

.th-rg-img--ph::after {
    content: '📷';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    font-size: 28px;
    color: #CCC;
}
.th-rg-img--ph { display: flex; align-items: center; justify-content: center; }

.th-rg-label {
    padding: 12px 14px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.th-rg-label-text {
    font-family: 'Oswald', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #2C2C2C;
    line-height: 1.25;
    transition: color .2s;
}
.th-rg-card.active .th-rg-label-text { color: #C91C1C; }
.th-rg-chevron {
    flex-shrink: 0;
    color: #C91C1C;
    display: flex;
    align-items: center;
    transition: transform .25s;
    pointer-events: none;
}
.th-rg-card.active .th-rg-chevron { transform: rotate(180deg); }

/* Panel — dentro del grid con grid-column:1/-1, JS lo reubica en el DOM */
.th-rg-panel-wrap {
    grid-column: 1 / -1;
    background: #F5F5F3;
    border-top: 3px solid #C91C1C;
    overflow: hidden;
    max-height: 0;
    transition: max-height .38s ease;
}
.th-rg-panel-inner {
    display: grid;
    grid-template-columns: 260px 1fr;
}
.th-rg-panel-img-wrap {
    overflow: hidden;
    background: #EBEBEA;
    min-height: 200px;
}
.th-rg-panel-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.th-rg-panel-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.th-rg-panel-tag {
    font-family: 'Oswald', sans-serif;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    background: #C91C1C;
    color: #fff;
    padding: 3px 10px;
    display: inline-block;
    width: fit-content;
}
.th-rg-panel-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1A1A1A;
    letter-spacing: .02em;
    margin: 0;
}
.th-rg-panel-desc {
    font-size: .875rem;
    line-height: 1.7;
    color: #555;
}
.th-rg-panel-desc p { margin-bottom: 6px; }
.th-rg-panel-precio {
    font-size: .85rem; color: #444;
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #C91C1C;
}
.th-rg-panel-docs { font-size: .82rem; color: #666; font-style: italic; }
.th-rg-panel-close {
    align-self: flex-start;
    margin-top: 4px;
    font-size: .75rem;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.th-rg-panel-close:hover { color: #C91C1C; }

/* ── ACCORDION ── */
.th-rg-grid--accordion { grid-template-columns: repeat(3, 1fr); }
.th-rg-card--acc { overflow: hidden; }
.th-rg-acc-inner {
    padding: 14px 18px 18px;
    border-top: 1px solid #E2E2E0;
}

/* ── TABS ── */
.th-tabs-wrap { border: 1px solid #E2E2E0; overflow: hidden; }
.th-tabs-nav {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid #E2E2E0;
    background: #F5F5F3;
    scrollbar-width: none;
}
.th-tabs-nav::-webkit-scrollbar { display: none; }
.th-tab {
    font-family: 'Oswald', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
    flex-shrink: 0;
}
.th-tab:hover { color: #2C2C2C; }
.th-tab.active { color: #C91C1C; border-bottom-color: #C91C1C; background: #fff; }
.th-tab-panel { display: none; }
.th-tab-panel.active { display: block; }
.th-tab-inner {
    display: grid;
    grid-template-columns: 280px 1fr;
}
.th-tab-img-wrap { overflow: hidden; background: #F0F0EE; min-height: 200px; }
.th-tab-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th-tab-content { padding: 24px 28px; }
.th-tab-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #1A1A1A;
    margin: 0 0 12px;
}

/* ── LISTA VERTICAL ── */
.th-lista { display: flex; flex-direction: column; border: 1px solid #E2E2E0; }
.th-lista-item { border-bottom: 1px solid #E2E2E0; }
.th-lista-item:last-child { border-bottom: none; }
.th-lista-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    border-left: 3px solid transparent;
    transition: border-color .2s, background .2s;
}
.th-lista-trigger:hover { background: #FAFAFA; border-left-color: #C91C1C; }
.th-lista-item.is-open .th-lista-trigger { background: #FEF0F0; border-left-color: #C91C1C; }
.th-lista-img { width: 52px; height: 40px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.th-lista-img-ph { width: 52px; height: 40px; background: #EBEBEA; border-radius: 3px; flex-shrink: 0; }
.th-lista-title {
    font-family: 'Oswald', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #2C2C2C;
    flex: 1;
    transition: color .2s;
}
.th-lista-trigger:hover .th-lista-title,
.th-lista-item.is-open .th-lista-title { color: #C91C1C; }
.th-lista-precio { font-size: .8rem; color: #999; white-space: nowrap; }
.th-lista-chevron {
    flex-shrink: 0;
    color: #C91C1C;
    transition: transform .3s;
    display: flex;
    align-items: center;
    pointer-events: none;
}
.th-lista-item.is-open .th-lista-chevron { transform: rotate(180deg); }
.th-lista-inner { padding: 4px 20px 20px 90px; background: #FEF0F0; }

/* ── COMPARTIDO ── */
.th-rg-desc { font-size: .875rem; line-height: 1.7; color: #555; margin-bottom: 4px; }
.th-rg-desc p, .th-rg-panel-desc p { margin-bottom: 6px; }
.th-rg-desc p:last-child, .th-rg-panel-desc p:last-child { margin-bottom: 0; }
.th-rg-desc ul, .th-rg-desc ol, .th-rg-panel-desc ul, .th-rg-panel-desc ol { margin: 0 0 6px; padding-left: 1.25em; }
.th-rg-desc li, .th-rg-panel-desc li { margin-bottom: 3px; }
.th-rg-desc a, .th-rg-panel-desc a { color: #C91C1C; text-decoration: underline; }
.th-rg-desc strong, .th-rg-desc b, .th-rg-panel-desc strong, .th-rg-panel-desc b { font-weight: 700; }

.th-rg-reqs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.th-rg-reqs li {
    font-size: .85rem;
    line-height: 1.6;
    color: #555;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.th-rg-reqs li::before {
    content: '';
    display: block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #C91C1C;
    flex-shrink: 0;
    margin-top: 6px;
}
.th-rg-precio {
    font-size: .85rem; color: #444;
    padding: 8px 12px;
    background: #fff;
    border-left: 3px solid #C91C1C;
    margin: 4px 0 0;
}
.th-rg-docs { font-size: .82rem; color: #666; font-style: italic; margin: 4px 0 0; }

/* ── Texto enriquecido (campos con editor WYSIWYG: requisitos / documentación) ── */
.th-rg-rich { font-size: .875rem; line-height: 1.65; color: #555; }
.th-rg-rich > :first-child { margin-top: 0; }
.th-rg-rich > :last-child { margin-bottom: 0; }
.th-rg-rich p { margin: 0 0 6px; }
.th-rg-rich ul, .th-rg-rich ol { margin: 0 0 6px; padding-left: 1.25em; }
.th-rg-rich li { margin-bottom: 3px; }
.th-rg-rich a { color: #C91C1C; text-decoration: underline; }
.th-rg-rich strong, .th-rg-rich b { font-weight: 700; }
.th-rg-rich blockquote { margin: 0 0 6px; padding-left: 12px; border-left: 3px solid #e0d0d0; color: #777; }
.th-rg-docs .th-rg-rich { display: inline; font-size: inherit; color: inherit; font-style: inherit; }
.th-rg-panel-docs .th-rg-rich { display: inline; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .th-rg-grid { grid-template-columns: repeat(3, 1fr); }
    .th-rg-panel-inner, .th-tab-inner { grid-template-columns: 200px 1fr; }
}
@media (max-width: 768px) {
    .th-rg-grid { grid-template-columns: repeat(2, 1fr); }
    .th-rg-grid--accordion { grid-template-columns: repeat(2, 1fr); }
    .th-rg-panel-inner, .th-tab-inner { grid-template-columns: 1fr; }
    .th-rg-panel-img-wrap { min-height: 160px; }
    .th-lista-inner { padding-left: 20px; }
}
@media (max-width: 480px) {
    .th-rg-grid { grid-template-columns: repeat(2, 1fr); }
}
