/* =========================================================
   Rutao Static Home - Common CSS
   Header / Navigation / Search / Mobile Drawer / Footer
   ========================================================= */

/* ========== Variables ========== */
:root {
  --rutao-dark: #242d2d;
  --rutao-black: #1a1a1d;
  --rutao-accent: #ffc439;
  --rutao-accent-hover: #e6b000;
  --rutao-orange: #ff7f00;
  --rutao-text: #242d2d;
  --rutao-muted: #5f5f5f;
  --rutao-white: #ffffff;
  --rutao-container: 1320px;
}

/* ========== Reset ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--rutao-text);
  line-height: 1.6;
  background: #fff;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* ========== Header ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  background: transparent;
  color: #fff;

  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled,
.site-header.is-menu-open {
  background: var(--rutao-dark);
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.header-inner {
  max-width: var(--rutao-container);
  height: 72px;
  margin: 0 auto;
  padding: 0 1.5rem;

  display: flex;
  align-items: center;
  gap: 24px;
}

.header-logo {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
}

.header-logo img {
  height: 38px;
  width: auto;
}

/* ========== Desktop Navigation ========== */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;

  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 8px 14px;

  border-radius: 4px;
  white-space: nowrap;

  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-menu > li > a:hover {
  color: var(--rutao-accent);
}

/* ========== Desktop Dropdown / Mega Menu ========== */
@media (min-width: 1025px) {
  .header-nav .nav-menu > .has-drop > a {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .header-nav .nav-menu > .has-drop > a::after {
    content: "";
    display: inline-block;

    width: 6px;
    height: 6px;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;

    transform: rotate(45deg) translateY(-2px);
    transition: none;
  }

  .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;

    min-width: 180px;
    padding: 8px 0;

    background: #fff;
    color: var(--rutao-text);
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);

    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);

    transition:
      opacity 0.2s ease,
      visibility 0.2s ease,
      transform 0.2s ease;

    z-index: 100;
  }

  .has-drop:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .sub-menu li a {
    display: block;
    padding: 8px 20px;

    font-size: 13px;
    font-weight: 500;

    transition: color 0.2s ease, background-color 0.2s ease;
  }

  .sub-menu li a:hover {
    background: #f5f5f5;
    color: var(--rutao-orange);
  }

  .mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;

    min-width: 700px;
    padding: 28px 32px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;

    background: #fff;
    color: var(--rutao-text);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);

    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(8px);

    transition:
      opacity 0.2s ease,
      visibility 0.2s ease,
      transform 0.2s ease;

    z-index: 100;
  }

  .has-drop:hover > .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  .mega-col h3 {
    margin-bottom: 8px;

    color: var(--rutao-black);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mega-col h3 a:hover {
    color: var(--rutao-orange);
  }

  .mega-col ul li a {
    display: block;
    padding: 4px 0;

    color: var(--rutao-muted);
    font-size: 13px;

    transition: color 0.2s ease;
  }

  .mega-col ul li a:hover {
    color: var(--rutao-orange);
  }
}

/* ========== Header Actions ========== */
.header-actions {
  position: relative;
  z-index: 20;

  flex: 0 0 auto;

  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-quote {
  display: inline-block;

  padding: 8px 18px;
  border-radius: 4px;

  background: var(--rutao-accent);
  color: var(--rutao-black);

  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;

  transition: background-color 0.2s ease;
}

.btn-quote:hover {
  background: var(--rutao-accent-hover);
}

.btn-menu {
  display: none;
  flex-direction: column;
  gap: 5px;

  padding: 6px;

  border: 0;
  background: transparent;
  cursor: pointer;
}

.btn-menu span {
  display: block;

  width: 22px;
  height: 2px;

  background: #fff;
  border-radius: 2px;

  transition: transform 0.3s ease, opacity 0.3s ease;
}

.btn-menu.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.btn-menu.open span:nth-child(2) {
  opacity: 0;
}

.btn-menu.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Header Search ========== */
.header-search {
  position: relative;

  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;

  flex: 0 0 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  white-space: nowrap;
  overflow: visible;
}

.header-search-input {
  position: absolute;
  right: 38px;
  top: 50%;

  width: 170px;
  height: 28px;

  opacity: 0;
  transform: translateY(-50%) scaleX(0);
  transform-origin: right center;

  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;

  background: transparent;
  color: inherit;

  font-size: 14px;
  line-height: 1.4;
  outline: none;

  pointer-events: none;

  transition:
    opacity 0.2s ease,
    transform 0.25s ease,
    border-color 0.2s ease;

  z-index: 30;
}

.header-search.is-open .header-search-input {
  opacity: 1;
  transform: translateY(-50%) scaleX(1);
  border-bottom-color: currentColor;
  pointer-events: auto;
}

.header-search-input::placeholder {
  color: currentColor;
  opacity: 0.55;
}

.header-search-button {
  position: relative;
  z-index: 35;

  width: 32px;
  height: 32px;
  min-width: 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;

  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.header-search-button:hover {
  opacity: 0.75;
}

/* ========== Mobile Overlay ========== */
.mobile-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.55);

  opacity: 0;
  visibility: hidden;

  transition: opacity 0.25s ease, visibility 0.25s ease;

  z-index: 1998;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ========== Mobile Drawer ========== */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;

  width: min(86vw, 380px);
  height: 100vh;

  padding: 72px 24px 32px;

  background: var(--rutao-dark);
  color: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25);

  overflow-x: hidden;
  overflow-y: auto;

  transform: translateX(100%);
  transition: transform 0.28s ease;

  z-index: 1999;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-close {
  position: absolute;
  top: 18px;
  right: 22px;

  width: 34px;
  height: 34px;

  border: 0;
  background: transparent;
  color: #fff;

  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.mobile-drawer-content {
  width: 100%;
}

.mobile-drawer-content .nav-menu {
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;

  font-size: 15px;
  font-weight: 600;
}

.mobile-drawer-content .nav-menu > li {
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-drawer-content .nav-menu > li > a {
  position: relative;

  width: 100%;
  padding: 14px 0;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;
  text-align: center;
  border-radius: 0;
}

.mobile-drawer-content .has-drop > a::after {
  content: "+";

  position: absolute;
  right: 0;

  font-size: 20px;
  font-weight: 400;
  opacity: 0.75;
}

.mobile-drawer-content .has-drop.open > a::after {
  content: "−";
}

.mobile-drawer-content .sub-menu,
.mobile-drawer-content .mega-menu {
  position: static;

  width: 100%;
  min-width: 0;
  max-width: 100%;

  margin: 0 0 16px;
  padding: 14px 18px;

  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 8px;
  box-shadow: none;

  opacity: 1;
  visibility: visible;
  transform: none;

  box-sizing: border-box;

  display: none;
}

.mobile-drawer-content .has-drop.open > .sub-menu {
  display: block;
}

.mobile-drawer-content .has-drop.open > .mega-menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.mobile-drawer-content .mega-col {
  width: 100%;
  min-width: 0;
}

.mobile-drawer-content .mega-col h3 {
  margin: 10px 0 6px;

  color: var(--rutao-accent);
  font-size: 13px;
  text-align: left;
}

.mobile-drawer-content .mega-col h3 a {
  color: var(--rutao-accent);
}

.mobile-drawer-content .mega-col ul {
  width: 100%;
}

.mobile-drawer-content .sub-menu li a,
.mobile-drawer-content .mega-col ul li a {
  display: block;
  width: 100%;

  padding: 8px 0;

  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  text-align: left;
}

.mobile-drawer-content .sub-menu li a:hover,
.mobile-drawer-content .mega-col ul li a:hover {
  color: var(--rutao-accent);
}

html.mobile-menu-open,
body.mobile-menu-open {
  overflow: hidden;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--rutao-dark);
  color: rgba(255, 255, 255, 0.7);

  font-size: 14px;
}

.footer-inner {
  max-width: var(--rutao-container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-top {
  padding: 64px 0 40px;
}

.footer-top .footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.footer-col h3 {
  margin-bottom: 14px;

  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.footer-col p {
  line-height: 1.7;
  font-size: 13px;
}

.footer-col a {
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--rutao-accent);
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.footer-social a:hover {
  color: var(--rutao-accent);
}

.footer-bottom {
  padding: 24px 0;

  border-top: 1px solid rgba(255, 255, 255, 0.08);

  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: var(--rutao-accent);
}

/* ========== Floating Buttons ========== */
.static-whatsapp-button {
  position: fixed;
  right: 18px;
  bottom: 96px;

  width: 54px;
  height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #25d366;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);

  z-index: 1200;

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.static-whatsapp-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.static-whatsapp-button img {
  width: 30px;
  height: 30px;
  display: block;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 34px;
  left: auto;

  width: 46px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;

  background: var(--rutao-dark);
  color: #fff;

  font-size: 22px;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;

  z-index: 1200;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--rutao-accent);
  color: var(--rutao-black);
}

/* ========== Tablet / Mobile ========== */
@media (max-width: 1024px) {
  .header-inner {
    height: 64px;
    padding: 0 24px;
    gap: 14px;
  }

  .header-logo {
    z-index: 1002;
  }

  .header-logo img {
    height: 38px;
  }

  .header-nav {
    display: none;
  }

  .header-actions {
    margin-left: auto;
    gap: 12px;
    z-index: 1002;
  }

  .btn-menu {
    display: flex;
  }

  .btn-quote {
    padding: 8px 16px;
    font-size: 13px;
  }

  .header-search-input {
    top: calc(100% + 14px);
    right: 0;

    width: 260px;
    height: 38px;

    padding: 8px 12px;
    border-bottom-color: rgba(255, 255, 255, 0.8);

    background: rgba(36, 45, 45, 0.96);
    color: #fff;

    opacity: 0;
    transform: translateY(-8px);
    transform-origin: center;

    pointer-events: none;

    transition: opacity 0.2s ease, transform 0.2s ease;

    z-index: 3000;
  }

  .header-search.is-open .header-search-input {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
  }

  .footer-top .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-top {
    padding: 40px 0 24px;
  }

  .footer-top .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .static-whatsapp-button {
    right: 16px;
    bottom: 82px;

    width: 50px;
    height: 50px;
  }

  .static-whatsapp-button img {
    width: 28px;
    height: 28px;
  }

  .back-to-top {
    right: 18px;
    bottom: 22px;

    width: 44px;
    height: 44px;

    font-size: 20px;
  }
}

@media (max-width: 600px) {
  .header-inner {
    height: 58px;
    padding: 0 16px;
    gap: 10px;
  }

  .header-logo img {
    height: 32px;
  }

  .btn-quote {
    padding: 7px 12px;
    font-size: 12px;
  }

  .header-search-input {
    width: 220px;
  }
}

@media (max-width: 430px) {
  .btn-quote {
    display: none;
  }

  .header-search-input {
    width: 210px;
  }
}