/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

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

/* Header Styles */
.header {
    background: white;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e0e0e0;
}

/* Top Header Layer */
.header-content {
    padding: 1.5rem 0;
}

.top-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    height: 100px;
    width: auto;
    max-height: 100px;
    object-fit: contain;
}

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

/* Header Actions (Search + Language) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Bottom Header Layer - Navigation */
.nav-section {
    padding: 0;
}

/* Navigation */
.nav-menu {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    padding: 0.75rem 1rem;
}

/* Intro Card Styles */
.intro-card {
    grid-column: 1 / -1; /* Span full width */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.intro-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.intro-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.intro-icon {
    font-size: 2.5rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.intro-text p {
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    opacity: 0.95;
}

/* Responsive intro card */
@media (max-width: 768px) {
    .intro-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .intro-icon {
        font-size: 2rem;
    }
    
    .intro-text p {
        font-size: 1.1rem;
    }
}

.nav-container {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    transition: all 0.2s ease;
}

.search-clear {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

/* Hide search icon when search is active (controlled by JS) */
.search-container.search-active .search-icon {
    display: none;
}

.search-clear:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

.search-clear i {
    font-size: 0.8rem;
}

.search-container.search-active .search-input {
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.6);
    border: 2px solid #667eea;
    transform: scale(1.02);
    font-weight: 500;
}

.search-container.search-active .search-clear {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.search-container.search-active .search-clear:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #5a67d8;
}

.language-selector select {
    padding: 0.5rem;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-weight: 500;
    cursor: pointer;
}

/* Mobile Filters */
.mobile-filters {
    display: none;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
    grid-auto-flow: dense; /* Fill empty spaces automatically */
}

/* Card Styles */
.card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Wide cards for premium/paid listings */
.card.wide {
    grid-column: span 2;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 2px solid #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.card.wide:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25);
}

.card.wide .card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
}

.card.wide .card-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.card.wide .card-description {
    font-size: 1rem;
    -webkit-line-clamp: 4;
}

/* Featured cards for order=1 or portada=1 */
.card.featured {
    grid-column: span 3;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
    border: 3px solid #667eea;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

/* Featured label removed */

.card.featured:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.card.featured .card-image {
    height: 300px;
}

.card.featured .card-content {
    padding: 2rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card.featured .card-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #2d3748;
}

.card.featured .card-description {
    font-size: 1.1rem;
    line-height: 1.6;
    -webkit-line-clamp: 5;
    color: #4a5568;
}

@media (max-width: 1024px) {
    .card.featured {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .card.featured {
        grid-column: span 1;
    }
    
    .card.featured .card-image {
        height: 250px;
    }
    
    .card.featured .card-content {
        padding: 1.5rem;
    }
    
    .card.featured .card-title {
        font-size: 1.4rem;
    }
    
    .card.featured .card-description {
        font-size: 1rem;
    }
}

/* Wide card category tags removed */

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

/* Category tags removed */

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
    line-height: 1.3;
}

.card-description {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

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

.contact-item i {
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 25px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden; /* Ocultar cualquier overflow para mantener esquinas redondeadas */
}

.modal-scroll-container {
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 25px; /* Mantener las esquinas redondeadas en el contenedor de scroll */
}

/* Estilo personalizado para la barra de desplazamiento */
.modal-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.modal-scroll-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin: 25px 0; /* Margen para que no toque las esquinas redondeadas */
}

.modal-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.6);
    border-radius: 10px;
}

.modal-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 2rem;
}

.modal-image-full {
    width: 100%;
    height: 300px;
    margin-bottom: 2rem;
    border-radius: 20px 20px 20px 20px;
    overflow: hidden;
}

.modal-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-image {
    flex: 0 0 300px;
    height: 200px;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.modal-info {
    flex: 1;
    min-width: 300px;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

/* Modal category removed */

.modal-description {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-comments {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.modal-comments h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

#disqus_thread {
    min-height: 200px;
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.detail-section h4 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section p,
.detail-section a {
    color: #718096;
    margin-bottom: 0.5rem;
}

.detail-section a {
    color: #667eea;
    text-decoration: none;
}

.detail-section a:hover {
    text-decoration: underline;
}

/* Social media links styling */
.social-link {
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.social-link i {
    margin-right: 0.5rem;
}

/* Instagram styling */
.social-instagram {
    color: #e1306c;
}

.social-instagram:hover {
    color: #c13584;
    text-decoration: underline;
}

/* Facebook styling */
.social-facebook {
    color: #1877f2;
}

.social-facebook:hover {
    color: #166fe5;
    text-decoration: underline;
}



/* Fallback for old Instagram-specific selectors */
.detail-section a[href*="instagram.com"] {
    color: #e4405f;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .top-header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-section {
        display: none;
    }
    
    .nav-container {
        border-radius: 20px;
        padding: 0.5rem 1rem;
        margin: 0 0.5rem;
    }
    
    .mobile-filters {
        display: flex;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .search-input {
        width: 150px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    /* Wide cards on mobile should span full width */
    .card.wide {
        grid-column: span 1;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-image-full {
        height: 250px;
    }
    
    .modal-header {
        flex-direction: column;
    }
    
    .modal-image {
        flex: none;
        height: 250px;
    }
    
    .modal-details {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
}

/* Category-specific colors removed */

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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