/* ===========================================================
   Tienda Libera — Theme
   Override de variables CSS de Bootstrap 5.3 + componentes
   Guía de diseño institucional Libera Colombia / INPEC
   =========================================================== */

/* ─────────────────────────────────────────────────────────
   0. @font-face — Fuentes autohospedadas
   Fraunces: serif titulares (500, 600)
   Work Sans: sans-serif cuerpo/UI (400, 500, 600)
   ───────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/fraunces-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fraunces-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/worksans-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/worksans-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/worksans-600.ttf') format('truetype');
}

/* ─────────────────────────────────────────────────────────
   1. Design Tokens — Bootstrap 5.3 CSS variable override
   ───────────────────────────────────────────────────────── */
:root {
  /* ── Palette ── */
  --lb-azul:           #2C4A5E;
  --lb-azul-hover:     #1E3648;
  --lb-verde:          #4B6B4E;
  --lb-verde-hover:    #3A523D;
  --lb-terracota:      #B1522A;
  --lb-ocre:           #C98F34;
  --lb-tinta:          #24211D;
  --lb-papel:          #FBFAF6;
  --lb-papel-oscuro:   #F4F1EA;
  --lb-blanco:         #FFFFFF;
  --lb-borde:          #DEDCD3;

  /* ── Bootstrap overrides ── */
  --bs-primary:        var(--lb-azul);
  --bs-primary-rgb:    44, 74, 94;
  --bs-primary-hover:  var(--lb-azul-hover);
  --bs-secondary:      var(--lb-verde);
  --bs-secondary-rgb:  75, 107, 78;
  --bs-success:        var(--lb-verde);
  --bs-success-rgb:    75, 107, 78;
  --bs-info:           var(--lb-ocre);
  --bs-info-rgb:       201, 143, 52;
  --bs-warning-rgb:    201, 143, 52;
  --bs-dark:           var(--lb-tinta);
  --bs-dark-rgb:       36, 33, 29;

  --bs-body-color:     var(--lb-tinta);
  --bs-body-bg:        var(--lb-papel);
  --bs-body-font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size:  1rem;
  --bs-body-line-height:1.6;

  --bs-heading-font-family: "Gelasio", "Fraunces", Georgia, "Times New Roman", serif;
  --bs-heading-font-weight: 600;

  --bs-border-color:   var(--lb-borde);
  --bs-border-width:   1px;
  --bs-border-radius:  0.375rem;
  --bs-border-radius-sm: 0.25rem;
  --bs-border-radius-lg: 0.375rem;
  --bs-border-radius-xl: 0.375rem;
  --bs-border-radius-xxl: 0.375rem;
  --bs-border-radius-pill: 0.25rem;

  --bs-link-color:         var(--lb-azul);
  --bs-link-hover-color:   var(--lb-azul-hover);
  --bs-link-decoration:    underline;
  --bs-link-hover-decoration: underline;

  --bs-input-focus-border-color: var(--lb-azul);
  --bs-input-focus-box-shadow: none;
  --bs-input-focus-ring-color: transparent;

  --bs-box-shadow:        0 4px 12px rgba(36,33,29,0.12);
  --bs-box-shadow-sm:     0 2px 6px rgba(36,33,29,0.08);
  --bs-box-shadow-lg:     0 8px 24px rgba(36,33,29,0.15);
}

/* ─────────────────────────────────────────────────────────
   2. Base
   ───────────────────────────────────────────────────────── */
body {
  background-color: var(--lb-papel);
  color: var(--lb-tinta);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible {
  box-shadow: none !important;
  border-color: var(--lb-azul) !important;
  outline: 2px solid var(--lb-azul);
  outline-offset: 1px;
}

/* ─────────────────────────────────────────────────────────
   3. Typography
   ───────────────────────────────────────────────────────── */
h1, .h1 { font-family: var(--bs-heading-font-family); font-weight: 600; font-size: 2.75rem; line-height: 1.15; }
h2, .h2 { font-family: var(--bs-heading-font-family); font-weight: 600; font-size: 2.125rem; line-height: 1.2; }
h3, .h3 { font-family: var(--bs-heading-font-family); font-weight: 500; font-size: 1.5rem; line-height: 1.3; }
h4, .h4 { font-family: var(--bs-heading-font-family); font-weight: 500; font-size: 1.1875rem; line-height: 1.35; }
h5, .h5 { font-weight: 600; font-size: 1rem; }
h6, .h6 { font-weight: 600; font-size: 0.875rem; }
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: var(--bs-heading-font-family);
}

/* ─────────────────────────────────────────────────────────
   4. Buttons
   ───────────────────────────────────────────────────────── */
.btn {
  border-radius: var(--bs-border-radius-sm);
  font-weight: 500;
  font-family: var(--bs-body-font-family);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background-color: var(--lb-azul);
  border-color: var(--lb-azul);
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover, .btn-primary:active, .btn-primary:focus-visible {
  background-color: var(--lb-azul-hover) !important;
  border-color: var(--lb-azul-hover) !important;
  color: #fff;
  box-shadow: none;
  transform: none;
}

.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--lb-azul);
  color: var(--lb-azul);
  box-shadow: none;
}
.btn-outline-primary:hover, .btn-outline-primary:active {
  background-color: transparent;
  border-color: var(--lb-azul-hover);
  color: var(--lb-azul-hover);
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background-color: var(--lb-verde);
  border-color: var(--lb-verde);
  color: #fff;
  box-shadow: none;
}
.btn-secondary:hover {
  background-color: var(--lb-verde-hover);
  border-color: var(--lb-verde-hover);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.btn-outline-secondary {
  background: transparent;
  border: 1.5px solid var(--lb-verde);
  color: var(--lb-verde);
}
.btn-outline-secondary:hover {
  border-color: var(--lb-verde-hover);
  color: var(--lb-verde-hover);
  box-shadow: none;
}

.btn-lg { border-radius: var(--bs-border-radius-sm); }

/* ── Libera custom buttons ── */
.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.625rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lb-btn--primary {
  background-color: var(--lb-azul);
  color: #fff;
}
.lb-btn--primary:hover { background-color: var(--lb-azul-hover); color: #fff; }
.lb-btn--secondary {
  background-color: var(--lb-verde);
  color: #fff;
}
.lb-btn--secondary:hover { background-color: var(--lb-verde-hover); color: #fff; }
.lb-btn--outline {
  background: transparent;
  border: 1.5px solid var(--lb-azul);
  color: var(--lb-azul);
}
.lb-btn--outline:hover { border-color: var(--lb-azul-hover); color: var(--lb-azul-hover); }
.lb-btn--ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--lb-tinta);
}
.lb-btn--ghost:hover {
  border-color: var(--lb-borde);
  background: var(--lb-papel-oscuro);
  color: var(--lb-azul);
}

/* ─────────────────────────────────────────────────────────
   5. Cards
   ───────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--lb-borde);
  border-radius: var(--bs-border-radius);
  box-shadow: none;
  background: #fff;
  transition: border-color 0.15s ease;
}
.card:hover { box-shadow: none; transform: none; }

/* ── Libera Product Card ── */
.lb-card-producto {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--lb-borde);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.lb-card-producto:hover { border-color: var(--lb-azul); }

.lb-card-producto__img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--lb-papel-oscuro);
}
.lb-card-producto__img img { width: 100%; height: 100%; object-fit: cover; }

.lb-card-producto__badge {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  display: inline-block;
  background: var(--lb-verde);
  color: #fff;
  font-size: 0.75rem; font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.lb-card-producto__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.lb-card-producto__name {
  font-family: var(--bs-heading-font-family);
  font-size: 1.0625rem; font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  color: var(--lb-tinta);
}
.lb-card-producto__org {
  font-size: 0.8125rem;
  color: #6b6560;
  margin: 0 0 0.75rem;
}
.lb-card-producto__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--lb-borde);
}
.lb-card-producto__precio {
  font-size: 1.125rem; font-weight: 600;
  color: var(--lb-terracota);
}

/* ── Libera Category Card ── */
.lb-card-categoria {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--lb-borde);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: var(--lb-tinta);
  transition: border-color 0.15s ease;
}
.lb-card-categoria:hover { border-color: var(--lb-azul); color: var(--lb-tinta); }
.lb-card-categoria__img {
  width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--lb-papel-oscuro);
}
.lb-card-categoria__img img { width: 100%; height: 100%; object-fit: cover; }
.lb-card-categoria__body { padding: 0.75rem 1rem; text-align: center; }
.lb-card-categoria__name {
  font-family: var(--bs-heading-font-family);
  font-size: 1rem; font-weight: 500; margin: 0;
}

/* ─────────────────────────────────────────────────────────
   6. Navigation — tema claro, fondo blanco, acentos azules
   ───────────────────────────────────────────────────────── */
.lb-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: #fff;
  border-bottom: 1px solid var(--lb-borde);
  padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.lb-navbar .nav-link {
  color: var(--lb-tinta);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  transition: color 0.15s ease;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.lb-navbar .nav-link:hover,
.lb-navbar .nav-link.active {
  color: var(--lb-azul);
  border-bottom-color: var(--lb-azul);
}
.lb-navbar .navbar-brand {
  font-family: var(--bs-heading-font-family);
  font-size: 1.25rem; font-weight: 600;
  color: var(--lb-tinta);
  text-decoration: none;
}
.lb-navbar .navbar-brand:hover { color: var(--lb-azul); }
.lb-navbar .navbar-toggler { border-color: var(--lb-borde); }
.lb-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(36,33,29,0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.lb-nav-cart {
  color: var(--lb-tinta);
  font-size: 1.35rem;
  position: relative;
  text-decoration: none;
  transition: color 0.15s ease;
}
.lb-nav-cart:hover { color: var(--lb-azul); }
.lb-nav-cart-badge {
  position: absolute;
  top: -6px; right: -8px;
  background: var(--lb-azul);
  color: #fff;
  font-size: 0.65rem; font-weight: 600;
  width: 1.2rem; height: 1.2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lb-nav-search .form-control {
  background: var(--lb-papel);
  border: 1px solid var(--lb-borde);
  color: var(--lb-tinta);
  border-radius: 4px;
  font-size: 0.875rem;
}
.lb-nav-search .form-control::placeholder { color: #9b9791; }
.lb-nav-search .form-control:focus {
  background: #fff;
  border-color: var(--lb-azul);
  color: var(--lb-tinta);
  box-shadow: none;
  outline: none;
}
.lb-nav-search .btn { border-radius: 4px; }

/* ─────────────────────────────────────────────────────────
   7. Hero — full-width, texto izquierda, overlay si necesario
   ───────────────────────────────────────────────────────── */
.lb-hero {
  position: relative;
  width: 100%;
  min-height: 520px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.lb-hero--full { min-height: 100vh; }

.lb-hero__overlay {
  position: absolute; inset: 0;
  background: rgba(36,33,29,0.35);
}
.lb-hero__content {
  position: relative; z-index: 1;
  max-width: 680px;
  padding: 2.5rem 0;
}
.lb-hero__content h1 {
  font-family: var(--bs-heading-font-family);
  font-weight: 700;
  font-size: 3.5rem;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.25rem;
}
.lb-hero__content p {
  font-size: 1.1875rem; line-height: 1.6;
  color: rgba(255,255,255,0.9);
  margin-bottom: 1.75rem;
  max-width: 540px;
}
.lb-hero__slogan {
  display: inline-block;
  font-family: var(--bs-heading-font-family);
  font-size: 1rem; font-weight: 500;
  font-style: italic;
  color: var(--lb-ocre);
  margin-bottom: 0.75rem;
}

@media (max-width: 767.98px) {
  .lb-hero {
    background-attachment: scroll;
    min-height: 420px;
  }
  .lb-hero--full { min-height: 100vh; }
  .lb-hero__content h1 { font-size: 2rem; }
  .lb-hero__content p { font-size: 1rem; }
  .lb-hero__overlay { background: rgba(36,33,29,0.45); }
}

/* ─────────────────────────────────────────────────────────
   8. Sections
   ───────────────────────────────────────────────────────── */
.lb-section { padding: 5rem 0; }
.lb-section--alt { background-color: var(--lb-papel-oscuro); }
.lb-section--verde {
  background-color: var(--lb-verde);
  color: #fff;
}
.lb-section--verde .lb-section__title { color: #fff; }
.lb-section--verde .lb-section__lead { color: rgba(255,255,255,0.85); }
.lb-section--verde p { color: rgba(255,255,255,0.85); }

.lb-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.lb-section__title {
  font-family: var(--bs-heading-font-family);
  font-weight: 600;
  font-size: 2rem; line-height: 1.2;
  color: var(--lb-tinta);
  margin: 0 0 0.25rem;
}
.lb-section__lead {
  font-size: 1rem;
  color: #6b6560;
  line-height: 1.6;
  margin: 0;
  max-width: 520px;
}

@media (max-width: 767.98px) {
  .lb-section { padding: 3.5rem 0; }
  .lb-section__title { font-size: 1.5rem; }
}

/* ─────────────────────────────────────────────────────────
   9. Footer — tema claro
   ───────────────────────────────────────────────────────── */
.lb-footer {
  background-color: var(--lb-papel);
  color: var(--lb-tinta);
  padding: 3rem 0 1.5rem;
  border-top: 1px solid var(--lb-borde);
}
.lb-footer a {
  color: var(--lb-tinta);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}
.lb-footer a:hover { color: var(--lb-azul); }
.lb-footer__title {
  font-family: var(--bs-heading-font-family);
  font-size: 1.125rem; font-weight: 600;
  color: var(--lb-tinta);
  margin-bottom: 0.75rem;
}
.lb-footer__inpec {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--lb-azul);
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--lb-azul);
}
.lb-footer__inpec strong { color: var(--lb-azul); }
.lb-footer__bottom {
  border-top: 1px solid var(--lb-borde);
  padding-top: 1.25rem;
  margin-top: 2rem;
  font-size: 0.8125rem;
  color: #6b6560;
}

/* ─────────────────────────────────────────────────────────
   10. Badges — Verde Monte más protagonismo
   ───────────────────────────────────────────────────────── */
.lb-badge-categoria {
  display: inline-block;
  background: var(--lb-verde);
  color: #fff;
  font-size: 0.75rem; font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.lb-badge-impacto {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--lb-verde);
  color: #fff;
  font-size: 0.75rem; font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────
   11. Forms
   ───────────────────────────────────────────────────────── */
.lb-form-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--lb-tinta);
  margin-bottom: 0.35rem;
}

/* ─────────────────────────────────────────────────────────
   12. Breadcrumbs
   ───────────────────────────────────────────────────────── */
.lb-breadcrumb .breadcrumb-item a { color: var(--lb-azul); text-decoration: none; }
.lb-breadcrumb .breadcrumb-item.active { color: #6b6560; }
.lb-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--lb-borde); }

/* ─────────────────────────────────────────────────────────
   13. Empty state
   ───────────────────────────────────────────────────────── */
.lb-empty { text-align: center; padding: 3rem 1rem; color: #6b6560; }
.lb-empty__icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }
.lb-empty__title { font-family: var(--bs-heading-font-family); font-size: 1.25rem; color: var(--lb-tinta); margin-bottom: 0.5rem; }
.lb-empty__text { font-size: 0.9375rem; max-width: 400px; margin: 0 auto; }

/* ─────────────────────────────────────────────────────────
   14. Utilities
   ───────────────────────────────────────────────────────── */
.lb-text-azul { color: var(--lb-azul) !important; }
.lb-text-verde { color: var(--lb-verde) !important; }
.lb-text-terracota { color: var(--lb-terracota) !important; }
.lb-text-ocre { color: var(--lb-ocre) !important; }
.lb-text-tinta { color: var(--lb-tinta) !important; }

.lb-bg-papel { background-color: var(--lb-papel) !important; }
.lb-bg-papel-oscuro { background-color: var(--lb-papel-oscuro) !important; }
.lb-bg-verde { background-color: var(--lb-verde) !important; }
.lb-border { border: 1px solid var(--lb-borde) !important; }

/* ─────────────────────────────────────────────────────────
   15. Responsive grids
   ───────────────────────────────────────────────────────── */
.lb-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 1199.98px) { .lb-product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 991.98px)  { .lb-product-grid { grid-template-columns: repeat(2, 1fr); } }
/* mobile: 2 columns, never drop to 1 */

.lb-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 991.98px) { .lb-category-grid { grid-template-columns: repeat(2, 1fr); } }
/* mobile: keep 2 columns */

/* ─────────────────────────────────────────────────────────
   16. Impact / stats row
   ───────────────────────────────────────────────────────── */
.lb-impact-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.lb-impact-row__number {
  font-family: var(--bs-heading-font-family);
  font-size: 2.25rem; font-weight: 600;
  color: var(--lb-azul);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.lb-impact-row__label {
  font-size: 0.875rem;
  color: #6b6560;
}
@media (max-width: 767.98px) {
  .lb-impact-row { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* ─────────────────────────────────────────────────────────
   17. Story image block
   ───────────────────────────────────────────────────────── */
.lb-story-img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--lb-borde);
  overflow: hidden;
}
.lb-story-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ─────────────────────────────────────────────────────────
   18. Decorative accents — Terracota for subtle warmth
   ───────────────────────────────────────────────────────── */
.lb-accent-bar {
  display: block;
  width: 48px; height: 3px;
  background: var(--lb-terracota);
  margin-bottom: 1rem;
}
.lb-highlight-num {
  font-family: var(--bs-heading-font-family);
  font-size: 2.5rem; font-weight: 600;
  color: var(--lb-azul);
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────
   19. Mobile product carousel (home page)
   ───────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .lb-carousel-mobile {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }
  .lb-carousel-mobile::-webkit-scrollbar { display: none; }
  .lb-carousel-mobile > * {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  .lb-product-grid.lb-carousel-mobile {
    display: flex;
    grid-template-columns: unset;
    gap: 0.75rem;
  }
}