/* =============================================================================
   Transparencia Block
   Sección de documentos con grupos, tarjetas de archivos y selector por año.
   Figma: node-id=477-14637
   ============================================================================= */

/* --------------------------------------------------------------------------
   Section — bg #F4F4F4, padding 56px 0
   -------------------------------------------------------------------------- */
.transparencia-section {
    position: relative;
    background-color: var(--wp--preset--color--light-gray);
    padding: 56px 0;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Decorative ellipses — brand-blue 10% opacity, position exacta de Figma
   -------------------------------------------------------------------------- */
.transparencia-ellipse {
    position: absolute;
    width: 703px;
    height: 703px;
    border-radius: 50%;
    background-color: var(--wp--preset--color--brand-blue);
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.transparencia-ellipse--left {
    bottom: -220px;
    left: -300px;
}

.transparencia-ellipse--right {
    top: -351px;
    right: -200px;
}

/* --------------------------------------------------------------------------
   Wrapper — max-width 1200px, gap 48px entre grupos
   -------------------------------------------------------------------------- */
.transparencia-wrapper {
    position: relative;
    z-index: 1;
    max-width: var(--wp--style--global--content-size);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* --------------------------------------------------------------------------
   Grupo — column, gap 24px
   -------------------------------------------------------------------------- */
.transparencia-grupo {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* H2 — Inter 700 36px centrado (Desktop/H3 Bold en Figma) */
.transparencia-grupo-titulo {
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--large);
    font-weight: 700;
    line-height: 1.21;
    color: var(--wp--preset--color--text-dark);
    text-align: center;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Card List — column, align-items center, gap 16px, padding 0 64px
   -------------------------------------------------------------------------- */
.transparencia-card-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 0 64px;
}

/* --------------------------------------------------------------------------
   Card — row, gap 64px, padding 24px, max-width 1000px
   Figma: layout_N48WR6 / layout_T64C6D — white bg, border 1px #787878, radius 16px
   -------------------------------------------------------------------------- */
.transparencia-card {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 64px;
    background-color: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--secondary);
    border-radius: var(--wp--custom--border-radius--lg);
    padding: 24px;
    transition: box-shadow 0.2s ease;
    box-sizing: border-box;
}

.transparencia-card:hover {
    box-shadow: var(--wp--custom--shadow--sm);
}

/* --------------------------------------------------------------------------
   Card Header — columna izquierda, flex 1
   Figma: layout_TMS9UJ — fill horizontal, vertical hug
   El borde rojo va en el TÍTULO para que su altura sea la del texto, no la de la tarjeta
   -------------------------------------------------------------------------- */
.transparencia-card-header {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: flex-start;
}

/* H3 — Inter 500 18px + border-left 4px rojo solo en el título (vertical hug)
   Figma: stroke #D50032 strokeWeight 0px 0px 0px 4px, padding-left 24px */
.transparencia-card-titulo {
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--body-large);
    font-weight: 500;
    line-height: 1.21;
    color: var(--wp--preset--color--text-dark);
    margin: 0;
    border-left: 4px solid var(--wp--preset--color--primary);
    padding-left: 24px;
}

/* --------------------------------------------------------------------------
   Card Body — columna derecha, flex 1, column
   Figma: layout_G2EKZ4 — fill horizontal, column
   -------------------------------------------------------------------------- */
.transparencia-card-body {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   File List
   Figma: li-dropdown — row, space-between, center, gap 8px, padding 8px, radius 8px
   -------------------------------------------------------------------------- */
.transparencia-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.transparencia-file-item {
    border-radius: var(--wp--custom--border-radius--md);
    transition: background-color 0.15s ease;
}

.transparencia-file-item:hover {
    background-color: rgba(213, 0, 50, 0.06);
}

/* Cada fila de archivo: texto izquierda + icono derecha */
.transparencia-file-link {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: var(--wp--custom--border-radius--md);
    text-decoration: none;
    color: var(--wp--preset--color--text-gray);
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--normal);
    font-weight: 500;
    line-height: 1.21;
    width: 100%;
    transition: color 0.15s ease;
}

.transparencia-file-link:hover {
    color: var(--wp--preset--color--primary);
}

.transparencia-file-link--no-file {
    opacity: 0.5;
    cursor: default;
}

.transparencia-file-name {
    flex: 1 1 0;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Download Icon — 16x16
   -------------------------------------------------------------------------- */
.transparencia-icon-download {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--wp--preset--color--text-gray);
    transition: color 0.15s ease;
}

.transparencia-file-item:hover .transparencia-icon-download {
    color: var(--wp--preset--color--primary);
}

/* --------------------------------------------------------------------------
   Year Selector
   Figma: Frame 115 — row, justifyContent center, alignSelf stretch, gap 22px
   -------------------------------------------------------------------------- */
.transparencia-year-selector {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 22px;
    width: 100%;
}

/* Wrapper del input — fill, position relative para el caret */
.transparencia-year-selector-field {
    flex: 1 1 0;
    position: relative;
    min-width: 0;
}

/* Select — bg #F4F4F4, radius 16px, padding 8px 16px, sin border
   Figma: Input fill bg #F4F4F4, border-radius 16px, padding 8px 16px */
.transparencia-year-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--wp--preset--color--light-gray);
    border: none;
    border-radius: var(--wp--custom--border-radius--lg);
    padding: 8px 40px 8px 16px;
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 400;
    line-height: 1.21;
    color: rgba(51, 51, 51, 0.64);
    cursor: pointer;
    outline: none;
    transition: box-shadow 0.15s ease, color 0.15s ease;
    height: 40px;
}

.transparencia-year-select.has-value {
    color: var(--wp--preset--color--text-dark);
}

.transparencia-year-select:focus {
    box-shadow: 0 0 0 2px var(--wp--preset--color--primary);
}

/* Caret icon posicionado a la derecha del select */
.transparencia-year-select-caret {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--wp--preset--color--text-dark);
    display: flex;
    align-items: center;
}

.transparencia-icon-caret {
    width: 20px;
    height: 20px;
}

/* --------------------------------------------------------------------------
   Download Button (Secondary)
   Figma: Button — row, center, gap 8px, padding 8px 16px, h 40px, radius 24px,
          white bg, border 1px #787878, texto Inter 700 14px
   -------------------------------------------------------------------------- */
.transparencia-download-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 8px 16px;
    background-color: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--secondary);
    border-radius: 24px;
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
    line-height: 1.21;
    color: var(--wp--preset--color--text-dark);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.transparencia-download-btn:hover:not(.transparencia-download-btn--disabled) {
    background-color: var(--wp--preset--color--light-gray);
    border-color: var(--wp--preset--color--text-dark);
}

.transparencia-download-btn--disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.transparencia-download-btn .transparencia-icon-download {
    width: 16px;
    height: 16px;
    color: currentColor;
}

/* --------------------------------------------------------------------------
   Calculadora Fiscal Button (Tertiary, small)
   Figma: node-id=5211-36675 — Text + Icon Right, 24px radius, text-dark
   -------------------------------------------------------------------------- */
.transparencia-calculadora {
    display: flex;
    align-items: center;
    justify-content: end;
}

/* Tertiary small button — Figma node-id=5211-36675/5211-36670
   Overrides theme.json global button element styles (bg primary, color white).
   No bg, no border, Inter 700 12px, text-dark, icon ArrowSquareOut 16px right */
.transparencia-section .transparencia-calculadora-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--wp--preset--font-family--inter);
    font-size: var(--wp--preset--font-size--tiny, 12px);
    font-weight: 700;
    line-height: 1.21;
    color: var(--wp--preset--color--text-dark, #333333);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.transparencia-section .transparencia-calculadora-btn:hover,
.transparencia-section .transparencia-calculadora-btn:focus-visible {
    color: var(--wp--preset--color--primary, #D50032);
    background: none;
    outline: none;
}

.transparencia-section .transparencia-calculadora-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--wp--preset--color--primary, #D50032);
    border-radius: 4px;
}

.transparencia-icon-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: currentColor;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (≤ 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .transparencia-card-list {
        padding: 0 32px;
    }

    .transparencia-card {
        gap: 40px;
    }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (≤ 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .transparencia-grupo-titulo{ 
        padding: 0 1rem;
    }
    .transparencia-section {
        padding: 40px 0;
    }

    .transparencia-wrapper {
        gap: 36px;
    }

    .transparencia-card-list {
        padding: 0 16px;
    }

    .transparencia-card {
        flex-direction: column;
        gap: 24px;
        padding: 24px;
    }

    .transparencia-card-titulo {
        padding-left: 24px;
    }

    .transparencia-year-selector {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .transparencia-download-btn {
        width: auto;
        flex-shrink: 0;
    }

    .transparencia-ellipse {
        width: 400px;
        height: 400px;
    }

    .transparencia-ellipse--left {
        bottom: -120px;
        left: -180px;
    }

    .transparencia-ellipse--right {
        top: -200px;
        right: -120px;
    }
}
