:root {
  --primary: #8b2148;
  --primary-dark: #64152f;
  --accent: #f6dce6;
  --background: #fff9fb;
  --surface: #ffffff;
  --text: #29232a;
  --muted: #716772;
  --border: #eadde4;
  --success: #287348;
  --danger: #b42332;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(75, 25, 48, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text);
  background: var(--background); line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
.container { width: min(1120px, 92%); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-content { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { color: var(--primary); font-size: 1.5rem; font-weight: 800; white-space: nowrap; }
nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: .94rem; }
nav a:hover { color: var(--primary); }
.hero {
  background: radial-gradient(circle at 85% 15%, #f2c7d8 0, transparent 35%), linear-gradient(135deg, #fff0f5, #f9dce8);
  padding: 85px 0;
}
.hero-content { max-width: 1120px; }
.hero h1 { max-width: 650px; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.12; margin: 10px 0 18px; }
.hero p:not(.eyebrow) { max-width: 560px; font-size: 1.08rem; color: #55434c; margin-bottom: 28px; }
.eyebrow { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; margin: 0; }
.section { padding-top: 65px; padding-bottom: 15px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
h2 { margin: 5px 0 0; font-size: clamp(1.65rem, 3vw, 2.2rem); line-height: 1.2; }
h3 { margin-top: 26px; margin-bottom: 14px; }
.muted, .small { color: var(--muted); }
.small { font-size: .88rem; }
.catalog-tools { display: grid; gap: 18px; margin-bottom: 25px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px;
  background: white; color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139, 33, 72, .1); }
textarea { resize: vertical; }
.category-list { display: flex; flex-wrap: wrap; gap: 9px; }
.category-button { border: 1px solid var(--border); border-radius: 30px; background: white; color: var(--text); padding: 8px 15px; }
.category-button:hover, .category-button.active { background: var(--primary); color: white; border-color: var(--primary); }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.product-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.product-image { width: 100%; height: 220px; object-fit: cover; background: #f4eaf0; }
.product-content { padding: 16px; display: flex; flex: 1; flex-direction: column; gap: 9px; }
.product-category { color: var(--muted); font-size: .78rem; margin: 0; }
.product-name { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.product-price { color: var(--primary); font-size: 1.03rem; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.product-stock { color: var(--muted); font-size: .84rem; margin: 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none;
  border-radius: 10px; background: var(--primary); color: white; padding: 12px 18px;
  font-weight: 700; text-align: center; transition: background .2s, transform .2s;
}
.button:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.product-content .button { width: 100%; margin-top: auto; }
.button-secondary { background: #eee5ea; color: var(--text); }
.button-secondary:hover:not(:disabled) { background: #e0d1d9; }
.button-danger { background: var(--danger); }
.button-danger:hover:not(:disabled) { background: #8d1725; }
.button-small { padding: 8px 12px; font-size: .88rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(16px, 3vw, 28px); box-shadow: var(--shadow); }
.cart-items { display: grid; gap: 14px; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.cart-item h4 { margin: 0 0 5px; overflow-wrap: anywhere; }
.cart-item p { margin: 0; color: var(--muted); font-size: .9rem; }
.cart-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.quantity-button { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.cart-summary { display: flex; justify-content: space-between; align-items: start; gap: 14px; padding: 20px 0; margin-top: 10px; border-bottom: 1px solid var(--border); }
.cart-summary strong { color: var(--primary); text-align: right; overflow-wrap: anywhere; }
.empty-message { text-align: center; color: var(--muted); padding: 35px 15px; border: 1px dashed var(--border); border-radius: var(--radius); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.form-field label { font-weight: 700; font-size: .92rem; }
.full-width { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pickup-notice { padding: 15px; border-radius: 10px; background: #fff1f6; color: #573143; font-size: .94rem; }
.admin-section { padding-bottom: 70px; }
.notice { border: 1px solid #e8c5a0; background: #fff7eb; color: #67451f; padding: 15px; border-radius: 10px; margin-bottom: 18px; }
.admin-list-title { padding-top: 12px; }
.admin-product-list { display: grid; gap: 12px; }
.admin-product { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.admin-product h4 { margin: 0 0 5px; }
.admin-product p { margin: 0; color: var(--muted); font-size: .9rem; }
.admin-product-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.site-footer { background: #351c29; color: white; text-align: center; padding: 35px 0; }
.site-footer h2 { font-size: 1.5rem; }
.site-footer p { margin: 8px 0; }
.site-footer .small { color: #e5d5de; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.image-preview img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
#catalog-status, #login-status { margin: 8px 0 14px; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-image { height: 190px; }
  .header-content { padding: 12px 0; align-items: flex-start; flex-direction: column; }
  nav { gap: 12px; }
}
@media (max-width: 650px) {
  .hero { padding: 60px 0; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-image { height: 165px; }
  .product-content { padding: 12px; }
  .product-name { font-size: .95rem; }
  .product-price { font-size: .92rem; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .admin-product { align-items: flex-start; flex-direction: column; }
  .cart-item { grid-template-columns: 1fr; }
  .cart-summary { flex-direction: column; }
  .cart-summary strong { text-align: left; }
  .section { padding-top: 45px; }
  nav { font-size: .84rem; }
}
@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-image { height: 230px; }
}

.orders-panel { margin-top: 20px; }
.order-entry { border: 1px solid #e9cdd8; border-radius: 12px; padding: 16px; margin: 12px 0; overflow-wrap: anywhere; }
.order-entry h4 { margin: 0 0 8px; }
.order-entry ul { padding-left: 20px; }
.order-entry .admin-product-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Panel de estadísticas de Punto Clave */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.dashboard-card {
  background: #f5f7ff;
  border: 1px solid #dce3f5;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.dashboard-card h4 {
  font-size: 15px;
  color: #334155;
  margin: 0 0 12px;
}

.dashboard-card p {
  font-size: 30px;
  font-weight: bold;
  color: #2563eb;
  margin: 0;
}

/* Diseño para teléfonos */
@media (max-width: 600px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dashboard-card {
    padding: 16px;
  }
}