/* === Reset y tipografía === */
* { box-sizing: border-box; font-family: 'Inter', sans-serif; }
html, body { scroll-behavior: smooth; }
body {
  background: #F9FAFB;
  color: #222021;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  transition: background 0.5s ease;
}

/* === Navbar === */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(34,32,33,0.95);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
  animation: fadeInDown .6s ease;
}
@keyframes fadeInDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 40px; width: auto; border-radius: 6px; }

/* === Chips === */
.categorias { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff; color: #222021;
  cursor: pointer; font-size: 13px;
  transition: all .25s cubic-bezier(.25,.8,.25,1);
}
.chip:hover { background: #e5e7eb; transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.chip.active { background: #222021; color: #fff; border-color: #222021; }

/* === Layout principal === */
.content { display: flex; gap: 20px; padding: 20px; margin-top: 84px; flex: 1; animation: fadeIn .6s ease; }
@keyframes fadeIn { from {opacity:0; transform:translateY(10px);} to {opacity:1; transform:none;} }

.grid {
  flex: 1;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* === Card producto === */
.card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  padding: 14px; display: flex; flex-direction: column;
  align-items: stretch; justify-content: space-between;
  height: 400px;
  opacity: 0; transform: translateY(12px);
  animation: appear .5s ease forwards;
}
@keyframes appear { to { opacity: 1; transform: none; } }

.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.card-img {
  width: 100%; height: 200px;
  display: flex; align-items: center; justify-content: center;
  background: #fafafa; border-radius: 10px; overflow: hidden;
}
.card-img img { max-height: 100%; max-width: 100%; object-fit: contain; transition: transform .3s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card h3 { font-size: 15px; margin: 10px 0 6px; font-weight: 600; min-height: 38px; text-align: center; line-height: 1.2; }

.presentaciones { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; justify-content: center; }
.pres-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid #d1d5db;
  background: #fff; color: #222021; font-size: 12px; cursor: pointer;
  transition: all .25s cubic-bezier(.25,.8,.25,1);
}
.pres-btn:hover { background: #e5e7eb; }
.pres-btn.active { background: #222021; color: #fff; border-color: #222021; }

.cantidad { display: flex; align-items: center; gap: 8px; margin: 8px 0; justify-content: center; }
.cantidad button {
  width: 34px; height: 34px;
  border: none; background: #e5e7eb; border-radius: 8px; font-size: 18px;
  cursor: pointer; transition: background .25s, transform .15s;
}
.cantidad button:hover { background: #d1d5db; }
.cantidad button:active { transform: scale(.9); }

.cantidad input {
  width: 70px; height: 34px; border: 1px solid #e5e7eb;
  border-radius: 8px; text-align: center; font-size: 16px;
  transition: border .25s;
}
.cantidad input:focus { border-color: #0c8b44; outline: none; }

.agregar {
  margin-top: auto; width: 100%; padding: 10px;
  border: none; border-radius: 10px;
  background: #222021; color: #fff; font-size: 14px; cursor: pointer;
  transition: transform .2s, background .3s;
}
.agregar:hover { background: #444; transform: translateY(-2px); }

/* === Sidebar === */
.sidebar {
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky;
  top: 84px;
  height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  justify-content: flex-start; /* antes: space-between */
  animation: fadeInRight .5s ease;
}
@keyframes fadeInRight {
  from {opacity:0; transform:translateX(20px);}
  to {opacity:1; transform:none;}
}

/* === Cabecera "A cotizar" + campo cliente === */
.header-cotizar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cliente-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.cliente-inline input {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.95rem;
  width: 100%;
  transition: border .25s, box-shadow .25s;
}
.cliente-inline input:focus {
  border-color: #0c8b44;
  box-shadow: 0 0 4px rgba(12,139,68,0.35);
  outline: none;
}

/* === Carrito === */
#carrito {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 60px;
  transition: all .3s ease;
}
#carrito .item-carrito {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background .25s, transform .15s;
}
#carrito .item-carrito:hover {
  background: #f8f8f8;
  transform: scale(1.01);
}
#carrito .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #333;
  flex-grow: 1;
  overflow: hidden;
  min-width: 0;
}
#carrito .nombre {
  font-weight: 600;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
#carrito .desc, #carrito .cant {
  font-size: 0.85rem;
  color: #666;
}
#carrito .borrar {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #d33;
  cursor: pointer;
  transition: color .25s, transform .15s;
}
#carrito .borrar:hover {
  color: #a00;
  transform: scale(1.2);
}

/* Texto de carrito vacío centrado */
#carrito .vacio {
  color: #777;
  text-align: center;
  font-style: italic;
  padding: 20px 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Aviso legal y botones === */
.legal {
  display: block;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eee;
  font-size: 11px;
  color: #777;
  text-align: center;
  line-height: 1.4;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* === Carrito === */
#carrito {
  display: flex; flex-direction: column; gap: 10px;
  font-size: 0.9rem; overflow-x: hidden;
  transition: all .3s ease;
}
#carrito .item-carrito {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid #ddd; border-radius: 12px;
  padding: 10px 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background .25s, transform .15s;
}
#carrito .item-carrito:hover { background: #f8f8f8; transform: scale(1.01); }
#carrito .info { display: flex; flex-direction: column; gap: 2px; color: #333; flex-grow: 1; overflow: hidden; min-width: 0; }
#carrito .nombre { font-weight: 600; font-size: 0.95rem; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
#carrito .desc, #carrito .cant { font-size: 0.85rem; color: #666; }
#carrito .borrar {
  background: none; border: none; font-size: 1.3rem;
  color: #d33; cursor: pointer;
  transition: color .25s, transform .15s;
}
#carrito .borrar:hover { color: #a00; transform: scale(1.2); }

/* === Botones === */
.actions { display: flex; gap: 10px; margin-top: 12px; }
.btn-x {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: #e53935; color: #fff; font-size: 18px; cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
  transition: transform .2s, background .3s;
}
.btn-x:hover { background: #c62828; transform: scale(1.05); }
.btn-wa {
  flex: 1; padding: 12px; border: none; border-radius: 30px;
  background: #25D366; color: #fff; font-weight: 600; cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,.2);
  transition: background .3s, transform .2s;
}
.btn-wa:hover { background: #1ebe5d; transform: translateY(-2px); }

/* === Popup de verificación con blur === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: rgba(255,255,255,0.95);
  border-radius: 14px; padding: 30px;
  text-align: center; width: 100%; max-width: 360px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  transform: translateY(20px);
  animation: modalIn .5s ease forwards;
}
@keyframes modalIn {
  to { opacity: 1; transform: translateY(0); }
}
.modal-logo { width: 90px; margin-bottom: 15px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.modal-buttons { display: flex; justify-content: space-around; margin-top: 20px; }
.btn-yes, .btn-no {
  border: none; border-radius: 6px; padding: 10px 20px;
  cursor: pointer; font-weight: 600;
  transition: background 0.3s ease, transform .15s;
}
.btn-yes { background: #25D366; color: #fff; }
.btn-yes:hover { background: #1ebe5d; transform: scale(1.05); }
.btn-no { background: #e53935; color: #fff; }
.btn-no:hover { background: #c62828; transform: scale(1.05); }

/* === FAB del carrito === */
.cart-fab {
  position: fixed; bottom: 30px; right: 30px;
  width: 58px; height: 58px; background: #25D366; border: none; border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  box-shadow: 0 4px 8px rgba(0,0,0,.25);
  cursor: pointer; z-index: 1600;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cart-fab:hover { background: #1ebe5d; transform: scale(1.08); }
.cart-fab.pulse { animation: pulse 600ms ease; }
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
  50% { transform: scale(1.08); box-shadow: 0 10px 28px rgba(0,0,0,.2); }
  100% { transform: scale(1); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
}
.cart-icon { width: 28px; height: 28px; transition: transform .3s ease; }
.cart-fab:hover .cart-icon { transform: scale(1.15); }

.cart-badge {
  position: absolute; top: 6px; right: 6px;
  background: #e53935; color: #fff; font-size: 11px; font-weight: 600;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  animation: badgeBounce .4s ease;
}
@keyframes badgeBounce { 0%{transform:scale(1);}50%{transform:scale(1.3);}100%{transform:scale(1);} }

/* === Footer === */
.footer {
  text-align: center; font-size: 12px; color: rgba(0,0,0,.4);
  padding: 18px 0; animation: fadeInUp .8s ease;
}
@keyframes fadeInUp { from {opacity:0; transform:translateY(10px);} to {opacity:1; transform:none;} }

/* === Campo cliente === */
.header-cotizar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cliente-inline { display: flex; align-items: center; gap: 6px; flex: 1; }
.cliente-inline input {
  border: 1px solid #ccc; border-radius: 8px;
  padding: 6px 8px; font-size: 0.95rem;
  width: 100%; transition: border .25s, box-shadow .25s;
}
.cliente-inline input:focus { border-color: #0c8b44; box-shadow: 0 0 4px rgba(12,139,68,0.35); outline: none; }
