/* =========================================================
   LAYOUT.CSS — Elementos compartidos por TODAS las páginas:
   bordes decorativos, header y footer.
   Requiere: base.css cargado antes
   ========================================================= */

/* ─────────────────────────────────────────────────────────
   BORDES DECORATIVOS
   bordes.png en las 4 esquinas de la pantalla (posición fija).
   Se asume que bordes.png está orientado para la esquina
   superior-izquierda; CSS lo voltea para las otras tres.
──────────────────────────────────────────────────────── */
.borde {
  position: fixed;
  width: clamp(80px, 9vw, 130px);
  pointer-events: none;  /* nunca bloquea clics */
  user-select: none;
  z-index: 999;
  opacity: .92;
}

.borde--tl { top: 0; left: 0; }
.borde--tr { top: 0; right: 0;  transform: scaleX(-1); }
.borde--bl { bottom: 0; left: 0;  transform: scaleY(-1); }
.borde--br { bottom: 0; right: 0; transform: scale(-1); }


/* ─────────────────────────────────────────────────────────
   HEADER
──────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-blanco);
  height: var(--header-h);
  border-bottom: 1px solid var(--c-borde);
  transition: box-shadow var(--ease);
}

/* Sombra suave cuando el usuario hace scroll (añadida via JS) */
.header.scrolled {
  box-shadow: 0 2px 24px rgba(26, 10, 10, .08);
}

.header-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}

.header-logo {
  width: auto;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-name {
  font-family: var(--f-display);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--c-rojo);
  letter-spacing: -.015em;
}

.header-tag {
  font-family: var(--f-label);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--c-teal);
  margin-top: 2px;
}

.header-tagline {
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 400;
  color: var(--c-gris);
  margin-top: 4px;
}

/* ── Responsive header ── */
@media (max-width: 520px) {
  .header-logo { height: 62px; }
  .header-name { font-size: 1.7rem; }
  .header-tagline { font-size: .95rem; }
}
@media (max-width: 360px) {
  .header-logo { height: 52px; }
  .header-name { font-size: 1.4rem; }
  .header-tagline { font-size: .85rem; }
}

/* ─────────────────────────────────────────────────────────
   FOOTER — Fondo negro oscuro
──────────────────────────────────────────────────────── */
.footer {
  background: var(--c-negro);
  padding-block: 56px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
}

/* Nombre y tagline en footer */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.footer-name {
  font-family: var(--f-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--c-blanco);
  letter-spacing: -.01em;
}

.footer-tagline {
  font-family: var(--f-display);
  font-size: .92rem;
  font-style: italic;
  color: rgba(255, 255, 255, .4);
}

/* Links de navegación */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 2.25rem;
}

.footer-link {
  font-family: var(--f-label);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .5);
  transition: color var(--ease);
}

.footer-link:hover {
  color: var(--c-blanco);
}

/* Iconos de redes sociales */
.footer-social {
  display: flex;
  gap: .9rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .6);
  transition:
    background var(--ease),
    color var(--ease),
    transform var(--ease);
}

.footer-social-link:hover {
  background: var(--c-rojo);
  color: var(--c-blanco);
  transform: translateY(-3px);
}

/* Teléfono */
.footer-tel-link {
  font-family: var(--f-label);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .55);
  transition: color var(--ease);
}

.footer-tel-link:hover {
  color: var(--c-blanco);
}

/* Copyright */
.footer-copy {
  font-family: var(--f-label);
  font-size: .68rem;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .25);
}


/* ─────────────────────────────────────────────────────────
   PÁGINAS INTERNAS — bordes más pequeños para no tapar contenido
──────────────────────────────────────────────────────── */
.pagina-interna .borde {
  width: clamp(54px, 6.5vw, 100px);
}


/* ─────────────────────────────────────────────────────────
   BOTÓN FLOTANTE DEL CARRITO (aparece cuando hay productos)
──────────────────────────────────────────────────────── */
.carrito-flotante {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  background: var(--c-rojo);
  color: var(--c-blanco);
  font-family: var(--f-label);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 13px 26px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(200, 32, 30, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
  white-space: nowrap;
}

.carrito-flotante.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.carrito-flotante:hover { background: var(--c-rojo-hover); }

.carrito-flotante-cant {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--c-blanco);
  color: var(--c-rojo);
  font-size: .72rem;
}


/* ─────────────────────────────────────────────────────────
   AVISO (toast) — "Agregado al carrito"
──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--header-h) + 14px);
  transform: translate(-50%, -12px);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--c-negro);
  color: var(--c-blanco);
  font-family: var(--f-body);
  font-size: .92rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(26, 10, 10, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
  max-width: calc(100vw - 32px);
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast a {
  color: #FFB3B1;
  border-bottom: 1px solid currentColor;
  font-family: var(--f-label);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.toast.error { background: var(--c-rojo-hover); }
