/* ===============================
   RESET & BASE
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:   #0A1AFF;
    --secondary: #4DA3FF;
    --dark:      #0b0b0b;
    --light:     #f9f9fb;
    --gray:      #8A8A8A;
    --wa:        #25D366;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* utilities */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* ===============================
   HEADER & NAV
================================ */
.header {
    padding: 20px 0;
    background: linear-gradient(135deg, #0A1AFF 0%, #4DA3FF 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.logo span { color: #ffe600; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .3s;
}

.nav-links a:hover { background: rgba(255,255,255,0.2); }

/* ===============================
   SEARCH BAR
================================ */
.search-bar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-bar {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    width: 240px;
    outline: none;
    transition: border .2s;
    font-family: 'Inter', sans-serif;
}

.search-bar:focus { border-color: var(--primary); }

.category-select {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    outline: none;
    background: #f9f9fb;
    transition: border .2s;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

.category-select:focus { border-color: var(--primary); }

/* ===============================
   FEATURED SECTION
================================ */
.featured {
    padding: 70px 0;
    background: #fff;
}

.featured h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.featured h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 8px auto 0;
    border-radius: 4px;
}

/* ===============================
   GRID
================================ */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

@media (max-width: 1100px) {
    .featured-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 800px) {
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .featured-grid { grid-template-columns: 1fr; }
}

/* ===============================
   TEMPLATE BOX
================================ */
.template-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(0,0,0,.07);
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
    padding-bottom: 16px;
}

.template-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
}

/* ===============================
   FEATURED CARD (imagen)
================================ */
.featured-card {
    position: relative;
    height: 340px;
    overflow: hidden;
    cursor: pointer;
}

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

.featured-card:hover img { transform: scale(1.04); }

/* overlay al hover */
.template-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.58);
    color: #fff;
    padding: 10px 14px;
    transform: translateY(100%);
    transition: transform .3s;
}

.featured-card:hover .template-info { transform: translateY(0); }

.template-info h3 {
    font-size: 0.95rem;
    margin: 0;
}

/* ===============================
   PRECIO
================================ */
.template-price {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    padding: 4px 0;
}

/* ===============================
   BOTONES DE ACCIÓN
================================ */
.template-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 0 14px;
    flex-wrap: wrap;
}

.view-btn,
.buy-btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: .25s ease;
    min-width: 90px;
    font-family: 'Inter', sans-serif;
}

/* VER */
.view-btn {
    background: #f1f3ff;
    color: var(--primary);
}

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

/* COMPRAR → WhatsApp */
.buy-btn {
    background: var(--wa);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.buy-btn:hover {
    background: #1fba58;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,211,102,.4);
}

/* ===============================
   SIN RESULTADOS
================================ */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    font-size: 1.05rem;
    grid-column: 1 / -1;
}

/* ===============================
   IMAGE MODAL
================================ */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: .4s ease;
    z-index: 2000;
}

.image-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.close-modal {
    position: absolute;
    top: 28px;
    right: 38px;
    font-size: 2.2rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: transform .2s;
}

.close-modal:hover { transform: scale(1.2); }

/* ===============================
   FOOTER
================================ */
.footer {
    padding: 20px 0;
    background: var(--dark);
    color: #fff;
    font-size: 0.9rem;
    text-align: center;
}

.footer-content-simple {
    text-align: center;
    color: #aaa;
}

/* ===============================
   WHATSAPP FLOTANTE
================================ */
.wa-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 900;
    width: 58px;
    height: 58px;
    background: var(--wa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(37,211,102,.45);
    transition: transform .25s;
    animation: waBounce 3s ease-in-out infinite;
}

.wa-float:hover { transform: scale(1.12) !important; }

@keyframes waBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* ===============================
   RESPONSIVE NAV
================================ */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links {
        flex-direction: row;
        gap: 10px;
    }

    .search-bar { width: 100%; }
}
