/*
 * Global Responsive Breakpoints
 *
 * These media queries set CSS custom properties at different viewport widths,
 * matching the production breakpoint system. They use !important to override
 * inline styles set by applyThemeToDOM() in JavaScript, which are static and
 * don't respond to viewport changes.
 *
 * Breakpoints: 600px, 768px, 1024px, 1300px, 1440px, 1600px
 */

/* ===== BASE (Mobile-first defaults, < 600px) ===== */
:root {
  --body-padding-horizontal: 20px !important;
  --body-padding-vertical: 40px !important;

  --font-size: 0.8rem;
  --line-height: 1.2;

  --text-xs-font-size: 0.6rem;
  --text-xs-line-height: 1;
  --text-sm-font-size: 0.8rem;
  --text-sm-line-height: 1;
  --text-base-font-size: 1rem;
  --text-base-line-height: 1.4;
  --text-md-font-size: 1.2rem;
  --text-md-line-height: 1.3;
  --text-lg-font-size: 1.4rem;
  --text-lg-line-height: 1.3;
  --text-2lg-font-size: 1.5rem;
  --text-2lg-line-height: 1.2;
  --text-3lg-font-size: 1.8rem;
  --text-3lg-line-height: 1.2;
  --text-xl-font-size: 2rem;
  --text-xl-line-height: 1.2;
  --text-2xl-font-size: 2.1rem;
  --text-2xl-line-height: 1.2;
  --text-3xl-font-size: 2.5rem;
  --text-3xl-line-height: 1.2;

  --section-title-font-size: var(--text-2xl-font-size);
  --section-title-font-size-small: var(--text-2lg-font-size);

  --header-padding-top: 20px;
  --header-padding-bottom: 20px;

  --page-horizontal-padding: 26px;
  --page-content-max-width: none;

  --row-flex-direction: column !important;
  --row-text-column-gap: 20px !important;
  --row-text-column-flex: 1;
  --row-image-column-flex: 1;
  --row-image-max-width: 100%;
  --row-image-max-height: 600px;

  --section-footer-button-font-size: 1rem;
  --section-footer-button-icon-font-size: 1rem;

  --btn-padding: 8px 25px;
}

/* ===== 600px+ (Small tablet / landscape mobile) ===== */
@media (width >= 600px) {
  :root {
    --font-size: 0.9rem;
    --line-height: 1.4;
  }
}

/* ===== 1024px+ (Desktop) ===== */
@media (width >= 1024px) {
  :root {
    --text-xs-font-size: 0.8rem;
    --text-xs-line-height: 1;
    --text-sm-font-size: 0.9rem;
    --text-sm-line-height: 1;
    --text-base-font-size: 1.15rem;
    --text-base-line-height: 1.4;
    --text-md-font-size: 1.3rem;
    --text-md-line-height: 1.3;
    --text-lg-font-size: 1.55rem;
    --text-lg-line-height: 1.3;
    --text-2lg-font-size: 1.7rem;
    --text-2lg-line-height: 1.2;

    --text-xl-font-size: 2.75rem !important;
    --text-xl-line-height: 1;
    --text-2xl-font-size: 3rem !important;
    --text-2xl-line-height: 1.2;
    --text-3xl-font-size: 3.5rem !important;
    --text-3xl-line-height: 1;

    --body-padding-horizontal: 56px !important;
    --body-padding-vertical: 70px !important;
    --row-flex-direction: row !important;
    --row-text-column-gap: 40px !important;
    --row-image-max-width: 100%;

    --btn-padding: 12px 25px;
  }
}

/* ===== 1300px+ ===== */
@media (width >= 1300px) {
  :root {
    --body-padding-vertical: 100px !important;
  }
}

/* ===== 1440px+ (Large desktop) ===== */
@media (width >= 1440px) {
  :root {
    --body-padding-horizontal: 120px !important;
    --header-padding-top: 40px;
    --header-padding-bottom: 40px;
    --section-footer-button-font-size: 1.2rem;
  }
}

/* ===== 1600px+ (Ultra-wide) ===== */
@media (width >= 1600px) {
  :root {
    --page-content-max-width: 1400px;
  }
}

/* ===== Global element styles ===== */
:root {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
}

.page-container-parent {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
  justify-content: space-between;
  margin: 0;
}

.page-container-parent .page-container-child {
  flex: 1;
  overflow: hidden;
}

/* Row layout (used by hero sections, panel usuario, etc.) */
.row {
  display: flex;
  flex-direction: var(--row-flex-direction);
}

.row > .col {
  display: flex;
  flex-direction: column;
  gap: var(--row-text-column-gap);
  flex: var(--row-text-column-flex);
}

.row > .col-img {
  display: grid;
  place-items: center;
  grid-template-columns: repeat(1, 1fr);
  flex: var(--row-image-column-flex);
}

.row > .col-img img {
  max-width: var(--row-image-max-width);
  max-height: var(--row-image-max-height);
}

@media (width >= 1024px) {
  .row {
    --row-flex-direction: row;
  }

  .row .col-img {
    display: grid;
    place-items: center;
  }

  .btn {
    --btn-padding: 12px 25px;
  }
}

/* Section title */
.section__title {
  text-align: center;
  margin: 0 auto;
  font-size: var(--section-title-font-size);
}

.section__title small {
  font-size: var(--section-title-font-size-small);
  display: block;
  margin-bottom: 14px;
  font-weight: var(--font-weight-regular);
}

/* Button base */
.btn {
  padding: var(--btn-padding);
  border-radius: var(--btn-border-radius, 40px);
  font-weight: var(--font-weight-semibold);
  display: inline-flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  text-wrap: nowrap;
}

.btn svg {
  width: 20px;
}

/* Section footer buttons */
.section-footer-buttons {
  text-align: center;
}

.section-footer-buttons .btn {
  font-size: var(--section-footer-button-font-size);
}

.section-footer-buttons svg {
  font-size: var(--section-footer-button-icon-font-size);
}

/* Heading typography */
h1 {
  font-size: var(--text-2xl-font-size);
  line-height: var(--text-2xl-line-height);
  text-wrap: balance;
  font-weight: var(--font-weight-light);
}

h2 {
  font-size: var(--text-xl-font-size);
  line-height: var(--text-xl-line-height);
  text-wrap: balance;
  font-weight: var(--font-weight-light);
}

h2 small {
  font-size: var(--text-2lg-font-size);
  display: block;
  margin-bottom: 14px;
  font-weight: var(--font-weight-bold);
}

h3 {
  font-size: var(--text-2lg-font-size);
  line-height: var(--text-2lg-line-height);
  text-wrap: balance;
  font-weight: var(--font-weight-semibold);
}

p {
  font-size: var(--text-base-font-size);
  line-height: var(--text-base-line-height);
  font-weight: var(--font-weight-medium);
}

/* Dividers */
.divider {
  height: var(--section-divider-height, 1px);
  background: var(--section-divider-color, var(--color-primary));
  display: block;
}

.section-divider {
  height: var(--section-divider-height, 1px);
  background-color: var(--section-divider-color, var(--color-primary));
  margin: var(--section-divider-margin-vertical, 30px) 0;
}
