:root {
    --primary-color: #dc2626; /* Logo Red */
    --primary-dark: #b91c1c;
    --primary-light: #fee2e2;
    --bg-dark: #f8fafc; /* Fondo general claro */
    --bg-darker: #ffffff; /* Cabecera y fondo puro */
    --bg-card: #ffffff;
    --text-main: #334155; /* Texto gris oscuro */
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --whatsapp-green: #25D366;
    --whatsapp-green-dark: #128C7E;
    --danger-red: #ef4444;
}

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

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Header & Navigation */
.sticky-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: var(--bg-darker);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top-bar {
    background-color: #ffffff;
    color: var(--text-muted);
    padding: 8px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
}

.top-bar-left, .top-bar-right {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

header {
    background-color: var(--bg-darker);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo span {
    color: var(--primary-color);
}

.logo img {
    max-height: 140px;
    width: auto;
    max-width: 100%;
    transition: max-height 0.3s ease;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-main);
    cursor: pointer;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav ul li a {
    color: var(--text-main);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Title */
.page-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    border-left: 5px solid var(--primary-color);
    padding-left: 1rem;
}

/* Search Bar */
.search-container {
    background-color: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

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

.search-form input,
.search-form select {
    flex: 1;
    min-width: 200px;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-main);
    border-radius: 4px;
    font-size: 1rem;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    text-transform: uppercase;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-dark);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-code {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.badge-terreno, .badge-comprar {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.badge-terreno {
    background-color: transparent;
    color: var(--danger-red);
    border: 1px solid var(--danger-red);
}

.badge-comprar {
    background-color: var(--primary-color);
    color: var(--bg-darker);
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.badge-comprar:hover {
    background-color: var(--primary-dark);
}

/* About Us Section */
.about-section {
    background-color: var(--bg-card);
    padding: 3rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.about-section p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: var(--text-muted);
}

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

.footer-col h4 {
    color: var(--text-main);
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    font-weight: 600;
}

.footer-col p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

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

.footer-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.3s;
}

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

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.footer-contact-item i {
    color: var(--primary-color);
    margin-top: 4px;
}

.footer-bottom {
    background-color: var(--bg-dark);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: var(--whatsapp-green);
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: var(--whatsapp-green-dark);
    color: #fff;
}

.whatsapp-icon {
    font-size: 35px;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
    }
    
    .mobile-menu-btn {
        display: block;
    }

    nav {
        width: 100%;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        display: block;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
    }

    nav ul li:last-child a {
        border-bottom: none;
    }

    .logo img {
        max-height: 100px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-icon {
        font-size: 30px;
    }
}

/* Product Detail Page */
.product-detail-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .product-detail-container {
        flex-direction: row;
    }
}

.product-gallery {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image-container {
    width: 100%;
    max-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 500px;
}

.thumbnail-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, border 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover {
    opacity: 0.9;
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--primary-color);
}

.product-info-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.breadcrumbs {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--primary-color);
}

.product-code-detail {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.product-title-detail {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.product-brand-model {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.product-price-detail {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.product-full-desc {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}

.product-full-desc h3 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.badge-terreno-large {
    background: transparent;
    color: var(--danger-red);
    border: 2px solid var(--danger-red);
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    text-transform: uppercase;
}
