/* ==========================================================
   Distrienvios Web - estilos del sitio
   ========================================================== */

:root {
  --color-primary: #123785;
  --color-primary-dark: #123882;
  --color-accent: #16ab5d;
  --color-accent-hover: #309747;
  --color-accent-dark: #0c6f36;
  --color-title: #284e9a;
  --color-text: #212121;
  --color-text-muted: #848689;
  --color-link-muted: #9e9e9e;
  --color-gray-bg: #e6e7e9;
  --color-footer-bg: #f1f1f3;
  --font-heading: 'Comfortaa', sans-serif;
  --font-nav: 'Gothic A1', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-height: 120px;
  --content-width: 1100px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  border: 0;
}

::selection {
  background-color: var(--color-accent-hover);
  color: #fff;
}

/* ==========================================================
   Header
   ========================================================== */
.mdl-layout__header.site-header {
  min-height: var(--header-height);
  background-color: #fff;
  color: var(--color-primary);
  /* Permite que el submenú se despliegue por fuera del header */
  overflow: visible;
}

.site-header__row {
  height: var(--header-height);
  padding-left: 40px;
  overflow: visible;
}

.site-header__logo {
  display: block;
  width: 350px;
  height: auto;
}

.site-nav {
  height: 100%;
  overflow: visible;
}

.mdl-layout__header .site-nav__link,
.mdl-layout__header .site-nav__link:visited {
  display: flex;
  align-items: center;
  height: 100%;
  font-family: var(--font-nav);
  font-size: 17px;
  font-weight: bold;
  color: var(--color-primary);
  opacity: 1;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  box-sizing: border-box;
}

.mdl-layout__header .site-nav__link:hover,
.mdl-layout__header .site-nav__link.is-active {
  color: var(--color-accent-hover);
  border-bottom-color: var(--color-accent-hover);
}

.site-nav__caret {
  font-size: 20px;
  margin-left: 2px;
}

.site-nav__dropdown {
  position: relative;
  height: 100%;
}

.site-nav__menu {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  min-width: 280px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background-color: var(--color-primary);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.site-nav__dropdown:hover .site-nav__menu,
.site-nav__dropdown:focus-within .site-nav__menu {
  visibility: visible;
  opacity: 1;
}

.site-nav__menu a {
  display: block;
  padding: 10px 24px;
  font-family: var(--font-nav);
  font-size: 15px;
  font-weight: bold;
  line-height: 1.4;
  white-space: nowrap;
  color: #fff;
}

.site-nav__menu a:hover {
  color: var(--color-accent-hover);
  background-color: rgba(255, 255, 255, 0.06);
}

/* Botón del drawer: solo visible en móvil */
.site-header .mdl-layout__drawer-button {
  display: none;
  color: var(--color-primary);
}

/* ==========================================================
   Drawer (móvil)
   ========================================================== */
.site-drawer {
  border-right: none;
}

.site-drawer__title {
  position: relative;
  height: 56px;
  background: var(--color-primary);
}

.site-drawer__logo {
  position: absolute;
  bottom: 16px;
  width: 140px;
  height: 28px;
}

.site-drawer .mdl-navigation {
  padding-top: 5px;
}

.site-drawer .mdl-navigation__link {
  font-size: 14px;
  color: #757575;
}

.site-drawer .mdl-navigation__link.is-active {
  font-weight: bold;
  color: var(--color-primary);
  border-left: 3px solid var(--color-accent-hover);
}

.site-drawer .site-drawer__section {
  font-weight: bold;
  color: var(--color-accent-dark);
}

.site-drawer__separator {
  height: 1px;
  margin: 5px 0;
  background-color: #dcdcdc;
}

/* ==========================================================
   Elementos comunes
   ========================================================== */
.page-banner {
  display: block;
  width: 100%;
}

.divider {
  width: 60px;
  margin: 16px 0 24px;
  border: 0;
  border-top: 3px solid var(--color-accent);
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: bold;
}

.band-title {
  margin: 0 0 40px;
  padding: 10px 16px;
  font-family: var(--font-heading);
  font-size: 32px;
  color: #fff;
  background-color: var(--color-primary-dark);
}

.link-accent {
  display: inline-block;
  margin-top: 16px;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-accent-hover);
}

.link-accent:hover {
  color: var(--color-accent-dark);
}

.btn-primary.mdl-button {
  width: 100%;
  height: 45px;
  margin-top: 20px;
  font-family: var(--font-heading);
  font-weight: bold;
  color: #fff;
  background-color: var(--color-accent-hover);
}

.btn-primary.mdl-button:hover {
  background-color: var(--color-accent-dark);
}

.btn-primary.mdl-button[disabled] {
  color: #fff;
  background-color: var(--color-text-muted);
}

/* ==========================================================
   Inicio
   ========================================================== */
.slider {
  overflow: hidden;
}

.slider__track {
  display: flex;
  transition: transform 0.5s ease-in;
}

.slider__slide {
  flex: 0 0 100%;
}

.slider__slide img {
  display: block;
  width: 100%;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 60px 24px;
}

.hero__text {
  max-width: 420px;
}

.hero__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: bold;
  line-height: 37px;
}

.hero .divider {
  width: 40%;
}

.hero__description {
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 25px;
}

.hero__image {
  width: 33%;
  min-width: 260px;
}

.clients {
  padding-bottom: 40px;
  text-align: center;
}

.clients__logos {
  width: 66%;
}

/* ==========================================================
   Servicios
   ========================================================== */
.section-header {
  padding: 24px max(24px, calc((100% - var(--content-width)) / 2)) 4px;
  background-color: var(--color-gray-bg);
}

.section-header--plain {
  background-color: transparent;
  padding-top: 40px;
}

.section-header__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: bold;
}

.section-header__subtitle {
  margin: 8px 0 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: bold;
}

.feature {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px;
  box-sizing: border-box;
}

.feature__media {
  flex: 0 0 40%;
  text-align: center;
}

.feature__media img {
  max-width: 60%;
}

.feature__title {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: bold;
}

.feature__text {
  font-family: var(--font-heading);
  font-size: 15px;
  line-height: 26px;
}

.check-list {
  margin: 12px 0 0;
  padding-left: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 22px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 48px max(24px, calc((100% - var(--content-width)) / 2));
}

.service-grid--gray {
  background-color: var(--color-gray-bg);
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.service-card__title {
  min-height: 48px;
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: bold;
  line-height: 24px;
}

.service-card__icon {
  height: 110px;
  width: auto;
  object-fit: contain;
}

.service-card__text {
  margin-top: 20px;
  font-family: var(--font-heading);
  font-size: 13px;
  line-height: 21px;
}

/* ==========================================================
   Nosotros
   ========================================================== */
.text-block {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 28px;
}

.text-block--gray {
  max-width: none;
  padding-left: max(24px, calc((100% - 760px) / 2));
  padding-right: max(24px, calc((100% - 760px) / 2));
  background-color: var(--color-gray-bg);
}

.text-block__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: bold;
}

/* ==========================================================
   Blog
   ========================================================== */
.post {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  font-family: var(--font-heading);
  font-size: 15px;
  line-height: 26px;
  text-align: justify;
}

.post__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 29px;
  font-weight: bold;
  line-height: 40px;
  text-align: left;
}

.post__image {
  display: block;
  margin: 24px 0;
}

.post__services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 32px;
  font-weight: bold;
}

/* ==========================================================
   Rastrear y contacto
   ========================================================== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 24px 64px;
  box-sizing: border-box;
}

.split--top {
  align-items: start;
  padding-top: 56px;
}

.split__image {
  justify-self: center;
  width: 55%;
}

.form-card {
  padding: 20px 30px;
  background-color: var(--color-gray-bg);
  border-radius: 10px;
}

.form-card__inner {
  padding: 30px;
  background-color: #fff;
  border-radius: 4px;
}

.form-card__label {
  margin: 0;
  padding: 10px 16px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  background-color: var(--color-primary);
  border-radius: 3px;
}

.form-field {
  display: block;
  width: 100%;
  margin-top: 15px;
  padding: 10px 16px;
  box-sizing: border-box;
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--color-text);
  border: 1px solid #c9cacc;
  border-radius: 20px;
  outline: none;
}

.form-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(18, 55, 133, 0.15);
}

.form-field--textarea {
  height: 100px;
  resize: vertical;
  border-radius: 12px;
}

.form-card__status {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--color-accent-dark);
  text-align: center;
}

.form-card__status.is-error {
  color: #c62828;
}

.branch {
  margin-bottom: 24px;
  font-family: var(--font-heading);
}

.branch__city {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: bold;
}

.branch address {
  font-style: normal;
  font-size: 14px;
  line-height: 24px;
  color: #444;
}

.branch a {
  color: var(--color-primary);
}

.branch-map {
  width: 100%;
  height: 340px;
  border: 0;
}

/* ==========================================================
   Resultado de rastreo
   ========================================================== */
.tracking-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.tracking-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.tracking-search .form-field {
  width: 260px;
  margin-top: 0;
}

.tracking-search .btn-primary.mdl-button {
  width: auto;
  margin-top: 0;
  padding: 0 28px;
}

.tracking {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px 64px;
  box-sizing: border-box;
}

.notice {
  padding: 20px 24px;
  font-size: 16px;
  background-color: var(--color-gray-bg);
  border-left: 4px solid var(--color-primary);
  border-radius: 4px;
}

.notice--error {
  border-left-color: #c62828;
}

.tracking-card {
  margin-bottom: 24px;
  padding: 28px 32px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tracking-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.tracking-card__label {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.tracking-card__code {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: bold;
  color: var(--color-primary);
}

.tracking-card__title {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: bold;
}

.status-badge {
  padding: 6px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  background-color: var(--color-accent-hover);
  border-radius: 20px;
}

.tracking-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 32px;
  margin: 0;
}

.tracking-details dt {
  font-size: 13px;
  color: var(--color-text-muted);
}

.tracking-details dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 500;
  word-break: break-word;
}

.tracking-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
  color: var(--color-primary);
}

.action-link:hover {
  color: var(--color-accent-hover);
}

/* ==========================================================
   Estadísticas de distribución (clientes corporativos)
   ========================================================== */
.stats {
  max-width: var(--content-width);
  margin: 0 auto 48px;
  padding: 0 16px;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  color: #fff;
  background-color: var(--color-primary);
  border-radius: 4px;
}

.stats-bar form {
  margin: 0;
}

.stats-bar__logout {
  margin: 0;
  padding: 0;
  font: inherit;
  font-weight: bold;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}

.stats-bar__logout:hover {
  color: var(--color-gray-bg);
  text-decoration: underline;
}

.stats-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: end;
  padding: 20px;
  margin-bottom: 20px;
  background-color: var(--color-footer-bg);
  border-radius: 4px;
}

.stats-filter__field label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: var(--color-title);
}

.stats-filter__field .form-field {
  width: 100%;
  margin: 0;
}

.stats-filter__actions {
  display: flex;
  gap: 12px;
  grid-column: 1 / -1;
}

.stats-filter__actions .mdl-button {
  width: auto;
  margin-top: 0;
  padding: 0 24px;
}

.btn-secondary.mdl-button {
  height: 45px;
  font-family: var(--font-heading);
  font-weight: bold;
  color: #fff;
  background-color: var(--color-primary);
}

.btn-secondary.mdl-button:hover {
  background-color: var(--color-primary-dark);
}

.stats-hint {
  margin-top: 16px;
  color: var(--color-text-muted);
}

.stats-title {
  margin: 24px 0 12px;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--color-title);
}

.stats-table-wrap {
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table th {
  position: sticky;
  top: 0;
  padding: 10px 8px;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  background-color: var(--color-primary);
}

.stats-table td {
  padding: 8px;
  border-top: 1px solid #eee;
}

.stats-table tbody tr:nth-child(even) {
  background-color: #f7f8fa;
}

.stats-table .num {
  text-align: right;
}

.stats-table .link-accent {
  margin: 0;
  font-size: 13px;
}

@media (max-width: 600px) {
  .stats-filter__actions {
    flex-direction: column;
  }

  .stats-filter__actions .mdl-button {
    width: 100%;
  }
}

/* ==========================================================
   WhatsApp y footer
   ========================================================== */
.whatsapp-banner img {
  display: block;
  width: 100%;
}

.mdl-mega-footer.site-footer {
  padding: 40px 40px 32px;
  font-family: var(--font-body);
  background-color: var(--color-footer-bg);
}

/* Tres columnas repartidas a lo ancho, como el sitio original */
.site-footer__columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 340px));
  justify-content: space-around;
  gap: 40px;
}

.site-footer__title {
  margin: 0 0 20px;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 500;
  line-height: 30px;
  color: var(--color-title);
}

.site-footer__list {
  margin: 0;
  padding-left: 1em;
  list-style: none;
  font-size: 14px;
  line-height: 24px;
  color: var(--color-text-muted);
}

.site-footer__list li::before {
  content: "\2022";
  display: inline-block;
  width: 1em;
  margin-left: -1em;
  font-weight: bold;
  color: var(--color-title);
}

.site-footer__list a {
  font-size: 14px;
  font-weight: bold;
  color: var(--color-link-muted);
}

.site-footer__list a:hover {
  color: var(--color-accent-dark);
}

.site-footer__contact {
  font-style: normal;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text-muted);
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1489px) {
  .site-header__logo { width: 300px; }
  .mdl-layout__header .site-nav__link { font-size: 15px; }
}

@media (max-width: 1200px) {
  .site-header__logo { width: 240px; }
  .site-nav .mdl-navigation__link { padding: 0 10px; }
}

@media (max-width: 900px) {
  :root { --header-height: 80px; }

  .site-nav { display: none; }
  .site-header .mdl-layout__drawer-button { display: block; margin-top: 12px; }
  .site-header__row { padding-left: 72px; }
  .site-header__logo { width: 220px; }

  .hero,
  .feature { flex-direction: column; text-align: center; }
  .hero .divider { margin: 24px auto; }
  .hero__image { width: 80%; }
  .clients__logos { width: 90%; }

  .service-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .site-footer__columns { grid-template-columns: 1fr; justify-content: start; }
  .tracking-details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .tracking-details { grid-template-columns: 1fr; }
  .tracking-search { width: 100%; }
  .tracking-search .form-field { flex: 1; width: auto; }
  .tracking-card { padding: 20px; }
}

@media (max-width: 600px) {
  .service-grid { grid-template-columns: 1fr; }
  .form-card { padding: 12px; }
  .form-card__inner { padding: 20px; }
}
