/* =========================================================================
   1. VARIABLES GLOBALES / CONFIGURACIÓN
   ========================================================================= */

:root {
    --primary-color: #1a3c6e;
    --secondary-color: #d32f2f;
    --accent-color: #ffc107;
    --text-color: #333;
    --light-bg: rgba(255, 255, 255, 0.85);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
}

/* =========================================================================
   2. ESTILOS BASE / RESET
   ========================================================================= */

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    width: 100%;
}

/* Estilos de Tipografía y Enlaces (Globales/Base) */
.content-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-color);
}

.content-section p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Estilos de Botones Globales (Base/Componente) */
.accion-btn {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.accion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =========================================================================
   3. ESTILOS DE LAYOUT / ESTRUCTURA
   ========================================================================= */

/* Contenedor Principal */
.container {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* HEADER */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* FOOTER */
footer {
    background: linear-gradient(135deg, var(--primary-color), #2c5282);
    color: white;
    padding: 2rem 0 0 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.user-footer-menu {
    background: rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
    padding: 1rem 0;
}

.footer-menu-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0 2rem;
    flex-wrap: wrap;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    position: relative;
}

/* Grid de contenido (Layout General) */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* =========================================================================
   4. ESTILOS DE MÓDULOS / COMPONENTES
   ========================================================================= */

/* --- Componente: Logo y Contador --- */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.visitor-count {
    background-color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- Componente: Hero Section --- */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* --- Componente: Social Icons --- */
.social-section {
    text-align: center;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.social-icons a {
    color: var(--primary-color);
    font-size: 2.5rem;
    transition: transform 0.3s, color 0.3s;
}

.social-icons a:hover {
    color: var(--secondary-color);
    transform: translateY(-5px);
}

/* --- Componente: Facebook Feed --- */
.fb-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.fb-page {
    width: 100% !important;
}

/* --- Componente: Ad Space / Publicidad --- */
.ad-space {
    margin: 2rem 0;
    text-align: center;
}

/* --- Componente: Alertas/Mensajes --- */
.mensaje-alerta {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

.mensaje-alerta.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensaje-alerta.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Componente: Tarjeta de Estadística --- */
.estadisticas-anuncios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.estadistica-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.estadistica-card:hover {
    transform: translateY(-3px);
}

.estadistica-icon {
    font-size: 2rem;
}

.estadistica-info {
    display: flex;
    flex-direction: column;
}

.estadistica-numero {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.estadistica-texto {
    color: #666;
    font-size: 0.9rem;
}

/* --- Componente: Sección Sin Anuncios --- */
.acciones-anuncios {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.sin-anuncios {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.sin-anuncios-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.sin-anuncios h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.sin-anuncios p {
    color: #666;
    margin-bottom: 2rem;
}

.sin-anuncios-acciones {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Componente: Filtros/Botones --- */
.filtros-anuncios {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filtro-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filtro-btn:hover,
.filtro-btn.active {
    background: var(--primary-color);
    color: white;
}

/* --- Componente: Tarjeta de Gestión de Anuncio (Módulo "Mis Anuncios") --- */
.anuncios-lista {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.anuncio-gestion-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    transition: all 0.3s ease;
}

.anuncio-gestion-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.anuncio-gestion-imagen {
    width: 250px;
    position: relative;
    flex-shrink: 0;
}

.anuncio-gestion-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anuncio-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge-tipo,
.badge-estado {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-tipo.vehiculo {
    background: #007bff;
    color: white;
}

.badge-tipo.repuesto {
    background: #28a745;
    color: white;
}

.badge-estado.activo {
    background: #28a745;
    color: white;
}

.badge-estado.inactivo {
    background: #6c757d;
    color: white;
}

.anuncio-gestion-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.anuncio-gestion-titulo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.anuncio-gestion-precio {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.anuncio-gestion-descripcion {
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.anuncio-gestion-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.meta-value {
    color: #666;
    font-size: 0.9rem;
}

.anuncio-gestion-acciones {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.accion-btn.ver {
    background: #17a2b8;
    color: white;
}

.accion-btn.editar {
    background: #ffc107;
    color: #212529;
}

.accion-btn.activar {
    background: #28a745;
    color: white;
}

.accion-btn.pausar {
    background: #6c757d;
    color: white;
}

.accion-btn.eliminar {
    background: #dc3545;
    color: white;
}

/* --- Componente: Búsqueda --- */
.search-container {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

/* --- Componente: Paginación --- */
.paginacion {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagina-link {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.pagina-link:hover,
.pagina-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* --- Componente: Sidebar de Categorías --- */
.categorias-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.categoria-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    background: white; /* Repetido, pero mantenido para consistencia */
}

.categoria-link:hover {
    background-color: #f7fafc;
    color: var(--primary-color);
    padding-left: 20px;
    transform: translateX(5px);
}

.categoria-link:last-child {
    border-bottom: none;
}

.categoria-icon {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* --- Componente: Tarjeta de Anuncio (Módulo "Clasificados") --- */
/* Estilos duplicados, unificados bajo la misma clase. Se mantiene la versión más completa para la tarjeta de listado (anuncio-card) */

.anuncios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.anuncio-card { /* Usado para la tarjeta de listado y la de grid */
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    margin-bottom: 15px;
    align-items: flex-start;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.anuncio-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.anuncio-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.anuncio-badge-primary {
    background: var(--primary-color);
    color: white;
}

.anuncio-badge-secondary {
    background: #6c757d;
    color: white;
}

.anuncio-imagen {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.anuncio-content {
    flex: 1;
    min-width: 0;
    padding: 0; /* Se ajusta el padding para la variante de lista */
}

.anuncio-titulo {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

.anuncio-precio {
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.anuncio-descripcion {
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.anuncio-especificaciones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.espec-item {
    padding: 4px 8px;
    background: #f7fafc;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.condicion-nuevo {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.condicion-usado {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.condicion-reconstruido {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.anuncio-compatible {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.anuncio-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #888;
}

/* Ajustes para la variante de grid (duplicados, se mantiene para la estructura si se usa otro HTML) */
.anuncios-grid .anuncio-card {
    display: block;
    gap: 0;
    margin-bottom: 0;
    padding: 0;
}

.anuncios-grid .anuncio-card:hover {
    transform: translateY(-5px);
}

.anuncios-grid .anuncio-imagen {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    flex-shrink: unset;
}

.anuncios-grid .anuncio-content {
    padding: 1.5rem;
}

.anuncios-grid .anuncio-titulo {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.anuncios-grid .anuncio-precio {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.anuncios-grid .anuncio-descripcion {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anuncios-grid .anuncio-meta {
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}


/* --- Componente: Botón de Publicar --- */
.btn-publicar {
    background: linear-gradient(135deg, var(--primary-color), #2c5282);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin: 5px;
}

.btn-publicar:hover {
    background: linear-gradient(135deg, #2c5282, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* --- Componente: Estados de Usuario/Login --- */
.login-required {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: var(--border-radius);
    margin: 15px 0;
    box-shadow: var(--shadow);
}

.user-status {
    background: var(--light-bg);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    margin: 10px 0;
    text-align: right;
    box-shadow: var(--shadow);
}

.user-status.logged-in {
    border-left: 4px solid #28a745;
}

.user-status.logged-out {
    border-left: 4px solid #dc3545;
}

/* --- Componente: Formulario de Publicación --- */
.publicacion-form {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 60, 110, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.file-upload {
    border: 2px dashed #cbd5e0;
    padding: 2rem;
    text-align: center;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.file-upload:hover {
    border-color: var(--primary-color);
}

.file-upload input {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.upload-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

/* --- Componente: Footer Elementos --- */
.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    font-size: 14px;
}

.footer-btn {
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.footer-btn:hover {
    background: #ffd54f;
    transform: translateY(-2px);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.rss-subscribe {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1rem 0;
}

.rss-icon {
    font-size: 1.5rem;
}

.footer-badges {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.footer-badges img {
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.footer-badges img:hover {
    transform: scale(1.05);
}

.footer-menu-item {
    position: relative;
}

.footer-menu-title {
    color: var(--accent-color);
    cursor: pointer;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: bold;
    display: inline-block;
}

.footer-menu-title:hover {
    background: rgba(255, 255, 255, 0.1);
}

.footer-submenu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-width: 200px;
    z-index: 1000;
    padding: 0.5rem 0;
}

.footer-submenu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.footer-submenu a:last-child {
    border-bottom: none;
}

.footer-submenu a:hover {
    background: #f8f9fa;
    color: var(--primary-color);
}

.footer-logout {
    color: #f8d7da !important;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    font-weight: bold;
}

.footer-logout:hover {
    background: #dc3545;
    color: white !important;
}

.footer-info {
    text-align: center;
    color: #cbd5e0;
}

.footer-info a {
    color: var(--accent-color);
    text-decoration: none;
}

.footer-info a:hover {
    text-decoration: underline;
}

.footer-clock {
    position: absolute;
    bottom: 1rem;
    right: 2rem;
}

.clock-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 120px;
}

.clock-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

.clock-title {
    font-size: 1.2rem;
}

.clock-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.clock-date {
    font-size: 0.8rem;
    color: #cbd5e0;
    font-family: 'Courier New', monospace;
}

/* =========================================================================
   5. MEDIA QUERIES / ESTILOS RESPONSIVE
   ========================================================================= */

/* Estilos de Utilidad para Iframe */
.fb-page span,
.fb-page iframe {
    max-width: 100% !important;
}

/* PC - Tamaño óptimo */
@media (min-width: 1025px) {
    .container {
        padding: 3rem;
    }

    .hero {
        padding: 4rem 2rem;
    }

    .hero h2 {
        font-size: 3rem;
    }

    .fb-page {
        max-width: 800px;
        min-height: 700px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .fb-page {
        max-width: 700px;
        min-height: 650px;
    }

    /* Mis Anuncios */
    .estadisticas-anuncios {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Mantenido de versión original */
    }
}

/* Móvil */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    .container {
        padding: 1.5rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .logo {
        flex-direction: column;
        gap: 10px;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .logo-img {
        height: 40px;
    }

    .social-icons a {
        font-size: 2rem;
    }

    .content-section h3 {
        font-size: 1.3rem;
    }

    /* Facebook móvil */
    .fb-container {
        margin: 1rem 0;
        overflow-x: hidden;
    }

    .fb-page {
        max-width: 100vw;
        min-height: 500px;
        margin: 0 -10px;
        transform: scale(0.98);
        transform-origin: top center;
    }

    /* Clasificados móvil */
    .anuncios-grid {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    .publicacion-form {
        padding: 1rem;
    }

    .categorias-sidebar {
        margin-bottom: 1rem;
    }

    /* Mis Anuncios móvil */
    .anuncio-gestion-card {
        flex-direction: column;
    }

    .anuncio-gestion-imagen {
        width: 100%;
        height: 200px;
    }

    .estadisticas-anuncios {
        grid-template-columns: 1fr;
    }

    .sin-anuncios-acciones {
        flex-direction: column;
        align-items: center;
    }

    .anuncio-gestion-acciones {
        justify-content: center;
    }

    .anuncio-gestion-meta {
        grid-template-columns: 1fr;
    }

    /* Footer móvil */
    .footer-content {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .footer-menu-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .footer-submenu {
        position: static;
        margin-top: 0.5rem;
    }

    .footer-clock {
        position: static;
        margin-top: 1rem;
        display: flex;
        justify-content: center;
    }

    .clock-container {
        min-width: 140px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    header {
        padding: 1rem;
    }

    .logo {
        flex-direction: column;
        gap: 5px;
    }

    .visitor-count {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .hero {
        padding: 1.5rem 0.5rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .social-icons {
        gap: 1rem;
    }

    .social-icons a {
        font-size: 1.8rem;
    }

    .logo-img {
        height: 35px;
    }

    /* Facebook móvil pequeño */
    .fb-page {
        min-height: 450px;
        transform: scale(0.95);
        margin: 0 -15px;
    }

    /* Mis Anuncios móvil pequeño */
    .filtros-anuncios {
        flex-direction: column;
    }

    .accion-btn {
        flex: 1;
        text-align: center;
        min-width: 120px;
    }

    /* Footer móvil pequeño */
    .footer-content {
        padding: 0 0.5rem;
    }

    .footer-bottom {
        padding: 1rem;
    }

    .clock-time {
        font-size: 1rem;
    }

    .clock-date {
        font-size: 0.7rem;
    }
}