body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f9f9f9;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1rem 1rem 1rem;
  background: #222;
  color: #fff;
  position: relative;
}

.header-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

header h1 {
  margin-bottom: 0;
}

header h3 {
  margin-top: 2px;
  margin-bottom: 0;
  font-weight: normal;
  font-size: 1.15em;
  letter-spacing: 1px;
}

/* Filtros arriba */
main > div {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f7f7f7;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  box-shadow: 0 2px 8px #0001;
}

main label {
  font-weight: bold;
  color: #333;
}

main select {
  margin-left: 8px;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid #bbb;
  background: #fff;
  font-size: 1em;
}

/* Productos grid */
.productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  padding: 10px 0;
}

.producto {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px #0002;
  padding: 18px 14px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.2s;
}

.producto:hover {
  box-shadow: 0 4px 16px #0003;
}

.producto img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #f2f2f2;
  transition: transform 0.25s cubic-bezier(.4,2,.6,1), box-shadow 0.2s;
}

.producto img:hover {
  transform: scale(1.35);
  z-index: 2;
  box-shadow: 0 4px 24px #0003;
}

.producto h3 {
  margin: 8px 0 4px 0;
  font-size: 1.1em;
  color: #222;
}

.producto p {
  margin: 0 0 10px 0;
  color: #009688;
  font-weight: bold;
}

.producto button,
.producto select {
  margin-top: 7px;
}

.producto button {
  background: #009688;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s;
}

.producto button:hover {
  background: #00796b;
}

#cartBtn {
  background: #ff9800;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.2s;
  /* Elimina position:absolute si lo tenías */
}

#cartBtn:hover {
  background: #e65100;
}

/* Modal estilos */
.modal {
  position: fixed;
  z-index: 2000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  padding: 30px 24px 20px 24px;
  border-radius: 10px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 4px 24px #0004;
  position: relative;
}

#closeModal {
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 1.5em;
  cursor: pointer;
  color: #888;
}

#closeModal:hover {
  color: #e53935;
}

#buyBtn {
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 18px;
  font-size: 1em;
  margin-top: 18px;
  cursor: pointer;
  transition: background 0.2s;
}

#buyBtn:hover {
  background: #128c7e;
}

/* Sidebar Carrito */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 16px #0003;
  z-index: 100;
  transition: right 0.3s;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  right: 0;
}

.cart-sidebar-content {
  padding: 30px 20px 20px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#closeSidebar {
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 1.5em;
  cursor: pointer;
  color: #888;
}

#closeSidebar:hover {
  color: #e53935;
}

#cartItems {
  list-style: none;
  padding: 0;
  margin: 20px 0 0 0;
  flex: 1;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.cart-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: #f2f2f2;
}

.cart-item-details {
  flex: 1;
  font-size: 0.98em;
}

.cart-item-details span {
  display: block;
  color: #555;
}

.cart-item-remove {
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 1em;
  margin-left: 5px;
}

.cart-item-remove:hover {
  background: #b71c1c;
}

/* Formulario en el sidebar del carrito */
#cartSidebar form {
  background: #f7f7f7;
  padding: 12px 10px 10px 10px;
  border-radius: 8px;
  margin-top: 15px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px #0001;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#cartSidebar form input {
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 5px;
  font-size: 1em;
  background: #fff;
  transition: border 0.2s;
}

#cartSidebar form input:focus {
  border: 1.5px solid #009688;
  outline: none;
  background: #f0fdfa;
}

#cartSidebar form input::placeholder {
  color: #888;
  font-size: 0.98em;
}

#cartSidebar form input[required] {
  border-left: 3px solid #ff9800;
}

.color-selector {
  display: flex;
  gap: 10px;
  margin: 10px 0 8px 0;
}

.color-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #bbb;
  display: inline-block;
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px #0001;
  outline: none;
  padding: 0;
}

.color-circle:hover,
.color-circle.selected {
  border: 2.5px solid #009688;
  box-shadow: 0 2px 8px #00968833;
}

@media (max-width: 600px) {
  header {
    flex-direction: row;
    padding: 1rem 0.5rem 1rem 0.5rem;
  }
  .header-titles {
    flex: 1;
  }
  #cartBtn {
    margin-left: 10px;
    font-size: 1em;
    padding: 7px 12px;
  }
}
