/* =============================================
   TIENDA DE COTIZACIONES - ESTILOS GLOBALES
   ============================================= */

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

:root {
  --primary:   #0a2540;
  --accent:    #00b4d8;
  --bg:        #f4f7fb;
  --card:      #ffffff;
  --text:      #1a1a2e;
  --muted:     #6c757d;
  --radius:    12px;
  --shadow:    0 4px 20px rgba(0,0,0,.08);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: var(--primary);
  color: #fff;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
header .logo { font-size: 1.4rem; font-weight: 700; letter-spacing: .5px; }
header .logo span { color: var(--accent); }
header nav a {
  color: #cdd9e5;
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: .9rem;
  transition: color .2s;
}
header nav a:hover { color: #fff; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #16213e 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1rem 3rem;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .75rem; }
.hero p  { color: #a8c0d6; font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

/* ── FILTROS ── */
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  padding: 2rem 1rem 1rem;
}
.filtros button {
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: .45rem 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  transition: all .2s;
}
.filtros button:hover,
.filtros button.active {
  background: var(--accent);
  color: #fff;
}

/* ── GRID DE PRODUCTOS ── */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 30px rgba(0,0,0,.13); }

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #e9ecef;
}
.card-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg,#e0e7ef,#cdd9e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #a0b0c0;
}
.card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-cat {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: .4rem;
}
.card-body h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.card-body p  { font-size: .88rem; color: var(--muted); flex: 1; line-height: 1.5; }

.btn-cotizar {
  display: block;
  text-align: center;
  margin-top: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .7rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  transition: background .2s, opacity .2s;
}
.btn-cotizar:hover { background: #0096b7; }

/* ── MODAL DE COTIZACIÓN ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  width: min(480px, 95vw);
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal h2 { font-size: 1.3rem; margin-bottom: 1.2rem; color: var(--primary); }
.modal .close-btn {
  position: absolute; top: 1rem; right: 1.2rem;
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--muted);
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: var(--text); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border: 1.5px solid #d1d9e0;
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .92rem;
  transition: border-color .2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }

.modal-actions { display: flex; gap: .8rem; margin-top: 1.2rem; flex-wrap: wrap; }
.btn-email {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .75rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  transition: opacity .2s;
}
.btn-email:hover { opacity: .85; }
.btn-wa {
  flex: 1;
  background: #25d366;
  color: #fff;
  border: none;
  padding: .75rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  text-align: center;
  text-decoration: none;
  transition: opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.btn-wa:hover { opacity: .85; }

/* ── MENSAJES ── */
.alerta { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alerta.ok  { background: #d1fae5; color: #065f46; }
.alerta.err { background: #fee2e2; color: #991b1b; }

/* ── FOOTER ── */
footer {
  background: var(--primary);
  color: #a8c0d6;
  text-align: center;
  padding: 2rem 1rem;
  font-size: .85rem;
}
footer strong { color: #fff; }

/* ── ADMIN ── */
.admin-container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.admin-container h1 { color: var(--primary); margin-bottom: 1.5rem; }

.tabla-admin {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: .88rem;
}
.tabla-admin th {
  background: var(--primary);
  color: #fff;
  padding: .85rem 1rem;
  text-align: left;
}
.tabla-admin td { padding: .75rem 1rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.tabla-admin tr:last-child td { border-bottom: none; }
.tabla-admin tr:hover td { background: #f8fbff; }

.btn-admin {
  padding: .35rem .85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-right: .3rem;
}
.btn-admin.editar  { background: var(--accent); color: #fff; }
.btn-admin.eliminar { background: #ef4444; color: #fff; }
.btn-admin.nuevo   { background: var(--primary); color: #fff; padding: .6rem 1.4rem; font-size: .92rem; }

.form-admin {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.form-admin h2 { color: var(--primary); margin-bottom: 1.2rem; }

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #16213e 100%);
}
.login-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: min(380px, 95vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-box h1 { color: var(--primary); margin-bottom: 1.5rem; text-align: center; font-size: 1.4rem; }

@media (max-width: 600px) {
  .modal-actions { flex-direction: column; }
  header nav { display: none; }
}
