@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --danger: #dc2626;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --font: 'Nunito', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: var(--font); background: var(--body-bg); color: var(--text-main); margin: 0; }

/* ── Header ─────────────────────────────────────────────── */
.store-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
  gap: 10px;
}
.store-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.store-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.store-name {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.store-header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Cart badge ─────────────────────────────────────────── */
.cart-btn {
  position: relative; background: var(--primary); color: #fff;
  border: none; border-radius: 10px; padding: 9px 16px;
  font-family: var(--font); font-weight: 700; font-size: 13.5px;
  cursor: pointer; display: flex; align-items: center; gap: 6px; text-decoration: none;
}
.cart-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Container ──────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.section { padding: 24px 0; }

/* ── Section title ──────────────────────────────────────── */
.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  margin-bottom: 20px; color: var(--text-main);
}

/* ── Product grid ───────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.product-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-card-body { padding: 12px; }
.product-card-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.product-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-price { color: var(--primary); font-weight: 800; font-size: 16px; margin-bottom: 10px; }
.product-card-footer { display: flex; gap: 6px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 9px;
  font-size: 13.5px; font-weight: 700;
  border: none; cursor: pointer; text-decoration: none;
  transition: all .15s; font-family: var(--font); line-height: 1.4;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-w100 { width: 100%; justify-content: center; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  padding: 24px; transform: translateY(30px); transition: transform .25s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
@media (min-width: 520px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 20px; }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.modal-close { background: #f1f5f9; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; }

/* ── Cart items ──────────────────────────────────────────── */
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 700; font-size: 13.5px; }
.cart-item-price { color: var(--primary); font-weight: 700; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn { width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.qty-val { font-weight: 700; font-size: 14px; min-width: 20px; text-align: center; }
.remove-btn { background: #fef2f2; border: none; border-radius: 6px; padding: 5px 8px; color: var(--danger); cursor: pointer; }

/* ── Order form ──────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 13.5px; font-family: var(--font); color: var(--text-main);
  outline: none; transition: border-color .15s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ── QR section ──────────────────────────────────────────── */
.qr-section { text-align: center; background: var(--primary-light); border-radius: 12px; padding: 20px; margin: 16px 0; }
.qr-section img { max-width: 160px; border-radius: 10px; border: 3px solid var(--primary); }
.qr-label { font-weight: 700; color: var(--primary); margin-bottom: 10px; }

/* ── Delivery options ────────────────────────────────────── */
.delivery-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.delivery-opt { border: 2px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; text-align: center; transition: all .15s; }
.delivery-opt:hover { border-color: var(--primary); }
.delivery-opt.selected { border-color: var(--primary); background: var(--primary-light); }
.delivery-opt-icon { font-size: 22px; margin-bottom: 4px; }
.delivery-opt-label { font-size: 12.5px; font-weight: 700; }

/* ── Punto selector ──────────────────────────────────────── */
.puntos-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.punto-sel-opt {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--border); border-radius: 10px; padding: 12px 14px;
  cursor: pointer; transition: all .15s;
}
.punto-sel-opt:hover { border-color: var(--primary); }
.punto-sel-opt.selected { border-color: var(--primary); background: var(--primary-light); }
.punto-sel-fecha {
  background: var(--primary); color: #fff; border-radius: 8px;
  padding: 6px 10px; text-align: center; flex-shrink: 0; min-width: 46px;
}
.punto-sel-fecha strong { display: block; font-size: 20px; line-height: 1; }
.punto-sel-fecha span { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.punto-sel-hora { font-weight: 700; font-size: 13.5px; }
.punto-sel-aclar { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Map ─────────────────────────────────────────────────── */
#map-public { height: 320px; border-radius: var(--radius); border: 1.5px solid var(--border); }

/* ── Points list ─────────────────────────────────────────── */
.point-card { background: #fff; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; display: flex; gap: 14px; align-items: flex-start; }
.point-date { background: var(--primary); color: #fff; border-radius: 10px; padding: 8px 12px; text-align: center; flex-shrink: 0; }
.point-date-day { font-size: 22px; font-weight: 800; line-height: 1; }
.point-date-month { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.point-info-name { font-weight: 700; font-size: 14px; }
.point-info-detail { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ── Info popup ──────────────────────────────────────────── */
.info-btn { background: #f1f5f9; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 14px; font-family: var(--font); font-weight: 700; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Header: ocultar texto de botones Info y Puntos, dejar solo icono */
  .info-btn .btn-label { display: none; }
  .info-btn { padding: 8px 10px; }
  .store-name { font-size: 14px; }
  .cart-btn { padding: 8px 12px; font-size: 13px; }
  .store-header { padding: 8px 12px; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr 1fr; }
  .delivery-options { grid-template-columns: 1fr 1fr; }
  .section { padding: 16px 0; }
  .section-title { font-size: 17px; margin-bottom: 14px; }
  .container { padding: 0 12px; }
}
