/* ==========================================================================
   Papelarte Design System - Layout & Native Architecture (Header & Footer)
   Zero-Builder Native Stylesheet - Replaces Elementor #63 & #26
   ========================================================================== */

:root {
  --ppa-red: #BC3838;
  --ppa-red-dark: #7E1212;
  --ppa-red-btn: #9E2A2A;
  --ppa-charcoal: #242424;
  --ppa-text-main: #1F2937;
  --ppa-text-muted: #6B7280;
  --ppa-bg-page: #FFFFFF;
  --ppa-bg-surface: #F9FAFB;
  --ppa-border-light: #E5E7EB;
  --ppa-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --ppa-container-max: 1280px;
}

/* --------------------------------------------------------------------------
   1. Contenedores Estándar
   -------------------------------------------------------------------------- */
.ppa-container {
  width: 100%;
  max-width: var(--ppa-container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. Cabecera Universal Papelarte (.pa-header)
   Estructura unificada de 3 niveles para todas las páginas (Home, Tienda, etc.)
   -------------------------------------------------------------------------- */
.pa-header,
.pa-header *,
.pa-utility,
.pa-utility * {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.pa-header {
  width: 100%;
  position: relative;
  z-index: 999;
  background-color: var(--ppa-red, #bc3838);
  box-shadow: 0 3px 14px rgba(69, 15, 20, 0.18);
  font-family: var(--ppa-font-body, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* 2.1. Franja Superior de Utilidades (.pa-utility) */
.pa-utility {
  background-color: #69191e;
  color: #FFFFFF;
}

.pa-utility__inner {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1280px, calc(100% - clamp(24px, 4vw, 48px)));
  margin-inline: auto;
  padding: 4px 0;
  font-size: 12px;
}

.pa-utility-left,
.pa-utility-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pa-social-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pa-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.pa-social-link:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
  color: #FFFFFF;
}

.pa-social-link svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.pa-topbar-link {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  transition: opacity 0.2s ease;
}

.pa-topbar-link:hover {
  opacity: 0.85;
}

.pa-utility-sep {
  opacity: 0.4;
}

/* 2.2. Cabecera Principal Roja (.pa-header-main) */
.pa-header-main {
  background-color: var(--ppa-red, #bc3838);
}

.pa-header-main__inner {
  min-height: 84px;
  display: grid;
  grid-template-columns: clamp(150px, 16vw, 205px) minmax(280px, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  width: min(1280px, calc(100% - clamp(24px, 4vw, 48px)));
  margin-inline: auto;
  padding: 10px 0;
}

/* Logo Papelarte */
.pa-brand {
  display: flex;
  align-items: center;
}

.pa-brand a {
  display: inline-flex;
  align-items: center;
}

.pa-brand img {
  display: block;
  width: clamp(145px, 14vw, 176px);
  height: auto;
  max-height: 72px;
  object-fit: contain;
}

/* Buscador Nativo Integrado (Zero-Plugin Live Search) */
.pa-search {
  min-width: 0;
  width: 100%;
}

.ppa-search-form {
  position: relative;
  width: 100%;
  height: 48px;
  margin: 0;
}

form.ppa-search-form input[type="search"].ppa-search-input,
.ppa-search-input {
  width: 100% !important;
  height: 48px !important;
  margin: 0 !important;
  padding: 0 56px 0 18px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  color: var(--ppa-charcoal, #242424) !important;
  font-family: inherit !important;
  font-size: 14px !important;
  line-height: 48px !important;
  box-shadow: 0 3px 12px rgba(74, 14, 18, 0.16) !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: box-shadow 0.2s ease !important;
}

form.ppa-search-form input[type="search"].ppa-search-input:focus,
.ppa-search-input:focus {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22) !important;
}

.ppa-search-input::-webkit-search-decoration,
.ppa-search-input::-webkit-search-cancel-button {
  display: none;
}

form.ppa-search-form button.ppa-search-submit,
.ppa-search-submit {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-left: 1px solid #eceff1 !important;
  border-radius: 0 8px 8px 0 !important;
  background: #FFFFFF !important;
  color: var(--ppa-red, #bc3838) !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  z-index: 2 !important;
  transition: background-color 0.2s ease !important;
}

form.ppa-search-form button.ppa-search-submit:hover,
.ppa-search-submit:hover {
  background-color: #f8eeee !important;
}

.ppa-search-submit svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  pointer-events: none;
}

/* Indicador de carga sutil en el botón */
.ppa-search-form.is-loading .ppa-search-submit svg {
  animation: ppa-spin 0.8s linear infinite;
}

@keyframes ppa-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 2.3. Acciones de Cabecera: Mi Cuenta y Carrito */
.pa-header-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 10px);
}

.pa-account,
.pa-cart {
  height: 48px;
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 8px);
  padding: 6px clamp(8px, 1vw, 11px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(104, 23, 28, 0.25);
  color: #FFFFFF;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pa-account:hover,
.pa-cart:hover {
  background: rgba(104, 23, 28, 0.45);
  border-color: rgba(255, 255, 255, 0.5);
  color: #FFFFFF;
}

.pa-cart {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.pa-action-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pa-action-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pa-account small,
.pa-cart small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1.2;
}

.pa-account strong,
.pa-cart strong {
  display: block;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

/* 2.4. Subbarra de Categorías (.pa-nav) */
.pa-nav {
  background-color: #FFFFFF;
  border-bottom: 1px solid #e2e6e8;
}

.pa-nav__inner {
  height: 46px;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.1vw, 28px);
  overflow-x: auto;
  scrollbar-width: none;
  width: min(1280px, calc(100% - clamp(24px, 4vw, 48px)));
  margin-inline: auto;
}

.pa-nav__inner::-webkit-scrollbar {
  display: none;
}

.pa-nav a {
  color: #343a40;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.pa-nav a:hover {
  color: var(--ppa-red, #bc3838);
}

.pa-nav__all {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background-color: #8c262b;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  text-transform: none;
}

.pa-nav__all:hover {
  background-color: #69191e !important;
  color: #FFFFFF !important;
}

/* Panel Flotante de Resultados en Vivo */
.ppa-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--ppa-border-light, #E5E7EB);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  max-height: 460px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}

.ppa-search-results.is-active {
  display: flex;
  animation: ppaFadeInDown 0.18s ease-out;
}

@keyframes ppaFadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ppa-search-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1 1 auto;
  scrollbar-width: thin;
}

.ppa-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ppa-text-main, #1F2937);
  border-bottom: 1px solid #F3F4F6;
  transition: background-color 0.15s ease;
}

.ppa-search-item:last-child {
  border-bottom: none;
}

.ppa-search-item:hover,
.ppa-search-item.is-highlighted {
  background-color: #F8FAFC;
}

.ppa-search-thumb-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
  overflow: hidden;
  background: #FFFFFF;
  display: grid;
  place-items: center;
}

.ppa-search-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ppa-search-details {
  flex: 1 1 auto;
  min-width: 0;
}

.ppa-search-title {
  font-size: 13px;
  font-weight: 600;
  color: #1F2937;
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppa-search-mark {
  background: rgba(188, 56, 56, 0.15);
  color: var(--ppa-red, #BC3838);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

.ppa-search-sku {
  font-size: 11px;
  font-weight: 500;
  color: #6B7280;
  text-transform: uppercase;
}

.ppa-search-price {
  font-size: 14px;
  font-weight: 750;
  color: var(--ppa-red, #BC3838);
  white-space: nowrap;
  text-align: right;
  margin-left: 8px;
}

.ppa-search-price del {
  font-size: 11px;
  color: #9CA3AF;
  font-weight: 400;
  display: block;
}

.ppa-search-price ins {
  text-decoration: none;
}

.ppa-search-footer {
  flex: 0 0 auto;
  padding: 10px 14px;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  text-align: center;
}

.ppa-search-view-all {
  font-size: 13px;
  font-weight: 700;
  color: var(--ppa-red, #BC3838);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.ppa-search-view-all:hover {
  color: var(--ppa-red-dark, #7E1212);
  text-decoration: underline;
}

.ppa-search-empty {
  padding: 24px 16px;
  text-align: center;
  color: #6B7280;
  font-size: 13px;
}

.ppa-search-empty p {
  margin: 0 0 10px;
}

.ppa-search-empty-link {
  display: inline-block;
  font-weight: 700;
  color: var(--ppa-red, #BC3838);
  text-decoration: none;
}

.ppa-search-empty-link:hover {
  text-decoration: underline;
}

/* Botón "Productos" y Acciones Derecha */
.ppa-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.ppa-btn-products {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--ppa-red-btn);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 25px;
  transition: background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ppa-btn-products:hover {
  background-color: var(--ppa-red-dark);
  transform: translateY(-1px);
}

.ppa-btn-products svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Botón Carrito Header (Oculto en desktop ya que el trigger está en la topbar y botón flotante) */
.ppa-header-cart {
  display: none;
}

/* --------------------------------------------------------------------------
   3. Pie de Página Nativo (.ppa-site-footer)
   -------------------------------------------------------------------------- */
.ppa-site-footer {
  width: 100%;
  font-family: var(--ppa-font-body);
  margin-top: auto;
}

/* 3.1. Cuerpo Principal del Footer */
.ppa-footer-main {
  background-color: var(--ppa-red);
  color: #FFFFFF;
  padding: 44px 0 36px 0;
}

.ppa-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 36px;
  align-items: start;
}

/* Columna 1: Identidad & Redes */
.ppa-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ppa-footer-logo img {
  width: 180px;
  height: auto;
  max-height: 70px;
  display: block;
  object-fit: contain;
}

.ppa-footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ppa-footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ppa-footer-social-link:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.ppa-footer-social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Columna 2: Ubicación y Horarios */
.ppa-footer-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ppa-footer-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #FFFFFF;
}

.ppa-footer-info-item svg {
  width: 18px;
  height: 18px;
  fill: #FFFFFF;
  flex: 0 0 18px;
  margin-top: 2px;
}

/* Columna 3: Enlaces Institucionales */
.ppa-footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ppa-footer-link {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.ppa-footer-link:hover {
  color: #E1E1E1;
  text-decoration: underline;
  transform: translateX(2px);
}

/* 3.2. Franja Inferior Copyright */
.ppa-footer-bottom {
  background-color: var(--ppa-red-dark);
  color: #FFFFFF;
  font-size: 13px;
  padding: 14px 0;
  text-align: center;
}

.ppa-footer-bottom p {
  margin: 0;
  letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   4. Comportamiento Responsive (Tablets y Móviles)
   -------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .pa-header-main__inner {
    grid-template-columns: clamp(140px, 15vw, 175px) minmax(250px, 1fr) auto;
  }
  .pa-account span:last-child {
    display: none;
  }
  .pa-account {
    width: 46px;
    justify-content: center;
    padding: 0;
  }
  .pa-cart {
    padding-inline: 9px;
  }
}

@media (max-width: 900px) {
  .ppa-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 820px) {
  .pa-utility-left {
    display: none;
  }
  .pa-utility__inner {
    justify-content: center;
    min-height: 30px;
    font-size: 11px;
  }
  .pa-utility-right .pa-utility-sep,
  .pa-utility-right span:last-child {
    display: none;
  }
  .pa-header-main__inner {
    min-height: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 10px;
    padding: 10px 0;
  }
  .pa-brand {
    flex: 0 0 auto;
  }
  .pa-brand img {
    width: clamp(118px, 30vw, 138px);
  }
  .pa-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .pa-search {
    flex: 1 0 100%;
    width: 100%;
    order: 3;
  }
  .pa-account {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
    text-decoration: none;
    flex-shrink: 0;
  }
  .pa-account span:last-child {
    display: none;
  }
  .pa-account .pa-action-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .pa-account .pa-action-icon svg {
    width: 18px;
    height: 18px;
  }
  .pa-cart {
    height: 38px;
    padding: 0 10px;
  }
  .pa-cart strong {
    display: none;
  }
  .pa-cart small {
    font-size: 11px;
  }
  .pa-nav__inner {
    width: 100%;
    padding-left: clamp(10px, 2vw, 14px);
  }
  .pa-nav__all {
    margin-left: calc(-1 * clamp(10px, 2vw, 14px));
  }

  /* Footer en Móvil */
  .ppa-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .ppa-footer-brand,
  .ppa-footer-social {
    justify-content: center;
    align-items: center;
  }
  .ppa-footer-info-item {
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .pa-header-actions {
    gap: 5px;
  }
  .pa-cart {
    padding-inline: 7px;
  }
}

/* --------------------------------------------------------------------------
   5. Páginas Estáticas e Institucionales Nativas (.pa-static-page)
   -------------------------------------------------------------------------- */
.pa-page-main {
  padding: clamp(28px, 4vw, 50px) 0 clamp(40px, 6vw, 70px);
  min-height: 55vh;
  background-color: #FFFFFF;
}

.pa-page-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ppa-border-color, #E5E7EB);
}

.pa-page-title {
  font-family: Montserrat, var(--ppa-font-heading, sans-serif);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  color: #111827;
  margin: 0;
  letter-spacing: -0.02em;
}

.pa-page-content {
  font-family: var(--ppa-font-body, Inter, Arial, sans-serif);
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
  max-width: 960px;
}

.pa-page-content h2 {
  font-family: Montserrat, var(--ppa-font-heading, sans-serif);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  color: #111827;
  margin: 36px 0 16px;
  letter-spacing: -0.01em;
}

.pa-page-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: #1F2937;
}

.pa-page-content p {
  margin: 0 0 16px;
}

.pa-page-content ul,
.pa-page-content ol {
  margin: 0 0 22px;
  padding-left: 24px;
}

.pa-page-content li {
  margin-bottom: 8px;
}

.pa-page-content a {
  color: var(--ppa-red, #BC3838);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.pa-page-content a:hover {
  color: var(--ppa-red-dark, #8C262B);
}

/* Mapas y videos responsive */
.pa-page-content iframe {
  width: 100% !important;
  max-width: 100% !important;
  height: 420px !important;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}


