/* Reset y estilos base */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --border-color: #bdc3c7;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f1c40f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.2;
    color: var(--text-color);
    background-color: #f7f7f7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* padding-top: 60px; */ /* Añadir esto para el espacio de la barra superior */
}

.container {
    max-width: 2560px;
    margin: 0px auto 70px auto; /* Reducir el margen superior ya que body tiene padding-top */
    padding: 15px;
}

@media (min-width: 2560px) {
    .container {
        max-width: 98%; /* Usar casi todo el ancho de pantalla */
    }
}

/* Header y Navegación */
.header {
    text-align: center;
    border-bottom: 0px solid var(--primary-color);
    margin-bottom: 15px;
    padding: 15px 0;
}

.header h1 {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Contenedor de anuncios clasificados */
.classified-container {
    column-gap: 8px;
    column-rule: 0px solid var(--border-color);
    margin-bottom: 15px;
}

/* Responsive columns */
@media (min-width: 320px) {
    .classified-container { column-count: 2; }
}
@media (min-width: 768px) {
    .classified-container { column-count: 4; }
}
@media (min-width: 1024px) {
    .classified-container { column-count:6; }
}
@media (min-width: 1280px) {
    .classified-container { column-count: 8; }
}
@media (min-width: 1536px) {
    .classified-container { column-count: 12; }
}
@media (min-width: 2560px) {
    .classified-container { column-count: 14; }
}

/* Categorías */
.category {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 12px;
}

.category-header {
/*    background: var(--primary-color); */
    background: #00acee;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 6px;
    margin-bottom: 4px;
}

/* Anuncios */
.ad {
	position: relative;
    font-size: 11px;
    border-bottom: 1px solid var(--border-color);
    padding: 4px;
    margin-bottom: 4px;
    break-inside: avoid;
}

.ad-footer {
    display: flex;
/*    justify-content: flex-end; */
    justify-content: flex-start;
    padding-left: 0;  /* Asegura que no haya padding a la izquierda */
    margin-left: 0;   /* Asegura que no haya margin a la izquierda */    
    margin-top: 5px;
}

.ad-reference {
    font-size: 10px;
    color: #a8a8a8 !important;
    font-family: monospace;
/*    background-color: #f5f5f5; */
    padding: 0px 0px;
    border-radius: 2px;
    border: 0px solid #e0e0e0;
    padding-left: 0;  /* Asegura que no haya padding a la izquierda */
    margin-left: 0;   /* Asegura que no haya margin a la izquierda */
    margin-top: 5px;
}

.ad * {
    color: #000 !important;
    text-decoration: none !important;
}

.ad i {
    color: #666666 !important;
}

.ad-title {
    font-weight: bold;
    margin-bottom: 2px;
}

.ad-description,
.ad-price,
.ad-location,
.ad-icons * {
    font-weight: normal;
}

.ad-contact {
    margin-top: 2px;
    pointer-events: none;
}

.ad .ad-footer .ad-reference {
    color: #a8a8a8 !important;
}

/* Anuncios comerciales */
.commercial-ad {
    background: white; /* var(--light-gray); */
    /* border: 0px solid var(--border-color); */
    margin: 0px 0;
    break-inside: avoid;
    padding: 0px;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* box-sizing: border-box; */ /* Importante para móviles */
}

.commercial-ad .ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%; /* Asegura que no se desborde */
}

.commercial-ad img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
    object-fit: contain;
}

/* Formularios */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Dashboard */
.dashboard-container {
    padding: 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tablas */
.ads-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.ads-table th,
.ads-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.ads-table th {
    background: var(--light-gray);
    font-weight: 600;
}

/* Estados */
.status-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.status-active {
    background: var(--success-color);
    color: white;
}

.status-pending {
    background: var(--warning-color);
    color: var(--text-color);
}

.status-expired {
    background: var(--error-color);
    color: white;
}

/* Alertas */
.alert {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-error {
    background: var(--error-color);
    color: white;
}

/* Footer */
.footer {
    text-align: center;
    font-size: 11px;
    color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 30px;
}

/* Todo el CSS anterior hasta el footer se mantiene igual */

/* Estilos de usuario y admin */
.user-info {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
}

.user-info span {
    display: none; /* Ocultar el nombre de usuario */
}

.user-info i {
    font-size: 18px; /* Tamaño del icono */
}

.user-guest {
    color: #e0e0e0 !important; /* Gris muy claro */
}

.user-logged {
    color: #2ecc71 !important; /* Verde */
}

.user-admin {
    color: #00acee !important; /* Azul oficial icono user admin */
}

.admin-badge {
    background: #dc3545;
    color: white !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.admin-link {
    background: #dc3545 !important;
    color: white !important;
}

.admin-link:hover {
    opacity: 0.9;
}

/* Estilos de anuncios y destacados */
.highlighted {
    background-color: #ffffd0 !important;
}

.icon-btn {
    cursor: pointer;
    color: #000 !important; /* Asegurar que los iconos también sean negros */
}

.fab.fa-whatsapp,
.fab.fa-youtube,
.fas.fa-phone,
.fas.fa-envelope,
.fas.fa-link,
.fas.fa-images,
.fas.fa-map-marker-alt {
    color: #666666 !important;
}

/* Estilos del popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup button {
    display: block;
    margin: 15px auto 0;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.popup button:hover {
    background: #2980b9;
}

.popup img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.popup a {
    color: #3498db;
    text-decoration: none;
}

.popup a:hover {
    text-decoration: underline;
}

/* Añadir estilos para el precio */
.ad-price {
    color: #000 !important; /* Negro en lugar de verde */
    font-weight: normal !important; /* Quitar negrita */
    margin: 4px 0;
}

.ad-icons {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start; /* Alinear todo a la izquierda */
}

.ad-icons i {
    color: #666666 !important; /* Un gris medio */
    cursor: pointer;
}

.ad-location {
    /* Quitamos margin-left: auto; para que no se alinee a la derecha */
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ad-location i {
    margin-right: 4px; /* Espacio entre el icono y el texto */
}

.gallery-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.gallery-item {
    flex: 0 1 300px;
}

.video-content {
	padding: 20px;
    text-align: center;
}

.video-content iframe {
    max-width: 100%;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.youtube-mobile-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.youtube-mobile-link img {
    width: 100%;
    height: auto;
    display: block;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
}

.play-button i {
    font-size: 24px;
    margin-right: 8px;
}

@media (max-width: 768px) {
    .video-content {
        width: 90%;
        max-width: 400px;
    }
}

/* Estilos para el popup del iPhone */
.iphone-call-screen {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.iphone-number {
    font-size: 32px;
    margin: 20px 0;
    color: #000;
    font-weight: 400;
}

.iphone-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
}

.iphone-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

.call-button {
    background-color: #4CD964;
}

.end-call-button {
    background-color: #FF3B30;
}

/* Estilos para el popup de WhatsApp */
.whatsapp-screen {
    background-color: #ECE5DD;
    border-radius: 20px;
    padding: 20px;
    width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.whatsapp-header {
    background-color: #075E54;
    color: white;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.whatsapp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #128C7E;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-chat {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.whatsapp-message {
    background-color: #DCF8C6;
    padding: 10px;
    border-radius: 10px;
    margin: 10px 0;
    max-width: 80%;
    position: relative;
}

.whatsapp-input {
    background-color: white;
    border-radius: 20px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* Estilos para la galería de imágenes */
.gallery-popup {
    background-color: rgba(0, 0, 0, 0.95);
    padding: 20px;
    border-radius: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    color: white;
}

.gallery-close {
    color: white;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

.gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    position: relative;
}

.gallery-main-image {
    max-height: 70vh;
    max-width: 90%;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%); 
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.gallery-nav button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.3s;
}

.gallery-nav button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gallery-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    overflow-x: auto;
}

.gallery-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s;
}

.gallery-thumbnail.active {
    border-color: white;
    opacity: 1;
}

/* Estilos para el mensaje de error de YouTube */
.youtube-error {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.youtube-error-icon {
    color: #FF0000;
    font-size: 48px;
    margin-bottom: 20px;
}

.youtube-error-title {
    color: #333;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 10px;
}

.youtube-error-message {
    color: #666;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 20px;
}

.youtube-error-button {
    background-color: #FF0000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.youtube-error-button:hover {
    background-color: #CC0000;
}
.youtube-popup {
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
    width: 90vw;
    max-width: 800px;
}

.youtube-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #FF0000;
    color: white;
}

.youtube-logo {
    font-size: 24px;
    margin-right: 10px;
}

.youtube-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.youtube-mobile-preview {
    position: relative;
    width: 100%;
    background-color: #000;
}

.youtube-mobile-preview img {
    width: 100%;
    height: auto;
}

.youtube-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.youtube-play-button:hover {
    background-color: #FF0000;
}

/* Estilos específicos para email y url */
.email-screen, .url-screen {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
}

.email-header, .url-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.email-content, .url-content {
    margin-top: 15px;
    text-align: center;
}

.email-button, .url-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background-color: #4A90E2;
    color: white !important;
    border-radius: 25px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.email-button:hover, .url-button:hover {
    background-color: #357ABD;
    text-decoration: none !important;
}

/* Ajustes del popup existente */
.popup-content {
    background: transparent;
    padding: 20px;
    border-radius: 8px;
    min-width: 200px;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    overflow: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.popup-content.gallery-mode {
    max-width: none;
    width: 100%;
    height: 100%;
    background: none;
    padding: 0;
}

.popup-content.youtube-mode {
    max-width: 800px;
    background: transparent;
    padding: 0;
    border-radius: 8px;
}

.url-button, .email-button {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Centrar contenido */
    gap: 8px; /* Espacio entre icono y texto */
    padding: 12px 15px;
    background-color: #4A90E2;
    color: white !important;
    border-radius: 25px;
    text-decoration: none;
    transition: background-color 0.3s;
    max-width: 100%; /* Limitar el ancho máximo */
    overflow: hidden; /* Ocultar contenido que desborde */
    text-overflow: ellipsis; /* Mostrar ... para texto truncado */
    white-space: nowrap; /* Evitar saltos de línea */
}

/* Ajustes para la versión móvil */
@media (max-width: 480px) {
    .url-button, .email-button {
        max-width: 220px; /* Ancho fijo en móviles */
        font-size: 14px; /* Reducir tamaño de fuente */
    }
    
    .youtube-play-button {
        max-width: 85%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 15px;
    }
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px; /* Altura aumentada */
    background: white;
    box-shadow: 0 0px 0px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: flex-start; /* Asegura que los elementos se alineen a la izquierda */
    align-items: flex-end; /* Alinea los elementos verticalmente al borde inferior */
    padding: 0 0px; /* Padding reducido en ambos lados */
}

/* mtz
.nav-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background-color: #f7f7f7;
}
*/
.nav-container {
    display: flex;
    align-items: center; /* Centra verticalmente logo, buscador y menú */
    justify-content: space-between;
    width: 100%;
    padding-bottom: 5px;
    gap: 10px; /* Espacio mínimo entre elementos */
}

.logo {
    text-decoration: none;
    color: #333;
    font-size: 1.2em;
    font-weight: bold;
    margin-left: -10px; /* Logo más a la izquierda */
    vertical-align: bottom; /* mtz */
}

.hamburger-menu {
    margin-left: auto; /* Empujar hasta la derecha */
    margin-right: -15px; /* Menú más a la derecha */
    cursor: pointer;
    padding: 10px;
    font-size: 2em;
}

/* Menú lateral */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 2em;
}

.menu-content {
    padding: 15px;
}

.menu-section {
    margin-bottom: 20px;
}

.menu-section h3 {
    margin-bottom: 10px;
    color: #666;
}

.menu-section a {
    display: block;
    padding: 8px 0;
    color: #333;
    text-decoration: none;
}

/* Barra inferior */ 
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px; /* altura del area de la barra de iconos footer */
    background: #f7f7f7;
    box-shadow: 0 0px 1px rgba(0,0,0,0.3); 
    z-index: 1000;
    transition: transform 0.3s ease-in-out; 
}

/* Esta es la nueva clase que la esconderá */
.bottom-nav--hidden {
    transform: translateY(100%);
} 

.nav-icons {
    height: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-icon {
    color: #666;
    text-decoration: none;
    font-size: 1.3em; /* tamaño de los iconos de la barra footer */
}

.nav-icon i {
    pointer-events: none; /* Asegura que el evento click se maneja en el padre */
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Cambiar de center a flex-start */
    padding-top: 40px; /* Añadir padding superior */
    min-height: calc(100vh - 150px);
}

.auth-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.auth-form button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.profile-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.profile-form .form-group {
    margin-bottom: 20px;
}

.profile-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.profile-stats {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profile-stats h3 {
    margin-bottom: 15px;
    color: #333;
}

.profile-stats p {
    margin-bottom: 10px;
    color: #666;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.user-profile-link {
    cursor: pointer;
}

/* mtz 9 */
.search-container {
    margin: 20px auto;
    padding: 0 15px;
    max-width: 800px;
}

.search-box {
    position: relative;
    width: 100%;
}

/*
.search-box input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 0px solid #fff;
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: 0 0px 0px rgba(0,0,0,0.1);
}
*/
.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px; /* Padding más equilibrado */
    height: 40px; /* Altura fija para alinearse con el logo */
    margin: 0;
}

.search-box input:focus {
    border-color: #fff;
    box-shadow: 0 0px 0px rgba(0,123,255,0.2);
    outline: none;
}

.search-box .fa-search {
    position: absolute;
    left: 20px;
    top: 50%;
    /* transform: translateY(-50%); */
    color: #666;
    font-size: 18px;
}

.ad.hidden {
    display: none;
}

.category.empty {
    display: none;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.search-box {
    flex: 1;
    margin: 0 20px;
    position: relative;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 8px 15px 8px 35px;
    border: 0px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.search-box input:focus {
    border-color: #fff;
    box-shadow: 0 0 0px rgba(0,123,255,0.2);
    outline: none;
}

.search-box .fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    /* transform: translateY(-50%); */
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .search-box {
        max-width: 200px;
        margin: 0 10px;
    }
    
    .search-box input {
        padding: 6px 12px 6px 30px;
        font-size: 13px;
    }
    
    .search-box .fa-search {
        font-size: 15px;
        left: 10px;
    }
    
    .commercial-ad {
        padding: 0px; /* Menos padding en móviles */
        margin: 0px 0;
    }
    
    .commercial-ad .ad-content {
        width: 100vw; /* viewport width */
        max-width: calc(100vw - 20px); /* Ajuste para evitar scroll horizontal */
        margin: 0 auto;
    }
    
    .commercial-ad img {
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .search-box {
        max-width: 150px;
        margin: 0 8px;
    }
    
    .logo img {
        height: 40px;
    }
    
    .commercial-ad {
        padding: 0px;
        margin: 0px 0;
    }

    .commercial-ad .ad-content {
        max-width: calc(100vw - 10px);
    }
}

.ad.hidden {
    display: none;
}

.category.empty {
    display: none;
}

.search-overlay {
    display: none;
    position: fixed; /* Ya está fixed */
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Añadimos sombra */
    /* Asegurar que se mantiene por encima de otros elementos */
    position: sticky;
    position: -webkit-sticky;
}

.search-overlay .search-box {
    position: relative;
    width: 80%;
    max-width: 600px;
    animation: slideDown 0.3s ease;
}

.search-overlay .search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 0px solid #fff;
    border-radius: 20px;
    font-size: 16px;
    background-color: #fff;
}

.search-overlay .search-box .close-search {
    position: absolute;
    right: 12px;
    top: 50%;
    /* transform: translateY(-50%); */
    cursor: pointer;
    color: #666;
    font-size: 18px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        /* transform: translateY(-10px); */
    }
    to {
        opacity: 1;
        /* transform: translateY(0); */
    }
}

.search-overlay.active {
    display: flex;
}

/* Estilos para páginas legales */
.legal-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.legal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.legal-content h1 {
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.legal-content h2 {
    color: #34495e;
    font-size: 1.6em;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.legal-content h3 {
    color: #2c3e50;
    font-size: 1.3em;
    margin: 20px 0 10px;
}

.legal-content p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #444;
}

.legal-content ul, 
.legal-content ol {
    margin: 15px 0;
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.legal-content section {
    margin-bottom: 30px;
}

/* Estilos para la página de contacto */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.contact-item {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    /* /* transform: translateY(-2px); */ */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.contact-item i {
    font-size: 2em;
    color: #3498db;
    margin-bottom: 15px;
}

.contact-form {
    max-width: 800px;
    margin: 30px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Estilos para la guía de usuario */
.guide-step {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.guide-step ol,
.guide-step ul {
    margin: 10px 0;
    padding-left: 25px;
}

.guide-step li {
    margin-bottom: 10px;
}

/* Estilos para las secciones de información */
.company-info,
.legal-contact,
.help-contact {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.last-updated {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

/* Estilos responsive */
@media (max-width: 768px) {
    .legal-container {
        margin: 20px auto;
        padding: 0 15px;
    }

    .legal-content {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos para los botones del formulario */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Estilos para el checkbox de privacidad */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Enlaces dentro del contenido legal */
.legal-content a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-content a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Estilos para las notificaciones de estado */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-active {
    background: #27ae60;
    color: white;
}

.status-pending {
    background: #f1c40f;
    color: #2c3e50;
}

.status-expired {
    background: #e74c3c;
    color: white;
}

/* Estilos para opciones premium */
.premium-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.premium-option {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
}

.premium-option input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.premium-text {
    font-weight: bold;
    margin-right: 10px;
}

.premium-price {
    color: #2ecc71;
    font-weight: bold;
    margin-left: auto;
}

.premium-description {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Estilos para anuncios con opciones premium */
.ad.premium-border {
    border: 2px solid #000;
    padding: 3px;
}

.ad.premium-background {
/*    background-color: #eafce4; es el color del background fondo premium*/
    background-color: #fef3dd; /* #f0f4fa; */   
}

/* Añadir indicador visual para anuncios en posición premium */
.ad.premium-position {
    position: relative;
}

.ad.premium-position::before {
    content: "⭐";
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2em;
    color: #FFD700;
}

/* Mejorar visualización de opciones premium */
.premium-options .premium-option {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.premium-options .premium-option:hover {
    background-color: #f8f9fa;
}

/* Estilos específicos para vista de categoría manteniendo dimensiones originales */
.classified-container[data-category-view="true"] {
    column-count: initial !important;
    column-gap: initial !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0px 0px !important;
    padding: 0px !important;
    overflow-x: hidden !important;
}

.classified-container[data-category-view="true"] .category {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 0px !important;
}

/* Estilos específicos para anuncios comerciales */
.classified-container[data-category-view="true"] .commercial-ad {
    width: auto !important; /* Cambio importante */
    max-width: none !important;
    break-inside: avoid !important;
    display: inline-block !important;
    margin: 0px !important;
}

.classified-container[data-category-view="true"] .commercial-ad .ad-content {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

/* Ajustes específicos para iPhone */
@media (min-width: 320px) {
    .classified-container[data-category-view="true"] .category {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* 2 columnas de igual tamaño */
        gap: 5px !important; /* Espacio entre columnas */
        width: calc(100%) !important; /* Considera los márgenes */
        margin: 0 auto !important; /* Centrado */
        padding: 0 !important;
        box-sizing: border-box !important;
    }
 
     /* Hacer que el primer elemento (categoría) ocupe solo la primera columna */
    .classified-container[data-category-view="true"] .category-header {
        grid-column: 1 / 2 !important; /* Ocupa solo la primera columna */
        width: 100% !important; /* Ajusta el ancho al de la columna */
        margin: 0 0 6px 0 !important; /* Sin margen derecho */
        text-align: left !important; /* Alineación centrada */
    }
    
    .classified-container[data-category-view="true"] .ad {
        width: 100% !important;
        margin: 0 !important;
        padding: 4px !important;
        box-sizing: border-box !important;
    }
    
    .classified-container[data-category-view="true"] .commercial-ad {
        width: 100% !important;
        margin: 4px auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .classified-container[data-category-view="true"] .commercial-ad .ad-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;

    }
}

/* ------------------ MTZ ON ----------------------------------------------------- */
/* iPad horizontal - 6 columnas */
@media (min-width: 1024px) and (max-width: 1279px) {
    .dynamic-column-ipad-landscape-6 {
        width: calc(16.666% - 4.167px) !important; /* (5px gap * 5) / 6 columnas */
    }
}
/* 1024px - 6 columnas */
@media (min-width: 1024px) and (max-width: 1279px) {
    .dynamic-column-desktop-6 {
        width: calc(16.666% - 4.167px) !important;
    }
}
/* 1280px - 8 columnas */
@media (min-width: 1280px) and (max-width: 1535px) {
    .dynamic-column-desktop-large {
        width: calc(12.5% - 4.375px) !important; /* (5px gap * 7) / 8 columnas */
    }
}
/* 1536px - 10 columnas */
@media (min-width: 1536px) {
    .dynamic-column-desktop-xlarge {
        width: calc(10% - 4.5px) !important; /* (5px gap * 9) / 10 columnas */
    }
}
/* iMac 27" - 15 columnas */
@media (min-width: 2560px) {
    .dynamic-column-imac-27 {
        width: calc(6.666% - 4.667px) !important; /* (5px gap * 14) / 15 columnas */
    }
}

/* Estilos comunes para las columnas dinámicas */
.dynamic-column-iphone-landscape,
.dynamic-column-ipad-landscape,
.dynamic-column-desktop,
.dynamic-column-desktop-large,
.dynamic-column-desktop-xlarge {
    display: flex !important;
    flex-direction: column !important;
}
/* Estilos para headers de categoría */
.dynamic-column-iphone-landscape .category-header,
.dynamic-column-ipad-landscape .category-header,
.dynamic-column-desktop .category-header,
.dynamic-column-desktop-large .category-header,
.dynamic-column-desktop-xlarge .category-header {
    width: 100% !important;
    margin-bottom: 6px !important;
    background: #00acee !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: bold !important;
    padding: 4px 6px !important;
}

/* Estilos para anuncios y anuncios comerciales */
.classified-container[data-category-view="true"] .ad,
.classified-container[data-category-view="true"] .commercial-ad {
    width: 100% !important;
    margin-bottom: 5px !important;
}

/* 15 columnas (para iMac 27" - 2560px y superior) */
@media (min-width: 2560px) {
    .classified-container {
        column-count: 15 !important;
    }
    
    .classified-container[data-category-view="true"] {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 8px !important;
    }

    .classified-container[data-category-view="true"] .category {
        display: flex !important;
        gap: 8px !important;
        margin: 0 !important;
    }

    /* Nueva clase para 15 columnas */
    .dynamic-column-imac-27 {
        width: calc(6.666% - 7.5px) !important;
        min-width: calc(6.666% - 7.5px) !important;
        max-width: calc(6.666% - 7.5px) !important;
        flex: 0 0 calc(6.666% - 7.5px) !important;
    }

    .classified-container[data-category-view="true"] .ad,
    .classified-container[data-category-view="true"] .commercial-ad {
        width: 100% !important;
        margin-bottom: 8px !important;
        box-sizing: border-box !important;
    }
}

/* 10 columnas (1535px > 1535px) */
@media (min-width: 1535px) {
    .classified-container[data-category-view="true"] {
        width: calc(100% - 16px) !important;
        margin: 0 8px !important;
        padding: 0 !important;
    }

    .classified-container[data-category-view="true"] .category {
        display: flex !important;
        gap: 8px !important;
        margin: 0 !important;
    }

    /* Modificación clave para 4 columnas */
    .dynamic-column-desktop {
        width: calc(25% - 6px) !important;
        min-width: calc(25% - 6px) !important;
        max-width: calc(25% - 6px) !important;
    }

    .classified-container[data-category-view="true"] .ad,
    .classified-container[data-category-view="true"] .commercial-ad {
        width: 100% !important;
        margin-bottom: 8px !important;
        box-sizing: border-box !important;
    }
}

/* 8 columnas (1280px - 1534px) */
@media (min-width: 1280px) and (max-width: 1534px) {
    .classified-container[data-category-view="true"] {
        width: calc(100% - 16px) !important;
        margin: 0 8px !important;
        padding: 0 !important;
    }

    .classified-container[data-category-view="true"] .category {
        display: flex !important;
        gap: 8px !important;
        margin: 0 !important;
    }

    /* Modificación clave para 4 columnas */
    .dynamic-column-desktop {
        width: calc(25% - 6px) !important;
        min-width: calc(25% - 6px) !important;
        max-width: calc(25% - 6px) !important;
    }

    .classified-container[data-category-view="true"] .ad,
    .classified-container[data-category-view="true"] .commercial-ad {
        width: 100% !important;
        margin-bottom: 8px !important;
        box-sizing: border-box !important;
    }
}

/* 6 columnas (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .classified-container[data-category-view="true"] {
        width: calc(100% - 16px) !important;
        margin: 0 8px !important;
        padding: 0 !important;
    }

    .classified-container[data-category-view="true"] .category {
        display: flex !important;
        gap: 8px !important;
        margin: 0 !important;
    }

    /* Modificación clave para 4 columnas */
    .dynamic-column-desktop {
        width: calc(25% - 6px) !important;
        min-width: calc(25% - 6px) !important;
        max-width: calc(25% - 6px) !important;
    }

    .classified-container[data-category-view="true"] .ad,
    .classified-container[data-category-view="true"] .commercial-ad {
        width: 100% !important;
        margin-bottom: 8px !important;
        box-sizing: border-box !important;
    }
}

/* 4 columnas (667px - 1023px) */
@media (min-width: 667px) and (max-width: 1023px) {

    .classified-container {
        width: calc(100% - 16px) !important;
        margin: 0 8px !important;
        padding: 0 !important;
        column-count: 4 !important;
        column-gap: 8px !important;
    }

    .classified-container[data-category-view="true"] {
        width: calc(100% - 16px) !important;
        margin: 0 8px !important;
        padding: 0 !important;
    }

    .classified-container[data-category-view="true"] .category {
        display: flex !important;
        gap: 8px !important;
        margin: 0 !important;
    }

    /* Modificación clave para 4 columnas */
    .dynamic-column-4 {
        width: calc(25% - 6px) !important;
        min-width: calc(25% - 6px) !important;
        max-width: calc(25% - 6px) !important;
        flex: 0 0 calc(25% - 6px) !important;
    }

    .classified-container[data-category-view="true"] .ad,
    .classified-container[data-category-view="true"] .commercial-ad {
        width: 100% !important;
        margin-bottom: 8px !important;
        box-sizing: border-box !important;
    }
}

/* 2 columnas (320px - 666px) */
@media (min-width: 320px) and (max-width: 666px) {
    .classified-container[data-category-view="true"] {
        width: calc(100% - 10px) !important;
        margin: 0 5px !important;
        padding: 0 !important;
    }

    .classified-container[data-category-view="true"] .category {
        display: flex !important;
        gap: 5px !important;
        margin: 0 !important;
        flex-wrap: nowrap !important;
    }

    .dynamic-column,
    .dynamic-column-desktop {
        width: calc(50% - 2.5px) !important;
        flex: 0 0 calc(50% - 2.5px) !important;
        min-width: calc(50% - 2.5px) !important;
        max-width: calc(50% - 2.5px) !important;
    }

    .classified-container[data-category-view="true"] .ad,
    .classified-container[data-category-view="true"] .commercial-ad {
        width: 100% !important;
        margin-bottom: 5px !important;
    }
}
/* ------------------ MTZ OFF ----------------------------------------------------- */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 14px;
    color: #666;
}

.hidden {
    display: none;
}

/* Estilos para la sección de video en el formulario */
.video-upload-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.video-preview-container {
    max-width: 800px;
    margin: 10px auto;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
}

.current-video {
    margin: 15px 0;
}

.current-video video {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: block;
}

/* Estilos para el popup de video */
.video-popup {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    margin: 0 auto;
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-container {
    position: relative;
    height: auto;
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.video-container video {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
}

/* Estilos específicos para videos verticales */
.video-container video[style*="aspect-ratio"] {
    max-height: 85vh; /* Mayor altura para videos verticales */
    width: auto;
}

/* Asegurar que el contenedor del popup se ajuste */
.popup-content.youtube-mode,
.popup-content.video-mode {
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
}

/* Estilos para el icono de video en la lista de anuncios */
.fa-video.icon-btn {
    color: #2196F3;
}

/* Estilos para el loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 14px;
    color: #666;
}

/* Estilos para la sección premium de video */
.premium-video {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.premium-video .file-input {
    margin-top: 10px;
    display: block;
}

.premium-video .file-info {
    display: block;
    margin-top: 5px;
    color: #666;
    font-style: italic;
}

.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

.category-parent .category-header::before {
	content: "";
    background-color: #00acee;
    color: white;
    font-weight: bold;
    /* border-left: 4px solid #1976D2; */
}

.category-child .category-header::before {
    content: "";
    color: white;
    margin-right: 0px;
    background-color: #18bfff;
}

/*
content: "▶";
content: "■";
content: "●";  
content: "▼";
content: "★";
content: "●";  
*/

.category-parent-link {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
}

.category-child-link {
    display: block;
    padding: 8px 15px 8px 30px;
    color: #666;
    text-decoration: none;
    background-color: #f8f9fa;
}

.menu-items a:hover {
    background-color: #f0f0f0;
}

.menu-items .parent-category {
    font-weight: bold;
}

.menu-items .parent-category-disabled {
    color: #999;
    font-weight: normal;
}

.menu-items .parent-category-active,
.menu-items .child-category-active {
    font-weight: bold;
}

.menu-items .child-category-active {
    padding-left: 0px;
    background-color: #f8f9fa;
}

.menu-items .category-link {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: inherit;
}

.menu-items .parent-disabled {
    color: #999;  /* gris para categorías no clickables */
}

.menu-items .child-category {
    padding-left: 0px;
}

.menu-items .menu-active {
    color: #2196F3;  /* azul para la categoría activa */
    background-color: rgba(33, 150, 243, 0.1);
}

.menu-items .category-link:hover {
    background-color: #f0f0f0;
}

.parent-header {
    background-color: #00acee;
    color: white;
    padding: 10px;
    margin-bottom: 10px;
}

.child-header {
    background-color: #00acee;
    color: white;
    padding: 2px;
    margin: 0px 0;
}

.child-category {
    margin-left: 0px;
}

/* -------- ARBOL ON -------------------------------------------------------------- */
.menu-items {
    padding: 0; /* Eliminar cualquier padding del contenedor */
}

.arbol-parent-category {
    font-weight: bold;
    color: #666;
    cursor: default;
    /* padding: 8px 15px; */
    margin: 0; /* Eliminar todos los márgenes */
    padding-left: 15px !important; /* Forzar el padding izquierdo */
}

.arbol-child-category {
    padding: 8px 15px;
    padding-left: 35px !important; /* Aumentar el padding izquierdo para la indentación */
    /* background-color: #f8f9fa; */
    border-left: 2px solid #e9ecef;
}

.arbol-category-link {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    margin: 0; /* Eliminar todos los márgenes */
}

.arbol-category-link:hover {
    background-color: #f0f0f0;
}

.arbol-menu-active {
    background-color: #e9ecef;
    font-weight: bold;
}
/* -------- ARBOL OFF -------------------------------------------------------------- */

/* -------- PRINCIPAL ON -------------------------------------------------------------- */
.principal-category-parent {
    margin-bottom: 30px;
    clear: both; /* Asegura que cada sección padre comience en una nueva línea */
    width: 100%;
}

.principal-parent-header {
    width: 100%;
    border-radius: 4px 4px 0 0;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.principal-children-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-left: 20px;
}

.principal-category-child {
    flex: 1 1 300px; /* Ajusta el ancho mínimo según necesites */
    margin-bottom: 15px;
}

.principal-child-header {
    padding: 8px 15px;
    border-radius: 3px;
    font-size: 1em;
    position: relative;
}

.principal-child-header::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    width: 15px;
    height: 2px;
    background-color: #18bfff;
}

.principal-ads-container {
    margin-top: 10px;
}
/* -------- PRINCIPAL OFF -------------------------------------------------------------- */

.ordenar-padre-hijas-child-row .ordenar-padre-hijas-category-name {
    padding-left: 2rem;
}

.ordenar-padre-hijas-parent-row {
    background-color: #f8f9fa;
    font-weight: 500;
}

.ordenar-padre-hijas-child-row {
    background-color: #ffffff;
}

.ordenar-padre-hijas-ml-4 {
    margin-left: 1rem;
}

/* Estilo para los grupos de radio */
.radio-group {
    display: flex;
    align-items: center;
    gap: 10px; /* Espacio entre opciones de radio */
}
.radio-group .radio-label {
    display: flex;
    align-items: center;
    margin-bottom: 0; /* Sobrescribir el margen por defecto de label si es necesario */
    font-weight: normal;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    margin-right: 5px;
    width: auto; /* Para que no ocupe todo el ancho */
}

/* Estilo para el nuevo icono ORP */
.ad-icons .orp-icon {
    width: 16px;
    height: 10px;
    margin: 0 0px; /* Sin margen horizontal */
}

/* --- ESTILO ESPECÍFICO PARA ICONO ORP DENTRO DEL MODAL --- */
#ventanaModal .ventana-modal-ad-content .ad-icons .orp-icon {
    width: 25px;
    height: 16px;
    margin: 0 0px; /* Sin margen horizontal */
}

/* Estilo para el nuevo icono ORP */
.ad-iconsp orp-iconsp {
    width: 16px;
    height: 9px;
    margin: 0 0px; /* Sin margen horizontal */
}

/* Posicionar el icono "ampliar" dentro del anuncio */
.ad-footer .ad-reference .fa-expand.icon-btn {
    position: absolute;
    bottom: 5px;  /* Distancia desde el borde inferior del contenedor .ad */
    right: 5px;   /* Distancia desde el borde derecho del contenedor .ad */
    z-index: 10;  /* Para asegurar que el icono esté por encima de otros elementos */
    font-size: 13px; /* Mantenemos el tamaño que tenías en el estilo inline del PHP */
    /* El cursor: pointer; ya lo gestiona tu clase .icon-btn */
    /* El color: #000 !important; también lo gestiona tu clase .icon-btn */
}

/* --- mtz 10 Estilos para el top-nav --- */
body {
    padding-top: 80px;
}

.top-nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #f5f5f5;
    border-bottom: 0px solid #f5f5f5;
    padding-left: 15px;
    padding-right: 5px;
    box-sizing: border-box;
    z-index: 1000;
}

.top-nav > div[style*="position: absolute"] {
}

.nav-container {
    display: flex;
    align-items: flex-end;
    width: 100%;
    padding-bottom: 5px;
    gap: 7px;
}

.logo {
    margin-right: auto;
    align-self: flex-end;
}

.logo img {
    display: block;
    height: 40px;
    width: auto;
    vertical-align: bottom;
}

.search-icon,
.hamburger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 0px;
    cursor: pointer;
    align-self: flex-end;
    margin: 0;
    color: #747474;
}

.search-icon .fas {
    font-size: 1.6em;
    line-height: 1;
}

.hamburger-menu .fas {
     font-size: 0.88em;
     line-height: 1;
}

.search-png {
  width: 27px; /* Ajusta el ancho */
  height: 27px; /* Ajusta la altura */
  cursor: pointer; /* Cambia el cursor a una mano al pasar el ratón */
  margin-right: 7px; /* Añade margen derecho */
}

@media (min-width: 768px) {
    .nav-container {
        justify-content: center; /* En PC intenta centrar todo */
        position: relative;
    }
    
    .logo {
        position: absolute;
        left: 15px;
    }
    
    .hamburger-menu {
        position: absolute;
        right: 15px;
    }
    
    #searchOverlay {
        margin: 0 auto; /* Centra el buscador en el medio de la pantalla */
        width: 100% !important;
    }
}

/* --- CSS DE RESCATE V2 (Corregido márgenes e invasión) --- */

/* 1. CONTENEDOR: Añadimos PADDING para separar del borde de la pantalla */
.nav-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100%;
    position: relative;
    
    /* ESTAS DOS LÍNEAS ARREGLAN QUE EL LOGO SE PEGUE A LA IZQUIERDA: */
    padding-left: 25px !important; 
    padding-right: 15px !important; 
    
    /* ESTA LÍNEA SEPARA LOS ELEMENTOS PARA QUE NO SE COMAN: */
    gap: 15px !important; 
}

/* 2. LOGO: Le prohibimos encogerse */
.logo {
    display: block !important;
    flex-shrink: 0 !important; /* IMPORTANTE: Esto evita que la barra lo aplaste */
    position: relative !important;
    left: auto !important;
    top: auto !important;

    /* TU IDEA: Margen a la derecha para separar la barra */
    margin-right: 5px !important; 
    /* CRÍTICO: Esto es el escudo para que la barra no lo aplaste */
    flex-shrink: 0 !important; 
}

/* 3. BUSCADOR: Flexible, pero sin márgenes extraños */
#searchOverlay {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    
    flex-grow: 1 !important; /* Ocupa el espacio sobrante */
    width: auto !important;
    height: auto !important;
    
    min-width: 0 !important; 
    
    /* Quitamos márgenes manuales porque el 'gap' de arriba ya hace el trabajo */
    margin: 0 !important; 
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 4. INPUT: Diseño de la caja */
.search-box {
    width: 100% !important;
    /* position: relative; */
}

.search-box input {
    width: 100% !important;
    height: 40px !important;
    background-color: #f0f0f0; 
    border: 1px solid #ccc;
    border-radius: 20px; /* Un poco redondeado queda mejor */
    padding: 0 15px !important; /* Para que el texto no toque el borde */
    color: #000;
    text-overflow: ellipsis;
}

/* 5. MENÚ HAMBURGUESA: Le damos fuerza para no ser invadido */
.hamburger-menu {
    flex-shrink: 0 !important; /* IMPORTANTE: Prohíbe que la barra lo pise */
    position: relative !important;
    display: block !important;
    min-width: 30px; /* Asegura un ancho mínimo para que se vea bien */
    text-align: right;

    /* TU IDEA: Margen a la izquierda para separar la barra */
    margin-left: 50px !important; 

    /* CRÍTICO: Escudo anti-aplastamiento */
    flex-shrink: 0 !important; 
    z-index: 9999; /* Por si acaso, que quede siempre encima */
}

/* BASE GLOBAL para todos los demas formatos de pantallas */
.logo { 
	transform: translateY(0px) !important; 
}
#searchOverlay { 
	transform: translateY(3px) !important; 
}
.hamburger-menu { 
	transform: translateY(5px) !important; 
}
#searchOverlay i.fa-microphone { 
	transform: translateY(-2px) !important; 
}

@media only screen and (max-width: 767px) {
    /* CONTENEDOR GENERAL */
    .nav-container {
        display: flex;
        align-items: center;
        padding-left: 5px !important;    /* Logo a 5px del borde izquierdo */
        padding-right: 15px !important;  /* ✅ Hamburger a 15px del borde derecho */
        gap: 0 !important;
    }
    /* LOGO */
    .logo {
        margin: 0 !important;
        flex-shrink: 0;
        transform: translateY(0px) !important;
    }
    /* BUSCADOR */
    #searchOverlay {
        flex-grow: 1 !important;
        margin-left: 0px !important;   /* ✅ 5px desde el logo */
        margin-right: 12px !important;  /* ✅ 5px antes del hamburger */
        min-width: 0;
        transform: translateY(3px) !important;
    }
    /* HAMBURGER */
    .hamburger-menu {
        margin: 0 !important;
        flex-shrink: 0;
        transform: translateY(8px) !important;
    }
	/* MICROFONO */
    #searchOverlay i.fa-microphone {
        transform: translateY(-2px) !important;
    }
}

/* --- WORKAROUND DEFINITIVO PARA EL BUG DE VIEWPORT EN IOS 16 --- */

/*
 * Este media query se dirige específicamente a dispositivos WebKit (como Safari en iOS)
 * y solo se aplica en vista de "móvil" (max-width: 1024px es un punto de corte seguro).
 */
@media (max-width: 1024px) {

    /*
     * El truco clave:
     * 1. Forzamos al 'html' a ocupar el 100% de la altura de la PANTALLA FÍSICA y le quitamos su scroll.
     * 2. Forzamos al 'body' a ser el contenedor que realmente se desplaza.
     * 3. Usamos '100dvh' (dynamic viewport height), una nueva unidad de CSS diseñada
     *    específicamente para que el contenedor ocupe el 100% de la altura visible,
     *    incluso cuando la barra de direcciones de Safari aparece y desaparece.
     */
    html {
        height: 100%;
        overflow: hidden;
    }
    body {
        height: 100dvh; /* ¡La unidad mágica! Altura del viewport dinámico */
        overflow-y: auto; /* Hacemos que el body sea el que tiene el scroll */
        -webkit-overflow-scrolling: touch; /* Mantiene el scroll suave y nativo */
        overscroll-behavior-y: contain; /* Evita que el scroll "rebote" y afecte a elementos fuera del body */
    }
}

body {
  font-family: 'Inter', sans-serif;
}
