/*
 * ui.css — minimal replacement for bootstrap.min.css.
 *
 * Covers only the mechanics this site actually uses (verified by grepping
 * every .html/.php page for data-bs-* attributes and Bootstrap classes):
 * navbar/collapse, modal, carousel, nav-pills/tab-pane, the small grid
 * subset (row/col-12/col-md-6/col-md-12/col-lg-4/g-3/g-4), form controls,
 * and a handful of utility classes that aren't valid Tailwind utilities
 * (d-flex, fw-bold, small, lead, rounded-circle, justify-content-*,
 * align-items-*). Visual design (color, spacing, typography) is Tailwind's
 * job — this file only makes things position/show/hide/animate correctly.
 */

/* ===== Heading defaults =====
 * Tailwind's Preflight reset sets h1-h6 to `font-size: inherit`, so any
 * heading across the site that doesn't carry an explicit Tailwind text-size
 * utility (many don't — they rely on the page's own custom classes like
 * .section-title, which only set color/weight, not size) silently collapsed
 * to the body's 16px instead of looking like a heading. Restoring Bootstrap's
 * original Reboot sizes here fixes every one of them at once; a real
 * text-3xl/text-xl/etc. class on a given heading still wins (a class
 * selector always beats a bare element selector), so already-upgraded
 * headings are unaffected. */
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }
@media (max-width: 575.98px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
}

/* Same story as headings: Tailwind's Preflight strips list-style/padding from
 * every <ul>/<ol> (`list-style: none; margin: 0; padding: 0;`), so any plain
 * content list that expected a browser-default bullet/number (recipe
 * ingredients, product uses, job requirements, etc.) silently lost it.
 * Nav-purpose lists (.navbar-nav, .nav, problem/cause/location lists with
 * their own icon-based bullets) already set list-style:none themselves via a
 * class, which — being a class selector — still wins over this element
 * default, so they're unaffected. */
ul { list-style: disc; }
ol { list-style: decimal; }
ul, ol { padding-left: 1.5rem; margin-top: 0; margin-bottom: 1rem; }
ul ul, ul ol, ol ul, ol ol { margin-bottom: 0; }

/* ===== Grid (subset actually used: col-12, col-md-6, col-md-12, col-lg-4) ===== */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}
.row > * {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  width: 100%;
}
.row.g-3 { margin-left: -0.5rem; margin-right: -0.5rem; row-gap: 1rem; }
.row.g-3 > * { padding-left: 0.5rem; padding-right: 0.5rem; }
.row.g-4 { margin-left: -0.75rem; margin-right: -0.75rem; row-gap: 1.5rem; }
.row.g-4 > * { padding-left: 0.75rem; padding-right: 0.75rem; }

.col-12 { width: 100%; }
@media (min-width: 768px) {
  .col-md-6 { width: 50%; }
  .col-md-12 { width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-4 { width: 33.3333%; }
}

/* ===== Display / flex utilities not covered by Tailwind's own vocabulary ===== */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }
.vstack { display: flex; flex-direction: column; align-self: stretch; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.flex-column { flex-direction: column; }
.flex-grow-1 { flex-grow: 1; }
.h-100 { height: 100%; }

/* ===== Typography helpers ===== */
.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 400; }
.small { font-size: 0.875em; }
.lead { font-size: 1.15rem; font-weight: 300; }
.rounded-circle { border-radius: 50%; }
.rounded-pill { border-radius: 50rem; }

/* ===== Buttons (box model only — each page's own CSS supplies color/gradient) ===== */
.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

/* ===== Cards (box model only — .card-producto/.info-card/etc supply the look) ===== */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.375rem;
}
.card-body { flex: 1 1 auto; padding: 1rem; }
.card-img-top { width: 100%; }
.card-title { margin-bottom: 0.5rem; }
.card-text:last-child { margin-bottom: 0; }

/* ===== Alerts (contact-form success/error messages) ===== */
.alert { position: relative; padding: 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 0.375rem; }
.alert-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.alert-danger { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.alert-warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }
.alert-info { color: #055160; background-color: #cff4fc; border-color: #b6effb; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

/* ===== Ratio (aspect-ratio boxes for images / map iframes) ===== */
.ratio { position: relative; width: 100%; }
.ratio::before { display: block; padding-top: var(--bs-aspect-ratio, 100%); content: ""; }
.ratio > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* ===== Forms ===== */
.form-label { display: inline-block; margin-bottom: 0.375rem; }
.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.85rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control:focus,
.form-select:focus {
  outline: 0;
  border-color: #86b7cb;
  box-shadow: 0 0 0 0.2rem rgba(0, 143, 192, 0.18);
}
.invalid-feedback { display: none; width: 100%; margin-top: 0.25rem; font-size: 0.875em; color: #dc3545; }
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: #dc3545;
}
.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback {
  display: block;
}
.spinner-border {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  vertical-align: -0.125em;
  border: 0.2em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ui-spin 0.75s linear infinite;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.15em; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* Every page's decorative particles.js background div (#particles-js on most
   pages, #particles-bg on index.html) must never capture clicks/taps — it
   sits fixed over the full viewport, and without this it silently eats
   clicks on any content that isn't itself explicitly positioned/stacked
   above it (this was masked before by Bootstrap's own CSS incidentally
   giving several elements a stacking context; it is not one to rely on). */
#particles-js, #particles-bg { pointer-events: none !important; }

/* ===== Navbar ===== */
.navbar { position: relative; display: flex; align-items: center; }
.navbar-toggler {
  padding: 0.35rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 0.375rem;
  cursor: pointer;
}
.navbar-toggler-icon {
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  vertical-align: middle;
  background: no-repeat center / 100% 100%;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(51,65,85,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.navbar-collapse { flex-basis: 100%; flex-grow: 1; }
.nav { display: flex; flex-wrap: wrap; padding-left: 0; margin-bottom: 0; list-style: none; }
.navbar-nav { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; list-style: none; }
.nav-link { display: block; text-decoration: none; cursor: pointer; background: none; border: 0; }
@media (max-width: 991.98px) {
  .navbar-expand-lg .navbar-collapse:not(.show) { display: none; }
}
@media (min-width: 992px) {
  .navbar-expand-lg { flex-wrap: nowrap; }
  .navbar-expand-lg .navbar-collapse { display: flex !important; flex-basis: auto; }
  .navbar-expand-lg .navbar-nav { flex-direction: row; }
  .navbar-expand-lg .navbar-toggler { display: none; }
}

/* ===== Nav pills / tabs (productos.html) ===== */
.tab-pane { display: none; }
.tab-pane.active.show { display: block; }

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  outline: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.modal.show { display: block; }
.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 500px;
  pointer-events: none;
  transform: translateY(-20px);
  transition: transform .2s ease-out;
}
.modal.show .modal-dialog { transform: none; }
.modal-lg { max-width: 800px; }
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  border-radius: 0.5rem;
  outline: 0;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
}
.modal-title { margin-bottom: 0; line-height: 1.5; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1rem; }
.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #dee2e6;
  gap: 0.5rem;
}
.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  color: #000;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: 0.375rem;
  opacity: 0.6;
  cursor: pointer;
}
.btn-close:hover { opacity: 1; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background-color: #000;
  opacity: 0;
  transition: opacity .15s linear;
}
.modal-backdrop.show { opacity: 0.5; }
body.modal-open { overflow: hidden; }

@media (min-width: 576px) {
  .modal-dialog { max-width: 500px; margin: 1.75rem auto; }
}

/* ===== Carousel ===== */
.carousel { position: relative; }
.carousel-inner { position: relative; width: 100%; overflow: hidden; }
.carousel-item {
  position: relative;
  display: none;
  float: left;
  width: 100%;
  margin-right: -100%;
  backface-visibility: hidden;
  transition: transform .6s ease-in-out;
}
.carousel-item.active,
.carousel-item.ui-prev,
.carousel-item.ui-next { display: block; }
.carousel-item.active { transform: translateX(0); }
.carousel-item.ui-next { transform: translateX(100%); }
.carousel-item.ui-prev { transform: translateX(-100%); }
.carousel-item-start.active,
.carousel-item.ui-sliding-prev { transform: translateX(-100%); }
.carousel-item-end.active,
.carousel-item.ui-sliding-next { transform: translateX(100%); }
.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15%;
  padding: 0;
  color: #fff;
  background: none;
  border: 0;
  opacity: 0.7;
  cursor: pointer;
}
.carousel-control-prev:hover, .carousel-control-next:hover { opacity: 0.95; }
.carousel-control-prev { left: 0; }
.carousel-control-next { right: 0; }
.carousel-control-prev-icon,
.carousel-control-next-icon {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  background: no-repeat center / 100% 100%;
}
.carousel-control-prev-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}
.carousel-control-next-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* ===== Positioning helpers (kept last so they win same-specificity ties,
   e.g. against ".navbar{position:relative}" on <nav class="navbar fixed-top">,
   exactly like Bootstrap's own utilities-last cascade order) ===== */
.fixed-top { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; }
.fixed-bottom { position: fixed; right: 0; bottom: 0; left: 0; z-index: 1030; }
.sticky-top { position: sticky; top: 0; z-index: 1020; }
