:root{
    --bg: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --line: #e2e8f0;
    --brand: #0ea5e9;
    --brand-ink: #0b76a6;
    --surface: #f8fafc;
    --radius: 16px;
}

*{ box-sizing: border-box;}
html,body{ height: 100%;}
body{
    margin: 0;
    font-family: "inter", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/* interfaz */

/* ====== LOGO PRINCIPAL ====== */
.logo {
    display: block;
    margin: 40px auto 20px auto;
    max-width: 220px;       /* controla el ancho máximo */
    height: auto;           /* mantiene proporción */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
  }
  
  .logo:hover {
    transform: scale(1.05);
  }
  
.site-header{
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.brand{ display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;}
.brand-mark{
    width: 36px; height: 36px; display: grid; place-items: center;
    border-radius: 10px; background: var(--text); color: #fff; font-weight: 700;
}
.brand-name{ font-weight: 600; letter-spacing: 2px;}

.nav{ display: flex; gap: 14px; align-items: center;}
.nav a{
    color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px;
}
.nav a:hover{ background: var(--surface); color: var(--text);}

.cart{
    display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
    background: #fff; color: var(--text); padding: 8px 12px; border-radius: 999px;
    cursor: pointer;
}
.cart-count{
    min-width: 22px; height: 22px; display: inline-grid; place-items: center;
    padding: 0 6px; border-radius: 999px; background: var(--text);color: #fff; font-size: 12px;
}

.hero{
    display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 28px;
    padding: 42px 20px; max-width: 1100px; margin: 0 auto;
}
.hero-content h1{
    font-size: clamp(28px, 5vw, 48px);
    line-height: 1.1; margin: 0 0 12px;
}
.hero-content p{ color: var(--muted); margin: 0 0 18px;}
.hero-figure img{ width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius) + 4px);}

.section{ padding: 56px 20px; max-width: 1100px; margin: 0 auto;}
.section-head{ margin-bottom: 20px;}
.section-head h2{ margin: 0 0 6px; font-size: clamp(22px, 3.6vw 32px);}
.section-head p{ color: var(--muted); margin: 0;}

.grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.card{
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff;
    display: flex; flex-direction: column;
}

.card img{ width: 100%; height: 210px; object-fit: cover;}
.card-body{ padding: 14px; display: flex; flex-direction: column; gap: 10px;}
.price-row{ display: flex; align-items: center; justify-content: space-between;}
.price{ font-weight: 600;}
.btn{
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
    background: #fff; color: var(--text); text-decoration: none; cursor: pointer;
}
.btn:hover{ background: var(--surface);}
.btn.primary{
    background: var(--brand); border-color: var(--brand);
    color: #fff; font-weight: 600;
}
.btn.primary:hover{ background: var(--brand-ink); border-color: var(--brand-ink);}
.btn.ghost{ background: transparent;}
.btn.small{ padding: 8px 12px;}

.about{
    border: 1px solid var(--line); background: #fff; border-radius: var(--radius);
    padding: 18px;
}

/*formulario*/
.form{ max-width: 640px; display: grid; gap: 12px;}
.field{ display: grid; gap: 6px;}
input,textarea{
    width: 100%; padding: 12px 12px; border-radius: 10px; border: 1px solid var(--line);
    font: inherit; background: #fff;
}
input:focus, textarea:focus{ outline: 2px solid var(--brand); outline-offset: 2px;}

.form-status{ color: var(--muted); min-height: 20px;}

/*pie de pagina*/
.site-footer{
    padding: 28px 20px; border-top: 1px solid var(--line); text-align: center; color: var(--muted);
}
.site-footer .link{color: inherit;}

/*responsivo*/
@media (max-width: 900px){
    .hero{ grid-template-columns: 1fr;}
    .grid{ grid-template-columns: 1fr 1fr;}
}
@media (max-width: 560px){
    .grid{ grid-template-columns: 1fr;}
    .nav a{ display: none;}
}

/* ===== Encabezado fijo y centrado ===== */
:root{
    --header-h: 72px; /* alto del header */
  }
  
  /* el header siempre visible */
  .site-header{
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--header-h);
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* logo | nav | carrito */
    align-items: center;
    padding: 0 20px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  
  /* logo a la izquierda, carrito a la derecha, menú al centro */
  .brand{ justify-self: start; display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; }
  .brand-logo{ height: 40px; width: auto; border-radius: 8px; }
  
  .nav{
    justify-self: center;
    display: flex;
    gap: 22px;
  }
  .nav a{
    color: var(--muted);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
  }
  .nav a:hover{ background: var(--surface); color: var(--text); }
  
  .cart{ justify-self: end; }
  
  /* empuja el contenido hacia abajo para no quedar detrás del header */
  body{ padding-top: var(--header-h); }
  
  /* que las secciones ancladas no queden ocultas al navegar por #id */
  section{ scroll-margin-top: calc(var(--header-h) + 12px); }
  
  /* en pantallas pequeñas, que el menú siga centrado y respire */
  @media (max-width: 560px){
    .nav{ gap: 14px; }
    .brand-logo{ height: 32px; }
  }
  
  /* ===== Header fijo y centrado ===== */
:root{ --header-h: 76px; }

.site-header{
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* logo | nav | carrito */
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0; /* var(--line) si la tienes */
}

/* Logo pequeño, siempre dentro del header */
.brand{ justify-self: start; display: inline-flex; align-items: center; gap: 10px; }
.brand-logo{ height: 44px; width: auto; border-radius: 10px; }

/* Menú centrado */
.nav{ justify-self: center; display: flex; gap: 24px; }
.nav a{
  color: #475569; text-decoration: none; padding: 8px 10px; border-radius: 10px;
}
.nav a:hover{ background: #f8fafc; color: #0f172a; }

/* Carrito a la derecha */
.cart{ justify-self: end; }

/* Empuja el contenido para que no quede debajo del header */
body{ padding-top: var(--header-h); }

/* Al saltar a anclas (#productos, etc.) que no queden tapadas por el header */
section{ scroll-margin-top: calc(var(--header-h) + 12px); }

/* Hero: asegúrate de que respete márgenes y no suba debajo del header */
.hero{ margin-top: 8px; }

/* Responsive */
@media (max-width: 720px){
  .brand-logo{ height: 36px; }
  .nav{ gap: 16px; }
}

/* ==== Centrar sección de contacto ==== */
.contacto {
    text-align: center;
    padding: 3rem 0;
  }
  
  .contacto .section-head {
    max-width: 600px;
    margin: 0 auto 2rem auto;
  }
  
  .contacto .form {
    max-width: 500px;
    margin: 0 auto;
    text-align: left; /* los campos quedan ordenados dentro */
  }
  
  .contacto .form .field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
  }
  
  .contacto .form label {
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  
  .contacto .form input,
  .contacto .form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
  }
  
  .contacto .form button {
    display: block;
    width: 100%;
    background: #0a84ff;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
  }
  
  .contacto .form button:hover {
    background: #006edc;
  }

  :root { --header-h: 76px; }
body { padding-top: var(--header-h); }
section { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ==== PANEL DEL CARRITO ==== */

.cart-overlay[hidden] {
  display: none !important;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.cart-panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  font-family: inherit;
}

.cart-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cart-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 4px;
}

.cart-empty {
  font-size: 0.95rem;
  color: #64748b;
  margin: 8px 0 16px;
}

.cart-items {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.cart-item__info {
  display: flex;
  flex-direction: column;
}

.cart-item__name {
  font-weight: 600;
}

.cart-item__price {
  font-size: 0.85rem;
  color: #64748b;
}

.cart-item__total {
  font-weight: 600;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

