:root {
    --bg: #f2e5d7;
    --text: #4a392b;
    --primary: #c4a88c;
    --secondary: #a67b5b;
    --card-bg: #fffaf2;
    --shadow: rgba(0,0,0,0.1);
    --wa-color: #00b349;
    --danger: #e74c3c;
    --success: #2e7d32;
    --warning: #f57f17;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

header {
    background: var(--primary);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    animation: slideDown .6s ease-out;
}

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

header .logo-link img {
    height: 48px;
}

header h1 {
    color: var(--card-bg);
    font-size: 1.8rem;
    font-weight: 700;
    margin-left: 1rem;
}

.intro {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    animation: fadeIn 1s ease-out;
}

main {
    flex: 1;
}

footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    color: var(--text);
    font-size: .9rem;
}

.mensaje-vacio {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
}

.search-container {
    max-width: 800px;
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
    position: relative;
}

#buscador {
    width: 100%;
    padding: 1.1rem 1.4rem;
    font-size: 1.15rem;
    border: 2px solid var(--primary);
    border-radius: 16px;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    transition: all .3s ease;
}

#buscador:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(166,123,91,.25);
}

#resultados-busqueda {
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    background: white;
    border-radius: 16px;
    margin-top: .6rem;
    box-shadow: 0 15px 35px rgba(0,0,0,.18);
    max-height: 75vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid #eee;
}

.resultado-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: var(--text);
    transition: background .2s;
    border-bottom: 1px solid #f5f5f5;
}

.resultado-item:last-child {
    border-bottom: none;
}

.resultado-item:hover {
    background: #fdf8f3;
}

.resultado-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: white;
    padding: 4px;
    border-radius: 10px;
    margin-right: 1.2rem;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.resultado-info h4 {
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: .4rem;
    font-weight: 600;
    line-height: 1.3;
}

.resultado-info .precio {
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.3rem;
}

.no-resultados {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #555;
    line-height: 1.6;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem 2rem;
    animation: fadeInUp .8s ease-out;
}

@media (min-width: 640px) and (max-width: 1023px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .grid { grid-template-columns: repeat(6, 1fr); }
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 6px var(--shadow);
    transition: transform .3s ease;
    overflow: hidden;
}

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

.img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
}

.img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: .8rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    text-align: center;
}

.card-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.vistas-contador {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: .5rem 1rem;
    background: var(--secondary);
    color: var(--card-bg);
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    transition: background .2s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #8c6240;
}

.btn-wa {
    background: var(--wa-color);
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 8px 25px rgba(0,179,73,.35);
    transition: background .2s, transform .2s;
}

.btn-wa:hover {
    background: #009438;
    transform: scale(1.05);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 1rem;
    transition: color .2s;
}

.back-link:hover {
    color: #8c6240;
}

.tarjeta-producto {
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: 0 auto 1.5rem;
}

.galeria {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.slides {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease;
}

.slide {
    flex: 0 0 100%;
    position: relative;
}

.slide img,
.slide iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary);
    border: none;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 2;
    transition: background .2s;
}

.nav-btn:hover {
    background: #8c6240;
}

.nav-btn.prev { left: 10px; }
.nav-btn.next { right: 10px; }

.dots {
    text-align: center;
    background: #ffffff;
    padding: 10px 0;
}

.dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s;
}

.dots span.active {
    background: var(--text);
}

.info {
    padding: 20px;
}

.info h2 {
    font-size: 1.8rem;
    color: var(--text);
    margin-bottom: 10px;
    text-align: center;
}

.precio-grande {
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--success);
    font-weight: 700;
}

.specs-label {
    display: block;
    width: fit-content;
    margin: 8px auto;
    background: var(--secondary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: .9rem;
}

.variants {
    text-align: center;
    margin-bottom: 15px;
}

.variant-label {
    display: inline-block;
    margin: 4px;
    padding: 8px 16px;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    transition: all .2s;
}

.variant-label.active {
    background: var(--secondary);
    color: #ffffff;
    border-color: var(--secondary);
}

.descripcion {
    font-size: 1rem;
    line-height: 1.7;
}

.chip {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: .85rem;
    font-weight: 600;
    margin: 6px 6px 6px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    padding-left: 24px;
    position: relative;
}

.chip::before {
    content: '';
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.chip-ventaja {
    background: #c8e6c9;
    color: var(--success);
}

.chip-amarilla {
    background: #fff9c4;
    color: var(--warning);
}

.chip-desventaja {
    background: #ffcdd2;
    color: #c62828;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
}

@media (min-width: 640px) and (max-width: 1023px) {
    .productos-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .productos-grid { grid-template-columns: repeat(5, 1fr); }
}

.producto-card {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 6px var(--shadow);
    overflow: hidden;
    transition: transform .2s;
}

.producto-card:hover {
    transform: translateY(-4px);
}

.producto-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
}

.producto-card .card-body {
    padding: 1rem;
    text-align: center;
}

.producto-card h3 {
    font-size: .95rem;
    margin-bottom: .5rem;
    font-weight: 600;
}

.producto-card .precio {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--success);
    margin-bottom: .5rem;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
