/* =========================================================
   HTP CONTACT BUTTONS — V1.1
   Brighter native-icon treatment for Hưng Thịnh Global Pack.
   Desktop: prominent floating rail on the right.
   Mobile: fixed 3-column bottom action bar.
========================================================= */

.htp-contact-buttons {
  --htp-cb-red: var(--htp-red, #ed1c24);
  --htp-cb-red-soft: #fff3f4;
  --htp-cb-navy: var(--htp-navy, #0c1c2e);
  --htp-cb-text: #111820;
  --htp-cb-line: #e8ebef;
  --htp-cb-font-heading: var(--htp-font-heading, 'Anton', Arial, sans-serif);
  --htp-cb-font-body: var(--htp-font-body, 'Lato', Arial, sans-serif);

  position: fixed;
  right: 18px;
  top: 50%;
  z-index: 9990;
  display: grid;
  width: 112px;
  padding: 7px;
  border: 1px solid rgba(12, 28, 46, .10);
  border-radius: 14px;
  background: rgba(255, 255, 255, .985);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, .23),
    0 3px 10px rgba(0, 0, 0, .10);
  transform: translateY(-50%);
  overflow: hidden;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}

/* Brand accent makes the rail immediately visible without recolouring icons. */
.htp-contact-buttons::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--htp-cb-red);
  z-index: 2;
}

.htp-contact-buttons *,
.htp-contact-buttons *::before,
.htp-contact-buttons *::after {
  box-sizing: border-box;
}

.htp-contact-button {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  min-height: 102px;
  margin: 0 !important;
  padding: 11px 5px 9px !important;
  border: 0 !important;
  border-radius: 8px !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--htp-cb-text) !important;
  font-family: var(--htp-cb-font-body) !important;
  text-align: center;
  text-decoration: none !important;
  text-transform: none !important;
  cursor: pointer;
  transition:
    background-color .18s ease,
    color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.htp-contact-button + .htp-contact-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--htp-cb-line);
}

.htp-contact-button:hover,
.htp-contact-button:focus-visible {
  background: var(--htp-cb-red-soft) !important;
  color: var(--htp-cb-red) !important;
  transform: translateX(-5px) scale(1.025);
  box-shadow: 0 8px 18px rgba(237, 28, 36, .11) !important;
}

.htp-contact-button:focus-visible {
  outline: 2px solid var(--htp-cb-red) !important;
  outline-offset: -2px;
}

/* Native HTP icon: no circle, no CSS recolour/filter. */
.htp-contact-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 0 0 auto;
  transition: transform .18s ease;
}

.htp-contact-button:hover .htp-contact-button__icon,
.htp-contact-button:focus-visible .htp-contact-button__icon {
  transform: scale(1.10);
}

.htp-contact-button__icon img,
.htp-contact-buttons .htp-contact-button__icon img.htp-icon {
  display: block;
  width: 46px !important;
  height: 46px !important;
  max-width: 46px !important;
  max-height: 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain;
  filter: none !important;
  opacity: 1 !important;
}

.htp-contact-button__label {
  display: block;
  max-width: 100%;
  color: var(--htp-cb-navy);
  font-family: var(--htp-cb-font-heading) !important;
  font-size: 13px;
  font-weight: 400 !important;
  line-height: 1.12;
  letter-spacing: .01em;
  text-transform: uppercase;
  white-space: normal;
  transition: color .18s ease;
}

.htp-contact-button:hover .htp-contact-button__label,
.htp-contact-button:focus-visible .htp-contact-button__label {
  color: var(--htp-cb-red);
}

/* Secondary cue shown on desktop to strengthen the CTA. */
.htp-contact-button__meta {
  display: block;
  max-width: 100%;
  margin-top: -2px;
  color: #7b8490;
  font-family: var(--htp-cb-font-body) !important;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .02em;
  white-space: normal;
}

.htp-contact-button--call .htp-contact-button__meta {
  font-size: 8px;
}

@media (min-width: 768px) {
  .htp-contact-buttons--no-desktop {
    display: none !important;
  }
}

/* Keep the control usable on shorter desktop screens. */
@media (min-width: 768px) and (max-height: 700px) {
  .htp-contact-buttons {
    width: 102px;
  }

  .htp-contact-button {
    min-height: 87px;
    gap: 4px;
    padding-top: 8px !important;
    padding-bottom: 7px !important;
  }

  .htp-contact-button__icon {
    width: 46px;
    height: 46px;
  }

  .htp-contact-button__icon img,
  .htp-contact-buttons .htp-contact-button__icon img.htp-icon {
    width: 39px !important;
    height: 39px !important;
    max-width: 39px !important;
    max-height: 39px !important;
  }

  .htp-contact-button__label {
    font-size: 12px;
  }

  .htp-contact-button__meta {
    display: none;
  }
}

/* ========================= MOBILE ========================= */
@media (max-width: 767px) {
  body.htp-cb-active {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .htp-contact-buttons--no-mobile {
    display: none !important;
  }

  .htp-contact-buttons {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(7px + env(safe-area-inset-bottom, 0px));
    z-index: 9990;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: auto;
    max-width: none;
    min-height: 66px;
    padding: 4px;
    border: 1px solid rgba(12, 28, 46, .12);
    border-radius: 13px;
    background: rgba(255, 255, 255, .985);
    box-shadow:
      0 -4px 18px rgba(0, 0, 0, .10),
      0 10px 28px rgba(0, 0, 0, .20);
    transform: none;
    overflow: hidden;
  }

  .htp-contact-buttons::before {
    height: 3px;
  }

  .htp-contact-button {
    min-height: 62px;
    gap: 3px;
    padding: 6px 2px 4px !important;
    border-radius: 8px !important;
  }

  .htp-contact-button + .htp-contact-button::before {
    top: 10px;
    bottom: 8px;
    left: 0;
    right: auto;
    width: 1px;
    height: auto;
    background: var(--htp-cb-line);
  }

  .htp-contact-button:hover,
  .htp-contact-button:focus-visible,
  .htp-contact-button:active {
    background: var(--htp-cb-red-soft) !important;
    transform: none;
    box-shadow: none !important;
  }

  .htp-contact-button__icon {
    width: 34px;
    height: 34px;
  }

  .htp-contact-button__icon img,
  .htp-contact-buttons .htp-contact-button__icon img.htp-icon {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
  }

  .htp-contact-button__label {
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
  }

  .htp-contact-button__meta {
    display: none;
  }
}

@media (max-width: 360px) {
  .htp-contact-buttons {
    left: 5px;
    right: 5px;
  }

  .htp-contact-button__icon {
    width: 31px;
    height: 31px;
  }

  .htp-contact-button__icon img,
  .htp-contact-buttons .htp-contact-button__icon img.htp-icon {
    width: 27px !important;
    height: 27px !important;
    max-width: 27px !important;
    max-height: 27px !important;
  }

  .htp-contact-button__label {
    font-size: 10px;
    letter-spacing: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .htp-contact-button,
  .htp-contact-button__icon {
    transition: none;
  }
}

@media print {
  .htp-contact-buttons {
    display: none !important;
  }
}
