/* =========================================================
   Rutao Static Site - Common CSS
   Header / Navigation / Search / Mobile Drawer / Footer / Floating Buttons
   ========================================================= */

/* ========== 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,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* ========== Header ========== */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  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 .has-drop > a {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .header-nav .has-drop > a::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
  }

  .header-nav .sub-menu,
  .header-nav .mega-menu {
    position: absolute;
    top: 100%;
    background: #fff;
    color: var(--rutao-text);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  }

  .header-nav .sub-menu {
    left: 0;
    min-width: 180px;
    padding: 8px 0;
    border-radius: 6px;
    transform: translateY(8px);
  }

  .header-nav .mega-menu {
    left: 50%;
    min-width: 700px;
    padding: 28px 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    border-radius: 8px;
    transform: translateX(-50%) translateY(8px);
  }

  .header-nav .has-drop:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .header-nav .has-drop:hover > .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  .header-nav .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;
  }

  .header-nav .sub-menu li a:hover {
    background: #f5f5f5;
    color: var(--rutao-orange);
  }

  .header-nav .mega-col h3 {
    margin-bottom: 8px;
    color: var(--rutao-black);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .header-nav .mega-col h3 a:hover {
    color: var(--rutao-orange);
  }

  .header-nav .mega-col ul li a {
    display: block;
    padding: 4px 0;
    color: var(--rutao-muted);
    font-size: 13px;
    transition: color 0.2s ease;
  }

  .header-nav .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 {
  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;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.header-search-input {
  position: absolute;
  top: 50%;
  right: 38px;
  width: 170px;
  height: 28px;
  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;
  opacity: 0;
  transform: translateY(-50%) scaleX(0);
  transform-origin: right center;
  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;
  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 / Drawer ========== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1998;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1999;
  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;
}

.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,
.mobile-drawer-content .nav-menu,
.mobile-drawer-content .nav-menu > li {
  width: 100%;
}

.mobile-drawer-content .nav-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  font-size: 15px;
  font-weight: 600;
}

.mobile-drawer-content .nav-menu > li {
  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: 18px;
  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 {
  width: 100%;
  margin: 0 0 16px;
  padding: 14px 18px;
  display: none;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 8px;
  text-align: center;
}

.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,
.mobile-drawer-content .mega-col ul {
  width: 100%;
  text-align: center;
}

.mobile-drawer-content .mega-col h3 {
  margin: 10px 0 6px;
  color: var(--rutao-accent);
  font-size: 13px;
  text-align: center;
}

.mobile-drawer-content .mega-col h3 a {
  display: inline-block;
  color: var(--rutao-accent);
}

.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: center;
}

.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: #ffffff;
  font-size: 14px;
}

.footer-inner {
  max-width: var(--rutao-container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-top {
  padding: 30px 0 34px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 1.05fr 1fr;
  gap: 64px;
  align-items: start;
}

.footer-col h3 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.footer-col p {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.58;
  font-weight: 500;
}

.footer-col a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover,
.footer-bottom a:hover {
  color: var(--rutao-accent);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 7px;
}

.footer-social a {
  width: 36px;
  height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 3px;
  font-size: 19px;
  line-height: 1;
  font-weight: 800;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.footer-social a:hover {
  transform: translateY(-2px);
  opacity: 0.88;
}

.footer-social .social-facebook {
  background: #3b5998;
}

.footer-social .social-twitter {
  background: #1da1f2;
}

.footer-social .social-instagram {
  background: #477894;
  font-size: 21px;
}

.footer-social .social-youtube {
  background: #ff2d2d;
  font-size: 16px;
}

.footer-bottom {
  padding: 12px 0 42px;
}

.footer-bottom p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.5;
}

.footer-bottom a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ========== Floating Buttons ========== */
.static-whatsapp-button,
.back-to-top {
  position: fixed;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.static-whatsapp-button {
  right: 18px;
  bottom: 96px;
  width: 54px;
  height: 54px;
  background: #25d366;
  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,
.static-whatsapp-button svg {
  width: 30px;
  height: 30px;
}

.back-to-top {
  right: 22px;
  bottom: 34px;
  width: 46px;
  height: 46px;
  border: 0;
  background: var(--rutao-dark);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  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;
}

.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 ========== */
@media (max-width: 1024px) {
  .header-inner {
    height: 64px;
    padding: 0 24px;
    gap: 14px;
  }

  .header-logo,
  .header-actions {
    z-index: 1002;
  }

  .header-nav {
    display: none;
  }

  .header-actions {
    margin-left: auto;
    gap: 12px;
  }

  .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 {
    padding: 42px 0 28px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 48px;
  }

  .footer-bottom {
    padding: 10px 0 34px;
  }
}

/* ========== Mobile ========== */
@media (max-width: 768px) {
  .footer-top {
    padding: 40px 0 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-col,
  .footer-bottom,
  .footer-bottom p {
    text-align: left;
  }

  .footer-col h3 {
    margin-bottom: 10px;
    font-size: 15px;
  }

  .footer-col p {
    font-size: 14px;
    line-height: 1.62;
  }

  .footer-social {
    justify-content: flex-start;
  }

  .footer-bottom {
    padding: 8px 0 32px;
  }

  .footer-bottom p {
    font-size: 12px;
  }

  .static-whatsapp-button {
    right: 16px;
    bottom: 82px;
    width: 50px;
    height: 50px;
  }

  .static-whatsapp-button img,
  .static-whatsapp-button svg {
    width: 28px;
    height: 28px;
  }

  .back-to-top {
    right: 18px;
    bottom: 22px;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }
}

/* ========== Small Mobile ========== */
@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) {
  .footer-inner {
    padding: 0 1rem;
  }

  .footer-social a {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .footer-col p {
    font-size: 13px;
  }

  .btn-quote {
    display: none;
  }

  .header-search-input {
    width: 210px;
  }
}