/*
==================================================
CSS PERSONALIZADO PARA WORDPRESS
==================================================
Estilos adicionales específicos para las plantillas de WordPress
*/

/* Page Header Styles */
.page-header {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../img/carousel-1.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.page-header .breadcrumb {
    background-color: transparent;
}

.page-header .breadcrumb-item a {
    color: #ffffff;
    text-decoration: none;
}

.page-header .breadcrumb-item a:hover {
    color: #009CFF;
}

.page-header .breadcrumb-item.active {
    color: #009CFF;
}

.page-header .breadcrumb-item+.breadcrumb-item::before {
    color: #ffffff;
}

/* Entry Content Styles */
.entry-content {
    font-size: 16px;
    line-height: 1.8;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.entry-content img {
    max-width: 100%;
    height: auto;
}

.entry-content blockquote {
    border-left: 4px solid #009CFF;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #6c757d;
}

/* Blog Post Meta */
.entry-content .page-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

/* Tags */
.tags {
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.tags strong {
    color: #009CFF;
    margin-right: 0.5rem;
}

/* Comments */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

/* Sidebar Widgets */
.sidebar .widget {
    margin-bottom: 2rem;
}

.sidebar .widget ul {
    list-style: none;
    padding: 0;
}

.sidebar .widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.sidebar .widget ul li:last-child {
    border-bottom: none;
}

.sidebar .widget ul li a {
    color: #212529;
    text-decoration: none;
}

.sidebar .widget ul li a:hover {
    color: #009CFF;
}

/* Portfolio Items */
.portfolio-item {
    position: relative;
    overflow: hidden;
}

.portfolio-item img {
    transition: 0.5s;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: 0.5s;
}

.portfolio-item:hover .portfolio-btn {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .page-header {
        padding: 60px 0 !important;
    }

    .page-header h1 {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 767.98px) {
    .page-header h1 {
        font-size: 2rem !important;
    }
}

/* WordPress Alignment Classes */
.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1.5rem 0;
}

.alignright {
    float: right;
    margin: 0.5rem 0 1.5rem 1.5rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* WordPress Gallery */
.gallery {
    margin: 1.5rem 0;
}

.gallery-item {
    display: inline-block;
    text-align: center;
    vertical-align: top;
    width: 100%;
    padding: 0.5rem;
}

.gallery-columns-2 .gallery-item {
    max-width: 50%;
}

.gallery-columns-3 .gallery-item {
    max-width: 33.33%;
}

.gallery-columns-4 .gallery-item {
    max-width: 25%;
}

/* Blog section: card-footer como flex container para que align-self funcione */
#blog .card-footer {
    display: flex;
    flex-direction: column;
}

/* Team/Blog card: "Leer más" text link */
.team-leer-mas {
    color: inherit;
    text-decoration: none;
    display: block;
    text-align: right;
    align-self: flex-end;
}

.team-leer-mas:hover {
    color: #009CFF;
    text-decoration: none;
}

/* Contact section: remove decorative underlines from title */
.section-title-no-deco::before,
.section-title-no-deco::after {
    display: none;
}

/* FAQ: text align left on mobile */
@media (max-width: 767.98px) {
    #faqs-accordion .btn-link {
        text-align: left;
        white-space: normal;
    }
}

/* Service cards: ensure h3 title is left-aligned */
#service .product-item h3 {
    justify-content: flex-start;
    text-align: left;
    min-height: auto;
}

/* ── Equipo ──────────────────────────────────────────────────────────────── */

.team-contact-card .team-info {
    background-color: #ffffff;
}

/* En móvil: anular sticky del equipo y contacto */
@media (max-width: 991.98px) {
    #team .col-lg-6 {
        position: static !important;
        align-self: auto !important;
        top: auto !important;
    }
}

/* ── Formulario de contacto ──────────────────────────────────────────────────
 *
 * color-scheme: only light le indica a Chrome/Brave que este formulario SOLO
 * soporta modo claro. Esto impide que "Auto Dark Mode for Web Contents" de
 * Chromium fuerce colores de dark mode sobre los controles nativos, incluso
 * cuando el SO está en modo oscuro.
 *
 * Por qué "only light" y no solo "light":
 *   light       = prefiero claro pero acepto que el navegador fuerce oscuro
 *   only light  = SOLO soporto claro; el navegador NO debe forzar oscuro
 * ─────────────────────────────────────────────────────────────────────────── */

#contactForm {
    color-scheme: only light;
}

#contactForm input,
#contactForm textarea,
#contactForm select {
    appearance: none;
    -webkit-appearance: none;
    color-scheme: only light;
    background-color: #ffffff;
    color: #212529;
    border: 1px solid #ced4da;
}

/* Bootstrap fija height en .form-control para inputs de una línea.
   En <select> con appearance:none esa altura clipeaba el texto, por eso
   se usa height:auto. Para igualar visualmente a los <input> con py-4
   (que renderizan a ~50px), se reduce el padding vertical del select:
     input:  48px padding + 2px border = 50px (Bootstrap height ignorado)
     select: 12px + 24px line-height + 12px + 2px border = 50px ✓ */
#contactForm select.form-control {
    height: auto;
}

#telefono {
    height: auto;
}

#contactForm input::placeholder,
#contactForm textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}

/* Flecha personalizada para los selects */
#contactForm select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 12px;
    cursor: pointer;
    padding-right: 2rem;
}

#contactForm select option {
    background-color: #ffffff;
    color: #212529;
}

/* Fix autofill Chrome/Brave: el navegador inyecta su propio fondo amarillo/azul.
   El truco de box-shadow inset lo sobreescribe. Solo funciona en <input>, no en <select>. */
#contactForm input:-webkit-autofill,
#contactForm input:-webkit-autofill:hover,
#contactForm input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
    -webkit-text-fill-color: #212529;
}

/* ── Contact Form 7 ──────────────────────────────────────────────────────────
 * CF7 envuelve cada campo en <span class="wpcf7-form-control-wrap"> que por
 * defecto es display:inline. Esto hace que los inputs requeridos (nombre,
 * email) no ocupen el ancho completo de su col-sm-6. */
.contact-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* Aplicar los mismos estilos que #contactForm a los campos CF7.
   Se excluye input[type="submit"] para no pisar el color azul de btn-primary.
   height: auto sobreescribe el height fijo de Bootstrap (.form-control) para
   que py-4 tenga efecto real y todos los campos queden a la misma altura. */
.contact-form .wpcf7 input:not([type="submit"]),
.contact-form .wpcf7 textarea,
.contact-form .wpcf7 select {
    color-scheme: only light;
    background-color: #ffffff;
    color: #212529;
    border: 1px solid #ced4da;
    width: 100%;
    height: auto;
}

/* El <select> nativo queda oculto por Choices.js — no necesita option styling. */

.contact-form .wpcf7 input:-webkit-autofill,
.contact-form .wpcf7 input:-webkit-autofill:hover,
.contact-form .wpcf7 input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
    -webkit-text-fill-color: #212529;
}

/* ── Choices.js – estilos para que coincida con form-control py-4 px-3 ────────
 * Choices.js reemplaza el <select> nativo con HTML puro, eliminando el bug
 * de modo oscuro de GTK en Chromium/Linux. */

/* Contenedor principal: sin borde propio, ocupa todo el ancho */
.contact-form .choices {
    width: 100%;
    margin-bottom: 0;
}

/* El "input" visual — replica .form-control.py-4.px-3.
   !important necesario para ganarle al CSS propio de Choices.js que viene del CDN. */
.contact-form .choices__inner {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    padding: 1.5rem 2.5rem 1.5rem 1rem !important; /* py-4 + espacio para la flecha */
    font-size: 1rem !important;
    color: #495057 !important;
    min-height: unset !important;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    line-height: 1.5 !important;
}

.contact-form .choices__inner:hover {
    border-color: #adb5bd;
}

/* Texto del item seleccionado */
.contact-form .choices__list--single {
    padding: 0;
}

.contact-form .choices__list--single .choices__item {
    color: #495057;
    font-size: 1rem;
    padding: 0;
}

/* Flecha personalizada (igual al SVG que se usaba antes) */
.contact-form .choices[data-type*="select-one"]::after {
    border-color: #495057 transparent transparent transparent;
    border-width: 6px 5px 0;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
}

.contact-form .choices[data-type*="select-one"].is-open::after {
    border-color: transparent transparent #495057 transparent;
    border-width: 0 5px 6px;
    margin-top: 0;
}

/* Dropdown panel */
.contact-form .choices__list--dropdown,
.contact-form .choices__list[aria-expanded] {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    z-index: 9999;
}

/* Cada opción */
.contact-form .choices__list--dropdown .choices__item,
.contact-form .choices__list[aria-expanded] .choices__item {
    background-color: #ffffff;
    color: #212529;
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* Hover sobre opción */
.contact-form .choices__list--dropdown .choices__item--selectable.is-highlighted,
.contact-form .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background-color: #009CFF;
    color: #ffffff;
}

/* Opción actualmente seleccionada */
.contact-form .choices__list--dropdown .choices__item--selectable.is-selected,
.contact-form .choices__list[aria-expanded] .choices__item--selectable.is-selected {
    background-color: #e9f5ff;
    color: #007bcc;
}

/* Focus del contenedor */
.contact-form .choices.is-focused .choices__inner,
.contact-form .choices.is-open .choices__inner {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 156, 255, 0.25);
}

