/*
Theme Name: BrokerTheme
Theme URI: https://enothost.com/
Author: EnotHost
Description: Минимальная тема WordPress с фоновым слайдером
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: brokertheme
*/

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}

/*Header*/
.main-header {
  width: 100%; 
  background: transparent;
  padding: 10px 0; 
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 10px 20px;
}

.header-content {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  max-height: 80px;
  max-width: 80px;
}

.main-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 20px;
}

.main-menu ul li a {
  text-decoration: none;
  color: black;
  font-weight: bold;
  padding: 10px 15px;
  display: block;
}

.main-menu ul li a:hover {
  color: #222;
  text-decoration: underline;
}

.header-button .btn {
  padding: 10px 20px;
  background: #0073aa;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger-menu .bar {
  width: 25px;
  height: 3px;
  background-color: #000;
  margin: 2px 0;
  transition: 0.3s;
}

/* Адаптив для планшетов (768px) */
@media (max-width: 768px) {
  .main-menu ul { gap: 15px; }
  .main-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(0,0,0,0.9); flex-direction: column; align-items: center; padding: 15px 0; z-index: 99; }
  .main-menu.active { display: flex !important; }
  .hamburger-menu { display: flex; }
  .main-menu ul li a { color: #fff; }
}

/* Адаптив для смартфонов (480px) */
@media (max-width: 480px) {
  .header-container { padding: 10px 15px; }
  .logo img { max-height: 60px; max-width: 60px; }
  .main-menu ul { flex-direction: column; gap: 15px; align-items: center; }
  .main-menu ul li a { padding: 8px 12px; font-size: 14px; text-align: center; color: #fff; }
  .hamburger-menu { display: flex; }
}

/* ------------------ Слайдер ------------------ */
.slider {
  position: relative;
  width: 100%;
  max-width: 100vw; /* чтобы не вылазил за экран */
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  padding: 0 5%;
  box-sizing: border-box;
  overflow: hidden; /* скрываем лишнее */
}

/* Фоновые слайды */
.bg-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: bgSlide 12s infinite;
  z-index: -1;
}

.bg1 { background: linear-gradient(135deg, #1e1e2f, #2a2a40); animation-delay: 0s; }
.bg2 { background: linear-gradient(135deg, #0d3b66, #1d84b5); animation-delay: 4s; }
.bg3 { background: linear-gradient(135deg, #4e148c, #ff6b6b); animation-delay: 8s; }

@keyframes bgSlide {
  0% { opacity: 0; }
  10% { opacity: 1; }
  30% { opacity: 1; }
  40% { opacity: 0; }
  100% { opacity: 0; }
}

/* Текст */
.text { flex: 1; max-width: 45%; z-index: 1; }
.text h1 { font-size: 3rem; margin-bottom: 1rem; }
.static-text { font-size: 1.2rem; margin-bottom: 1rem; opacity: 0.85; }
.dynamic-text { position: relative; height: 2rem; overflow: hidden; }
.dynamic-text span {
  position: absolute;
  width: 100%;
  animation: slide 12s infinite;
  opacity: 0;
}
.dynamic-text span:nth-child(1) { animation-delay: 0s; }
.dynamic-text span:nth-child(2) { animation-delay: 4s; }
.dynamic-text span:nth-child(3) { animation-delay: 8s; }

@keyframes slide {
  0% { transform: translateY(100%); opacity: 0; }
  10% { transform: translateY(0); opacity: 1; }
  30% { transform: translateY(0); opacity: 1; }
  40% { transform: translateY(-100%); opacity: 0; }
  100% { opacity: 0; }
}

/* Фото */
.slider .photo {
  flex: 1;
  max-width: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 2;
  min-height: 320px;
}

.slider .photo img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 80vh;
  max-height: 80vh;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0;
  animation: fadePhoto 12s linear infinite;
  animation-fill-mode: both;
}

.slider .photo img:nth-of-type(1) { animation-delay: 0s;  z-index: 1; }
.slider .photo img:nth-of-type(2) { animation-delay: -4s; z-index: 2; }
.slider .photo img:nth-of-type(3) { animation-delay: -8s; z-index: 3; }

@keyframes fadePhoto {
  0%   { opacity: 0;   transform: translate(-50%, -45%) scale(1.02); }
  6%   { opacity: 1;   transform: translate(-50%, -50%) scale(1); }
  30%  { opacity: 1;   transform: translate(-50%, -50%) scale(1); }
  36%  { opacity: 0;   transform: translate(-50%, -55%) scale(0.98); }
  100% { opacity: 0; }
}


/* Второй блок с анимацией */
.second-section {
  width: 100%;
  height: 60vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  color: #222;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.top-text-wrapper {
  position: relative;
  overflow: hidden;
  height: 40%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.top-text {
  font-size: 2.5rem;
  font-weight: bold;
  opacity: 0;
  position: relative;
  z-index: 1;
}

.reveal-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: #c99f87;
  transform: translateX(0%);
  opacity: 1;
  z-index: 2;
}

.second-section.animate .reveal-box {
  animation: moveAndFade 1s linear forwards;
}

.second-section.animate .top-text {
  animation: textFadeIn 1s ease forwards;
}

.bottom-row {
  display: flex;
  height: 50%;
  gap: 1rem;
}

.bottom-col {
  flex: 1;
  padding: 1.5rem;
  background: #f5f5f5;
  text-align: center;
  border-radius: 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes moveAndFade {
  0%   { transform: translateX(0%); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@keyframes textFadeIn {
  0%   { opacity: 0; transform: translateX(0); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Адаптив */
@media (max-width: 768px) {
  .bottom-row { flex-direction: column; height: auto; }
  .top-text { font-size: 1.8rem; }
}

@media (max-width: 900px) {
  .slider { flex-direction: column; text-align: center; padding: 2rem; }
  .text, .photo { max-width: 100%; }
  .text h1 { font-size: 2rem; }
  .static-text { font-size: 1rem; }
}

@media (max-width: 480px) {
  .slider { padding: 1rem; flex-direction: column; }
  .text h1 { font-size: 1.5rem; }
  .static-text { font-size: 0.9rem; }
  .dynamic-text { height: 1.5rem; }
  .photo img { max-height: 40vh; }
  .slider-controls { bottom: 10px; }
  .dots { gap: 8px; }
  .dot { width: 10px; height: 10px; }
  .timer-bar { height: 3px; }
}
