/* ===================================================================
   Telrad Chile - Identidad visual corporativa
   =================================================================== */

:root {
    --telrad-primary:   #13294b;
    --telrad-dark:      #0a1f44;
    --telrad-blue-mid:  #1a4a8a;
    --telrad-accent:    #84c441;
    --telrad-accent-dk: #6ea635;
    --telrad-light:     #f5f7fa;
    --telrad-text:      #2b2b2b;
    --telrad-muted:     #777;
    --telrad-card-bg:   #ffffff;
    --telrad-body-bg:   #f5f7fa;
}

* { box-sizing: border-box; }

body {
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
    color: var(--telrad-text);
    background: var(--telrad-body-bg);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--telrad-blue-mid); text-decoration: none; }
a:hover { color: var(--telrad-primary); }

h1, h2, h3, h4, h5 { color: var(--telrad-primary); font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.7rem; margin-bottom: 1rem; }
h3 { font-size: 1.3rem; }

.text-primary { color: var(--telrad-primary) !important; }
.text-accent  { color: var(--telrad-accent)  !important; }

/* ============ HEADER ============ */
.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(19,41,75,.08);
    position: relative;
    z-index: 50;
    border-top: 4px solid var(--telrad-accent);
}
.site-logo { max-width: 240px; height: auto; }
.logo-tag {
    font-size: .72rem;
    letter-spacing: 2.5px;
    color: var(--telrad-primary);
    font-weight: 700;
    margin-top: 4px;
}
.nav-main .nav-link {
    color: var(--telrad-muted);
    font-weight: 600;
    padding: 26px 16px !important;
    text-transform: capitalize;
    border-bottom: 3px solid transparent;
    transition: all .2s;
}
.nav-main .nav-link:hover { color: var(--telrad-primary); }
.nav-main .nav-link.active {
    color: var(--telrad-primary);
    border-bottom-color: var(--telrad-accent);
}

/* === SELECTOR DE IDIOMA (ES | EN) === */
.nav-main .lang-switch {
    display: flex;
    align-items: center;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid #e1e6ed;
}
.nav-main .lang-switch .lang-link {
    padding: 6px 10px !important;
    font-size: .85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--telrad-muted);
    border-bottom: 0;
}
.nav-main .lang-switch .lang-link:hover { color: var(--telrad-primary); }
.nav-main .lang-switch .lang-link.lang-active {
    color: var(--telrad-primary);
    font-weight: 700;
    background: rgba(132,196,65,.16);
    border-radius: 4px;
}
.nav-main .lang-switch .lang-sep {
    color: #cdd5e0; padding: 0 2px;
}
@media (max-width: 767px) {
    .nav-main .lang-switch {
        margin-left: 0; padding-left: 16px; border-left: 0;
        border-top: 1px solid #e1e6ed; margin-top: 6px; padding-top: 8px;
    }
}

/* ============ MAIN ============ */
.site-main { min-height: 60vh; padding: 40px 0 60px; position: relative; }
.content-card {
    background: var(--telrad-card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(19,41,75,.06);
    margin-bottom: 30px;
}

/* ====== CONTENIDO POR BLOQUES (Quienes Somos / Nuestra Empresa) ====== */
.content-text p { margin-bottom: 1rem; }
.content-text figure.emp-img { margin: 24px 0; }
.content-text figure.emp-img img {
    display: block; width: 100%; height: auto;
    border-radius: 6px; box-shadow: 0 2px 12px rgba(19,41,75,.12);
}
.content-text figure.emp-img-sm   { max-width: 300px; }
.content-text figure.emp-img-md   { max-width: 520px; }
.content-text figure.emp-img-lg   { max-width: 780px; }
.content-text figure.emp-img-full { max-width: 100%; }
.content-text figure.emp-pos-left   { margin-left: 0;    margin-right: auto; }
.content-text figure.emp-pos-center { margin-left: auto; margin-right: auto; }
.content-text figure.emp-pos-right  { margin-left: auto; margin-right: 0; }

/* Nuevos tipos de bloque */
.content-text h2.emp-titulo {
    color: var(--telrad-primary);
    font-size: 1.55rem; font-weight: 700;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--telrad-accent);
    display: inline-block;
}
.content-text h3.emp-subtitulo {
    color: var(--telrad-primary);
    font-size: 1.18rem; font-weight: 600;
    margin: 22px 0 10px;
}
.content-text ul.emp-lista {
    margin: 14px 0 18px 0;
    padding-left: 0; list-style: none;
}
.content-text ul.emp-lista li {
    position: relative;
    padding: 6px 0 6px 28px;
    line-height: 1.55;
}
.content-text ul.emp-lista li::before {
    content: ""; position: absolute; left: 4px; top: 14px;
    width: 10px; height: 10px;
    background: var(--telrad-accent); border-radius: 50%;
}
.content-text blockquote.emp-cita {
    background: #f6fbef;
    border-left: 5px solid var(--telrad-accent);
    color: #2b2b2b;
    padding: 16px 20px;
    margin: 20px 0;
    font-style: italic;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 1px 4px rgba(19,41,75,.06);
}
/* Marca de resaltado dentro del texto (==texto==) */
.content-text mark.emp-hl {
    background: rgba(132,196,65,.32);
    color: inherit;
    padding: 0 4px;
    border-radius: 3px;
}
.content-text strong { color: var(--telrad-primary); }

/* En moviles las imagenes pasan a ancho completo */
@media (max-width: 575px) {
    .content-text figure.emp-img-sm,
    .content-text figure.emp-img-md,
    .content-text figure.emp-img-lg { max-width: 100%; }
}

/* ============ BOTONES ============ */
.btn-telrad {
    background: var(--telrad-primary); color: #fff; border: none;
    padding: 11px 28px; border-radius: 4px; font-weight: 600;
    transition: all .2s; cursor: pointer;
}
.btn-telrad:hover { background: var(--telrad-dark); color: #fff; }
.btn-accent {
    background: var(--telrad-accent); color: #fff; border: none;
    padding: 11px 28px; border-radius: 4px; font-weight: 600;
    transition: all .2s; cursor: pointer;
}
.btn-accent:hover { background: var(--telrad-accent-dk); color: #fff; }
.btn-telrad-outline {
    background: transparent; color: var(--telrad-primary);
    border: 2px solid var(--telrad-primary);
    padding: 10px 18px; border-radius: 4px; font-weight: 600;
    display: block; width: 100%; margin-bottom: 10px;
    text-align: left; transition: all .2s;
}
.btn-telrad-outline:hover,
.btn-telrad-outline.active {
    background: var(--telrad-primary); color: #fff;
}

/* ============ HOME SLIDER ============ */
.hero-slider .carousel-item {
    height: 480px;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--telrad-dark);
}
.hero-slider .carousel-item.fit-cover   { background-size: cover; }
.hero-slider .carousel-item.fit-contain { background-size: contain; }
.hero-slider .carousel-item.fit-center  { background-size: auto; }
.hero-slider .carousel-item::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,31,68,.15) 0%, rgba(10,31,68,.7) 100%);
}
.hero-slider .carousel-caption {
    bottom: 80px; text-align: left; left: 10%; right: 10%;
}
.hero-slider .carousel-caption h2 {
    color: #fff; font-size: 2.4rem; text-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.hero-slider .carousel-caption p {
    color: #fff; font-size: 1.15rem; max-width: 600px;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.hero-slider .carousel-caption h2::after {
    content: ''; display: block; width: 80px; height: 4px;
    background: var(--telrad-accent); margin-top: 12px;
}

/* ============ EQUIPO DIRECTIVO ============ */
.team-row {
    background: #fff; border-radius: 8px; padding: 20px;
    margin-bottom: 18px; box-shadow: 0 2px 8px rgba(19,41,75,.06);
    border-left: 4px solid var(--telrad-accent);
    display: flex; flex-wrap: wrap; gap: 24px;
    align-items: flex-start; transition: transform .2s;
}
.team-row:hover { transform: translateY(-2px); }
.team-row .team-photo { flex: 0 0 160px; max-width: 160px; }
.team-row .team-photo img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    border-radius: 6px; box-shadow: 0 2px 6px rgba(19,41,75,.1);
}
.team-row .team-info { flex: 1 1 0; min-width: 240px; }
.team-row .team-info h5 { margin: 0 0 4px; color: var(--telrad-primary); font-size: 1.15rem; }
.team-row .team-info .cargo {
    color: var(--telrad-accent-dk); font-weight: 600;
    font-size: .9rem; margin-bottom: 10px;
}
.team-row .team-info .descripcion { color: var(--telrad-text); font-size: .92rem; line-height: 1.55; }
.team-row .team-info .descripcion p:last-child { margin-bottom: 0; }
@media (max-width: 575px) {
    .team-row { flex-direction: column; align-items: center; text-align: center; }
    .team-row .team-photo { flex: 0 0 140px; max-width: 140px; }
}

/* ============ GALERIA PRODUCTO/SERVICIO (carrusel corregido) ============ */
.media-gallery {
    background: #0a1f44;
    border-radius: 6px;
    overflow: hidden;
}
.media-gallery .carousel { position: relative; }
.media-gallery .carousel-item {
    height: 420px;
    text-align: center;
}
.media-gallery .carousel-item.active,
.media-gallery .carousel-item-next,
.media-gallery .carousel-item-prev {
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-gallery .carousel-item img {
    max-width: 100%; max-height: 420px;
    width: auto; height: auto;
    object-fit: contain;
    margin: 0 auto; display: block;
}
.media-gallery .carousel-item video {
    max-width: 100%; max-height: 420px;
    width: auto; height: auto;
    display: block; margin: 0 auto; background: #000;
}
.media-gallery .carousel-control-prev,
.media-gallery .carousel-control-next { width: 8%; }
.media-gallery .carousel-control-prev-icon,
.media-gallery .carousel-control-next-icon {
    background-color: rgba(0,0,0,.55);
    border-radius: 50%; padding: 18px;
    background-size: 55%;
}
.media-gallery .carousel-indicators { margin-bottom: .5rem; }
.media-gallery .carousel-indicators button {
    background-color: rgba(255,255,255,.7);
    width: 10px; height: 10px; border-radius: 50%;
}

/* ============ FORMULARIOS ============ */
.form-control, .form-select {
    border-radius: 4px; padding: 10px 14px; border: 1px solid #d0d6de;
}
.form-control:focus, .form-select:focus {
    border-color: var(--telrad-accent);
    box-shadow: 0 0 0 .2rem rgba(132,196,65,.15);
}
.form-control.is-invalid, .form-select.is-invalid { border-color: #c0392b; }
.invalid-feedback { color: #c0392b; font-size: .85rem; }
.alert-ok  { background: #e9f5db; color: #436b1a; border: 1px solid #c8e69b; padding: 12px 16px; border-radius: 4px; }
.alert-err { background: #fbeaea; color: #8a2424; border: 1px solid #f1c4c4; padding: 12px 16px; border-radius: 4px; }

/* ============ FOOTER ============ */
.site-footer { margin-top: 40px; }
.footer-banner {
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--telrad-primary);
    width: 100%;
}
.footer-banner.fit-cover   { background-size: cover; }
.footer-banner.fit-contain { background-size: contain; }
.footer-banner.fit-center  { background-size: auto; }
.footer-content {
    background: var(--telrad-primary);
    color: #fff;
    padding: 16px 0;
    font-size: .9rem;
    border-top: 1px solid rgba(255,255,255,.12);
}
.footer-content a { color: var(--telrad-accent); }
.footer-content strong { color: #fff; }

/* ============ MAPA ============ */
.map-frame { width: 100%; height: 350px; border: 0; border-radius: 6px; }

@media (max-width: 767px) {
    .hero-slider .carousel-item { height: 320px; }
    .hero-slider .carousel-caption h2 { font-size: 1.4rem; }
    .nav-main .nav-link { padding: 12px 16px !important; }
    .media-gallery .carousel-item { height: 280px; }
    .media-gallery .carousel-item img,
    .media-gallery .carousel-item video { max-height: 280px; }
}

/* ============ ADMIN: drag and drop ============ */
.sortable-ghost { opacity: .4; background: #eef5d8 !important; }
.sortable-drag  { background: #fff; }
.drag-handle { cursor: grab; color: #999; }
.drag-handle:active { cursor: grabbing; }
tr.sortable-row td { vertical-align: middle; }
