/* styles.css - Verdulería José */

/* 🎨 Paleta basada en el logo */
:root {
  --bg: #fdf6e3;     /* crema */
  --panel: #ffffff;  /* blanco */
  --muted: #6b7280;  /* gris texto secundario */
  --text: #1a202c;   /* gris oscuro */
  --brand: #22c55e;  /* verde principal */
  --brand-2: #16a34a;/* verde hover */
  --card: #ffffff;
  --accent: #e63946; /* rojo precio */
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
  background: url("./fondo_3.png") center/cover no-repeat fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* =======================
   HEADER
   ======================= */
.header {
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: url("/media/frutas_verduras.png") center/cover no-repeat;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 140px;
}

.brand {
  display: flex;
  align-items: center;  /* logo + textos en fila */
  gap: 16px;
}

.logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* contenedor textos del brand */
.brand-text { display: flex; flex-direction: column; gap: 4px; }

/* título principal */
.brand-text h1 {
  color: #ffffff !important;
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  line-height: 1.3;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* eslogan */
.brand-text p,
.header .muted {
  color: #ffffff !important;
  font-size: 17px;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* =======================
   BOTONES
   ======================= */
.btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background .2s, transform .05s ease-in;
  text-decoration: none;
}
.btn:hover { background: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn.danger { background: var(--accent); }
.btn.danger:hover { background: #b91c1c; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--muted); }

/* =======================
   CONTENIDO PRINCIPAL
   ======================= */
.container {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 20px;
  background: transparent;
  border-radius: 12px;
  box-shadow: none;
}

/* controles */
.controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
  padding: 0 20px;
}
.controls input[type="search"]{
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  outline: none;
}
.controls input[type="search"]::placeholder{ color:#9ca3af; }
.controls select{
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  outline: none;
}
@media (max-width:820px){
  .controls{ grid-template-columns:1fr 1fr; }
  .controls select:last-child{ grid-column:span 2; }
}

/* =======================
   PRODUCTOS
   ======================= */
.product-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
  padding: 0 20px 20px;
}

.product-card{
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
  overflow:hidden;
}

.product-card>img,.product-img{
  display:block;
  width:100%;
  height:180px;
  object-fit:cover;
  background:#fff;
}

/* franja inferior de datos */
.product-card .info{
  padding:12px;
  display:grid;
  gap:8px;
  background: #fff3e0;   /* ✅ ahora igual que carrito y popup */
  border-top:1px solid #e5e7eb;
}
.product-card h3{ margin:0; font-size:16px; }
.product-card .muted{ color:#6b7280; font-size:13px; }
.product-card .price{ font-weight:800; color:var(--accent); }
.product-card .info .btn{ width:100%; justify-self:stretch; }

/* =======================
   FOOTER
   ======================= */
.footer{
  text-align:center;
  padding:16px;
  background:url("./footer.png") center/cover no-repeat;
  border-top:1px solid #e5e7eb;
  font-size:14px;
  color:#ffffff;
}
.footer p { color:#ffffff !important; font-weight:600; }

/* =======================
   MODAL CARRITO
   ======================= */
.cart-modal{
  border:none;
  border-radius:12px;
  padding:0;
  max-width:600px;
  width:94%;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.cart-modal::backdrop{ background:rgba(17,24,39,.55); backdrop-filter:blur(1px); }

.cart-box{
  display:flex;
  flex-direction:column;
  max-height:90vh;
  background:#fff3e0;                 /* ✅ crema tirando a naranja */
}

.cart-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  border-bottom:1px solid #e5e7eb;
}

.cart-items{ flex:1; overflow-y:auto; padding:12px 16px; }

/* Ítem alineado en fila: imagen | info | controles | precio */
.cart-item{
  display:grid;
  grid-template-columns: 60px 1fr auto auto;
  align-items:center;
  gap:12px;
  padding:12px 8px;
  border-bottom:1px solid #f3f4f6;
}
.cart-item:last-child{ border-bottom:none; }

.cart-item img{
  width:50px; height:50px; object-fit:cover; border-radius:6px;
}

.cart-item-info{ display:flex; flex-direction:column; }
.cart-item-info h4{ margin:0; font-size:15px; font-weight:600; }
.cart-item-info p{ margin:2px 0 0; font-size:13px; color:#555; }

/* cantidad y eliminar */
.cart-item .qty{
  display:flex;
  align-items:center;
  gap:6px;
}
.cart-item .qty button{
  background: var(--brand);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}
.cart-item .qty button:hover{ background: var(--brand-2); }

/* precio total a la derecha */
.cart-item .price{
  font-weight:700;
  font-size:15px;
  text-align:right;
}

/* pie del carrito */
.cart-footer{
  border-top:1px solid #e5e7eb;
  padding:12px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.summary{ display:flex; justify-content:space-between; align-items:center; font-size:16px; font-weight:bold; }

/* bloquear scroll bajo el modal */
body.modal-open{ overflow:hidden; }

/* === Botón MP (si lo usás dentro del carrito) === */
#mp-button{ display:flex; justify-content:center; align-items:center; margin-top:8px; }
.mercadopago-secure-text{ text-align:center; font-size:13px; color:#6b7280; margin:6px 0 8px; line-height:1.1; }

/* =======================
   POPUP COMPRA EXITOSA
   ======================= */
.flash-modal {
  border: none;
  padding: 0;
  border-radius: 16px;
  max-width: 520px;
  width: calc(100% - 40px);
  box-shadow: 0 24px 72px rgba(0,0,0,.35);
}
.flash-modal::backdrop { background: rgba(17, 24, 39, .55); backdrop-filter: blur(2px); }
.flash-card {
  background: #fff3e0;   /* ✅ mismo color que carrito y tarjetas */
  border-radius: 16px;
  padding: 28px 24px 20px;
  text-align: center;
}
.flash-icon { font-size: 50px; margin-bottom: 12px; }
.flash-card h3 { margin: 0 0 10px; font-size: 26px; }
.flash-card p { margin: 0 0 16px; color: #374151; font-size: 16px; }

/* === Dígitos parejos en filas del carrito (más específico) === */
.cart-modal .cart-items .cart-item .cart-item-info p,
.cart-modal .cart-items .cart-item .cart-item-info p *,
.cart-modal .cart-items .cart-item .price,
.cart-modal .cart-items .cart-item .price *,
.cart-modal .cart-items .cart-item .qty,
.cart-modal .cart-items .cart-item .qty * {
  font-family: Consolas, Menlo, Monaco, "Courier New", monospace !important;
  font-variant-numeric: tabular-nums lining-nums !important;
  font-feature-settings: 'tnum' 1, 'lnum' 1 !important;
  letter-spacing: .01em;
}









