/* ==========================================================================
   GIRAG – Tarifas y Comunicaciones
   gt-* tarifario · gc-* listado de circulares · hd-* circulares recientes
   ========================================================================== */

.gt-wrap,
.gc-wrap,
.hd-wrap {
    --g-navy: #000C36;
    --g-orange: #E46805;
    --g-gray: #7A7A7A;
    --g-line: #E6E8EE;
    --g-bg: #F5F6F9;
    font-family: 'Roboto', sans-serif;
    max-width: 1140px;
    margin: 0 auto;
}

.gt-wrap .screen-reader-text,
.gc-wrap .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Buscador (compartido)
   -------------------------------------------------------------------------- */

.gt-search,
.gc-search {
    position: relative;
    flex: 1 1 280px;
    min-width: 220px;
}

.gc-search {
    max-width: 420px;
    margin: 0 0 28px;
}

.gt-search__input,
.gc-search__input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px 12px 42px;
    border: 2px solid var(--g-line);
    border-radius: 8px;
    font-size: 15px;
    color: var(--g-navy);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237A7A7A' stroke-width='2'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M12.8 12.8 17 17' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 17px 17px;
    transition: border-color .2s;
}

.gt-search__input:focus,
.gc-search__input:focus {
    outline: none;
    border-color: var(--g-orange);
}

/* --------------------------------------------------------------------------
   Tarifario
   -------------------------------------------------------------------------- */

.gt-intro {
    margin: 0 0 22px;
    font-size: 15.5px;
    line-height: 1.65;
    color: #2A2E3A;
}

.gt-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

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

.gt-chip {
    border: 2px solid var(--g-line);
    background: #fff;
    color: var(--g-navy);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.gt-chip:hover {
    border-color: var(--g-orange);
    color: var(--g-orange);
}

.gt-chip--active,
.gt-chip--active:hover {
    background: var(--g-navy);
    border-color: var(--g-navy);
    color: #fff;
}

.gt-table-scroll {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 12, 54, .08);
}

table.gt-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 780px;
    margin: 0;
}

.gt-table thead th {
    background: var(--g-navy);
    color: #fff;
    text-align: left;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.gt-table thead th:first-child { border-top-left-radius: 12px; }
.gt-table thead th:last-child { border-top-right-radius: 12px; }
.gt-table .gt-th-num { width: 52px; }

/* El tema centra todas las celdas de tabla mientras deja los encabezados a la
   izquierda; se fuerza la alineación para que columna y encabezado coincidan. */
.gt-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #EEF0F4;
    font-size: 14.5px;
    color: #2A2E3A;
    vertical-align: middle;
    text-align: left;
}

.gt-table tbody tr:last-child td { border-bottom: none; }
.gt-table tbody tr:hover { background: #F7F8FB; }

.gt-row--destacada { background: #FFF6ED; }
.gt-row--destacada:hover { background: #FFEEDB; }
.gt-row--destacada .gt-concepto { font-weight: 700; color: var(--g-navy); }

.gt-col-num { color: var(--g-gray); font-weight: 600; }
.gt-col-tarifa,
.gt-col-minima { font-weight: 700; color: var(--g-navy); white-space: nowrap; }
.gt-col-doc { white-space: nowrap; width: 152px; }

.gt-na {
    color: #A0A4AE;
    font-weight: 500;
}

/* La categoría sólo se muestra en la tarjeta móvil. */
.gt-cat { display: none; }

.gt-doclink {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    color: var(--g-navy);
    border: 1px solid var(--g-line);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 600;
    transition: all .2s;
}

.gt-doclink:hover {
    border-color: var(--g-orange);
    color: var(--g-orange);
    background: #FFF6ED;
}

.gt-doclink__icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex: none;
}

.gt-empty,
.gc-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--g-gray);
    background: #fff;
    border-radius: 12px;
    margin-top: 14px;
}

.gt-footnote {
    margin-top: 18px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--g-gray);
}

.gt-footnote p { margin: 0 0 6px; }
.gt-footnote a { color: var(--g-orange); font-weight: 600; text-decoration: none; }
.gt-footnote a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Tarifario — tarjetas en móvil
   La tabla se reconstruye como tarjeta con CSS grid: sin bordes punteados ni
   filas huérfanas, y con tarifa y mínima enfrentadas para poder compararlas.
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    .gt-table-scroll {
        overflow: visible;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    table.gt-table {
        display: block;
        min-width: 0;
        width: 100%;
        background: transparent;
    }

    .gt-table thead { display: none; }
    .gt-table tbody { display: block; }

    .gt-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "meta  meta"
            "conc  conc"
            "tar   min"
            "doc   doc";
        gap: 12px;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(0, 12, 54, .07);
        padding: 18px 16px;
        margin-bottom: 14px;
    }

    .gt-table tbody tr:hover { background: #fff; }

    .gt-row--destacada {
        background: #fff;
        box-shadow: 0 2px 12px rgba(228, 104, 5, .16);
        border-left: 4px solid var(--g-orange);
    }

    .gt-table tbody tr[hidden] { display: none; }

    .gt-table tbody td {
        display: block;
        padding: 0;
        border: none;
        font-size: 14px;
        text-align: left;
    }

    /* Encabezado de la tarjeta: número + categoría */
    .gt-col-num {
        grid-area: meta;
        display: flex;
        align-items: center;
        gap: 9px;
        flex-wrap: wrap;
    }

    .gt-num {
        font-size: 12px;
        font-weight: 700;
        color: #A0A4AE;
    }

    .gt-num::before {
        content: "#";
        margin-right: 1px;
    }

    .gt-cat {
        display: inline-block;
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--g-orange);
        background: #FFF3E8;
        padding: 4px 10px;
        border-radius: 999px;
        line-height: 1.3;
    }

    /* Concepto */
    .gt-col-concepto { grid-area: conc; }

    .gt-concepto {
        display: block;
        font-size: 15.5px;
        font-weight: 700;
        line-height: 1.4;
        color: var(--g-navy);
    }

    /* Tarifa y mínima, enfrentadas */
    .gt-col-tarifa,
    .gt-col-minima {
        background: var(--g-bg);
        border-radius: 10px;
        padding: 10px 12px;
        white-space: normal;
        font-size: 15px;
        font-weight: 700;
        color: var(--g-navy);
    }

    .gt-col-tarifa { grid-area: tar; }
    .gt-col-minima { grid-area: min; }

    .gt-col-tarifa::before,
    .gt-col-minima::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--g-gray);
        margin-bottom: 4px;
    }

    .gt-col-tarifa .gt-na,
    .gt-col-minima .gt-na { font-size: 13.5px; }

    /* Documento */
    .gt-col-doc {
        grid-area: doc;
        width: auto;
        white-space: normal;
    }

    .gt-doclink {
        display: flex;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
        padding: 11px 14px;
        font-size: 13px;
        border-color: #DCE0E8;
    }

    .gt-col-doc .gt-na {
        display: block;
        text-align: center;
        font-size: 12.5px;
    }
}

/* --------------------------------------------------------------------------
   Listado de circulares
   -------------------------------------------------------------------------- */

.gc-card {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 12, 54, .08);
    padding: 24px 26px;
    margin-bottom: 18px;
    border-left: 4px solid var(--g-orange);
}

.gc-card[hidden] { display: none; }

.gc-card__aside {
    flex: 0 0 170px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gc-card__date { font-size: 14px; font-weight: 700; color: var(--g-navy); }

.gc-card__tipo {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--g-gray);
    font-weight: 600;
}

.gc-card__body { flex: 1 1 auto; min-width: 0; }

.gc-card__title {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.35;
    color: var(--g-navy);
    font-weight: 700;
}

.gc-card__num { color: var(--g-orange); margin-right: 8px; }

.gc-badge {
    display: inline-block;
    margin-left: 10px;
    background: var(--g-orange);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.gc-card__resumen {
    margin: 0 0 14px;
    font-size: 14.5px;
    line-height: 1.6;
    color: #2A2E3A;
}

.gc-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.gc-meta div { min-width: 0; }

.gc-meta dt {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--g-gray);
    font-weight: 700;
    margin: 0 0 2px;
}

.gc-meta dd { margin: 0; font-size: 13.5px; color: var(--g-navy); font-weight: 500; }

.gc-card__cta { flex: 0 0 auto; }

.gc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--g-navy);
    color: #fff;
    text-decoration: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .2s;
}

.gc-btn:hover { background: var(--g-orange); color: #fff; }

.gc-meta--single { margin-bottom: 18px; }
.gc-single__resumen { font-size: 16px; line-height: 1.7; }

@media (max-width: 900px) {
    .gc-card { flex-direction: column; gap: 14px; padding: 20px; }
    .gc-card__aside { flex: none; flex-direction: row; align-items: center; gap: 12px; }
    .gc-card__cta { width: 100%; }
    .gc-btn { width: 100%; justify-content: center; box-sizing: border-box; }
}

/* --------------------------------------------------------------------------
   Circulares recientes (home)
   -------------------------------------------------------------------------- */

.hd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.hd-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0, 12, 54, .08);
    padding: 26px 24px 22px;
    text-decoration: none;
    border-top: 3px solid var(--g-orange);
    transition: transform .2s, box-shadow .2s;
}

.hd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 12, 54, .14);
}

.hd-card__tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hd-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 5px 11px;
    border-radius: 999px;
    line-height: 1.3;
}

.hd-tag--num {
    color: var(--g-navy);
    background: #EEF0F6;
}

.hd-tag--nuevo {
    color: #fff;
    background: var(--g-orange);
}

.hd-card__date {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--g-gray);
    margin-bottom: 6px;
}

.hd-card__title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
    color: var(--g-navy);
    font-weight: 700;
}

.hd-card__resumen {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #4A4F5C;
    flex: 1 1 auto;
}

.hd-card__link {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--g-navy);
}

.hd-card__link span { transition: margin-left .2s; margin-left: 3px; display: inline-block; }
.hd-card:hover .hd-card__link { color: var(--g-orange); }
.hd-card:hover .hd-card__link span { margin-left: 7px; }

.hd-all { text-align: center; margin-top: 34px; }

.hd-all a {
    display: inline-block;
    background: var(--g-navy);
    color: #fff;
    text-decoration: none;
    padding: 13px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    transition: background .2s;
}

.hd-all a:hover { background: var(--g-orange); color: #fff; }
