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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #ffe5b4 100%);
    color: #222;
    min-height: 100vh;
}

header {
    background: #ff9800;
    color: #fff;
    padding: 2rem 0 1rem 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: fadeInDown 1s;
}

header h1 {
    font-size: 2.5rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

nav a:hover {
    color: #222;
}

section {
    margin: 2rem auto;
    max-width: 1100px;
    padding: 1.5rem 2rem;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    animation: fadeInUp 1s;
}

#filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
    justify-content: center;
    background: #fff3e0;
}

#filtros label {
    font-weight: 500;
}

#filtros select, #filtros button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #ff9800;
    font-size: 1rem;
    margin-right: 0.5rem;
}

#filtros button {
    background: #ff9800;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s, transform 0.2s;
}

#filtros button:hover {
    background: #e65100;
    transform: scale(1.05);
}

#productos h2, #carrito h2 {
    margin-bottom: 1rem;
    color: #ff9800;
    letter-spacing: 1px;
}

#lista-productos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.producto-card {
    background: #fff8e1;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(255,152,0,0.08);
    padding: 1.5rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeIn 0.7s;
    position: relative;
}

.producto-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 8px 32px rgba(255,152,0,0.18);
}

.producto-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 3px solid #ff9800;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.producto-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #e65100;
}

.producto-card p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #444;
}

.producto-card .precio {
    font-size: 1.1rem;
    font-weight: bold;
    color: #388e3c;
    margin-bottom: 1rem;
}

.producto-card button {
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(255,152,0,0.08);
}

.producto-card button:hover {
    background: #e65100;
    transform: scale(1.07);
}

#lista-carrito {
    margin-bottom: 1rem;
}

.carrito-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fffde7;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.7rem;
    box-shadow: 0 1px 4px rgba(255,152,0,0.06);
    animation: fadeIn 0.7s;
}

.carrito-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 1rem;
    border: 2px solid #ff9800;
    background: #fff;
}

.carrito-item span {
    flex: 1;
    font-size: 1rem;
    color: #444;
}

.carrito-item .carrito-precio {
    color: #388e3c;
    font-weight: bold;
    margin-left: 1rem;
}

.carrito-item button {
    background: #e65100;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.8rem;
    font-size: 0.95rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: background 0.2s;
}

.carrito-item button:hover {
    background: #b45309;
}

#total-carrito {
    font-size: 1.2rem;
    font-weight: bold;
    color: #388e3c;
    margin-bottom: 1rem;
    text-align: right;
}

#comprar {
    background: #388e3c;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    float: right;
    margin-bottom: 1rem;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(56,142,60,0.08);
}

#comprar:hover {
    background: #2e7d32;
    transform: scale(1.04);
}

footer {
    background: #ff9800;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    border-radius: 18px 18px 0 0;
    font-size: 1rem;
    letter-spacing: 1px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

/* Modal de carrito */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s;
}
.modal-contenido {
  background: #fff8e1;
  color: #e65100;
  margin: auto;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  position: relative;
  animation: fadeInUp 0.5s;
}
.cerrar {
  position: absolute;
  top: 10px; right: 18px;
  font-size: 2rem;
  color: #e65100;
  cursor: pointer;
  font-weight: bold;
}

/* Popup de producto agregado */
.popup-agregado {
  display: none;
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: #388e3c;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  box-shadow: 0 4px 24px rgba(56,142,60,0.18);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  transform: translateY(30px);
}
.popup-agregado.mostrar {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s, transform 0.4s;
}

/* Popup de carrito vacío */
.popup-vacio {
  display: none;
  position: fixed;
  bottom: 100px;
  right: 40px;
  background: #e65100;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  box-shadow: 0 4px 24px rgba(230,81,0,0.18);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  transform: translateY(30px);
}
.popup-vacio.mostrar {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s, transform 0.4s;
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(30px);}
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95);}
    to { opacity: 1; transform: scale(1);}
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px);}
    to { opacity: 1; transform: translateY(0);}
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-40px);}
    to { opacity: 1; transform: translateY(0);}
}

@media (max-width: 800px) {
    section {
        padding: 1rem 0.5rem;
    }
    #lista-productos {
        grid-template-columns: 1fr;
    }
    #filtros {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.krusty-img-fixed {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 180px;
  height: auto;
  z-index: 1200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-radius: 18px;
  transition: width 0.3s, bottom 0.3s, left 0.3s;
}

@media (max-width: 1200px) {
  .krusty-img-fixed {
    width: 110px;
  }
}

@media (max-width: 800px) {
  .krusty-img-fixed {
    width: 60px;
    bottom: 8px;
    left: 8px;
  }
}

@media (max-width: 500px) {
  .krusty-img-fixed {
    width: 32px;
    bottom: 2px;
    left: 2px;
  }
}

.krusty-popup-img {
  max-width: 120px;
  width: 60%;
  height: auto;
  display: block;
  margin: 0 auto 1em auto;
}

#abrir-carrito {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1001;
    background: #ff9800;
    color: #fff;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
    transition: box-shadow 0.3s ease;
}

#abrir-carrito {
    box-shadow: 0 12px 40px rgba(46, 125, 50, 0.5);
}

#abrir-carrito:hover {
    box-shadow: 0 16px 48px rgba(46, 125, 50, 0.7);
}
