/* --- ESTILOS GENERALES Y PALETA ANARANJADA --- */
:root {
    --color-fondo: #f8f9fa;
    --fondo-tarjeta: #ffffff;
    --texto-principal: #1b1b1b;
    --texto-atenuado: #555555;
    
    /* Resaltadores Anaranjados */
    --color-resaltador: #ff6f00; 
    --color-resaltador-hover: #e65100;
    --color-resaltador-suave: #fff3e0;
    
    --color-whatsapp: #25d366;
    --color-whatsapp-hover: #1da851;
    
    --radio: 10px;
    --sombra: 0 4px 12px rgba(0,0,0,0.08);
    --sombra-hover: 0 8px 24px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
button{
    display: flex;
    justify-content: center;
    align-items: center;
}

::selection {
    background-color: var(--color-resaltador);
    color: white;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background-color: var(--color-fondo);
    color: var(--texto-principal);
}

header {
    max-width: 1400px;
    margin: 0 auto 30px auto;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

header p {
    color: var(--texto-atenuado);
    font-size: 1rem;
}

/* BARRA DE FILTRADO Y BUSCADOR */
.barra-filtrado {
    background: var(--fondo-tarjeta);
    max-width: 1400px;
    margin: 0 auto 30px auto;
    padding: 15px 20px;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.barra-filtrado .buscador-input {
    flex: 1 1 300px;
    position: relative;
}

.barra-filtrado .buscador-input svg {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}

.barra-filtrado .buscador-input input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 36px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.barra-filtrado .buscador-input input:focus {
    border-color: var(--color-resaltador);
    box-shadow: 0 0 0 3px rgba(255, 111, 0, 0.2);
}

.barra-filtrado .botones-buscadores {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

.barra-filtrado .botones-buscadores button {
    background: #e5e5e5;
    border: none;
    padding: 8px 16px 9px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.barra-filtrado .botones-buscadores button:hover, 
.barra-filtrado .botones-buscadores button.activo {
    background-color: var(--color-resaltador);
    color: white;
}

/* MAIN Y GRID DE TARJETAS */
main {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

main .tarjeta {
    background: var(--fondo-tarjeta);
    border-radius: var(--radio);
    overflow: hidden;
    box-shadow: var(--sombra);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

main .tarjeta:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
}

/* Destacado especial (Tarjetas principales) */
main .tarjeta:nth-child(11n+1) {
    grid-column: span 2;
    max-height: 420px;
}

main .tarjeta .imagen {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

main .tarjeta:nth-child(11n+1) .imagen {
    height: 100%;
}

main .tarjeta .imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

main .tarjeta:hover .imagen img {
    transform: scale(1.05);
}

main .tarjeta .imagen span {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(4px); 
}

main .tarjeta .contenido {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

main .tarjeta:nth-child(11n+1) .contenido {
    position: absolute;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    width: 100%;
}

main .tarjeta .contenido .encabezado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

main .tarjeta .contenido .encabezado h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--texto-principal);
}

main .tarjeta .contenido .precio {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-resaltador-hover);
    margin-bottom: 8px;
}

main .tarjeta .contenido p {
    font-size: 0.85rem;
    color: var(--texto-atenuado);
    margin-bottom: 12px;
    line-height: 1.4;
}

main .tarjeta .contenido .actividades {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

main .tarjeta .contenido .actividades span {
    background: var(--color-resaltador-suave);
    color: var(--color-resaltador-hover);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* BOTÓN DE COMPRA EN TARJETA */
main .tarjeta .contenido button {
    margin-top: auto;
    background: var(--color-resaltador);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}

main .tarjeta .contenido button:hover {
    background: var(--color-resaltador-hover);
}

main .tarjeta .contenido button:active {
    transform: scale(0.98);
}

/* BOTÓN FLOTANTE DEL CARRITO */
.btn-carrito-flotante {
    position: fixed;
    bottom: 55px;
    right: 25px;
    background: var(--color-resaltador);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 900;
    transition: transform 0.2s;
}

.btn-carrito-flotante:hover {
    transform: scale(1.08);
    background: var(--color-resaltador-hover);
}

.btn-carrito-flotante #contadorCarrito {
    background: white;
    color: var(--color-resaltador-hover);
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 0.9rem;
}

/* --- VENTANA MODAL (CARRITO) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background: #ffffff;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
    padding: 25px;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #333;
}

.modal-close:hover {
    background: #e0e0e0;
}

.modal-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

/* Elementos dentro del carrito */
.carrito-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.carrito-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}

.carrito-item .info h4 {
    font-size: 0.95rem;
    color: #222;
}

.carrito-item .info p {
    font-size: 0.85rem;
    color: var(--texto-atenuado);
}

.carrito-item .controles {
    display: flex;
    align-items: center;
    gap: 8px;
}

.carrito-item .controles button {
    background: #e0e0e0;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.carrito-item .controles button:hover {
    background: #ccc;
}

.carrito-resumen {
    border-top: 2px solid #f0f0f0;
    padding-top: 15px;
    text-align: right;
    margin-bottom: 20px;
}

.carrito-resumen h3 {
    font-size: 1.3rem;
    color: #111;
}
/* ACCIONES Y BOTONES DEL MODAL */
.acciones-carrito {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-secundario {
    width: 100%;
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secundario:hover {
    background: #d0d0d0;
}
.btn-whatsapp {
    width: 100%;
    background: var(--color-whatsapp);
    color: white;
    border: none;
    padding: 14px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-whatsapp:hover {
    background: var(--color-whatsapp-hover);
}

.sin-resultados {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--texto-atenuado);
    font-size: 1.2rem;
}

footer {
    margin: 32px auto;
    text-align: center;
    color: var(--texto-atenuado);
}

@media (max-width: 768px) {
    main .tarjeta {
        max-width: 350px;
        margin: auto;
    }
    main .tarjeta:nth-child(11n+1) {
        grid-column: span 1;
        max-height: auto;
    }
    main .tarjeta:nth-child(11n+1) .imagen {
        height: 180px;
    }
    main .tarjeta:nth-child(11n+1) .contenido {
        position: static;
        background-color: transparent;
    }
}
