/*
Theme Name: BestWay Theme
Description: Унікальна тема для агенції нерухомості
Author: BestWay
Version: 1.0
*/

:root {
  --brand-red: #C32026;
  --brand-red-hover: #a01a1f;
  --text-dark: #222222;
  --text-grey: #666666;
  --bg-light: #F9F9F9;
  --font-main: 'Inter', sans-serif;
}

/* Глобальний фікс: запобігає розширенню блоків через padding та прибирає горизонтальний скрол */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  color: var(--text-dark);
  background-color: white;
}

/* --- ТИПОГРАФІКА ТА КНОПКИ --- */
.btn-red { display: inline-block; padding: 15px 35px; background: var(--brand-red); color: white; text-decoration: none; font-weight: 600; font-size: 0.9rem; transition: 0.3s; border: none; cursor: pointer; text-transform: uppercase; }
.btn-red:hover { background: var(--brand-red-hover); }
.btn-outline { display: inline-block; padding: 12px 30px; border: 2px solid white; color: white; text-decoration: none; font-weight: 600; text-transform: uppercase; transition: 0.3s; }
.btn-outline:hover { background: white; color: var(--brand-red); }
.section-subtitle { display: flex; align-items: center; color: var(--text-dark); font-size: 1.5rem; margin-bottom: 20px; font-weight: 600; }
.section-subtitle::before { content: ''; display: inline-block; width: 40px; height: 2px; background: var(--brand-red); margin-right: 15px; }

/* --- ШАПКА (HEADER) ДЕСКТОП --- */
.site-header { position: absolute; top: 40px; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 5%; z-index: 1000; }
.site-header.solid, .header-static { position: relative; top: 0; background: var(--brand-red); padding: 15px 5%; margin-bottom: 0; }
.site-logo { color: #ffffff; font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; }
.site-logo, .site-logo a { text-transform: none !important; color: #fff; text-decoration: none; }
.header-bar { display: flex; background-color: #ffffff; box-shadow: 0 15px 35px rgba(0,0,0,0.1); height: 60px; }
.main-nav { display: flex; align-items: center; padding: 0 10px; }
.main-nav a { text-decoration: none; color: #777777; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 0 20px; height: 100%; display: flex; align-items: center; position: relative; transition: 0.3s; }
.main-nav a:hover, .main-nav a.active { color: var(--brand-red); }
.main-nav a.active::after { content: ''; position: absolute; bottom: 8px; left: 20px; right: 20px; height: 2px; background-color: var(--brand-red); }
.header-contact { background-color: var(--brand-red); color: #ffffff; display: flex; align-items: center; padding: 0 30px; font-weight: 700; font-size: 1.1rem; }

/* --- ГОЛОВНИЙ ЕКРАН (HERO) ДЕСКТОП --- */
.hero-wrap {
  position: relative;
  height: 90vh;
  min-height: 600px;
  background: url('asets/ph3.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-red-slant {
  background: rgba(195, 32, 38, 0.95);
  width: 55%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5%;
  clip-path: polygon(0 0, 100% 0, 75% 100%, 0% 100%); 
  color: white;
}
.hero-red-slant h1 { color: white; font-size: 3.5rem; line-height: 1.1; margin-bottom: 20px; }
.hero-red-slant p { color: rgba(255,255,255,0.9); font-size: 1.2rem; margin-bottom: 30px; max-width: 80%; }

/* --- СТОРІНКИ --- */
.page-wrap { padding: 40px 10%; background: white; min-height: 50vh; }
.page-title { font-size: 2.5rem; margin-bottom: 30px; color: var(--text-dark); border-left: 6px solid var(--brand-red); padding-left: 15px; }

/* --- БЛОК ПРО НАС --- */
.about-wrap { display: flex; flex-wrap: wrap; align-items: center; padding: 100px 10%; background: white; gap: 50px; }
.about-text { flex: 1; min-width: 300px; }
.about-text p { color: var(--text-grey); line-height: 1.6; margin-bottom: 30px; }
.about-visual { flex: 1; min-width: 300px; position: relative; padding-bottom: 30px; padding-right: 30px; }
.about-red-square { position: absolute; right: 0; bottom: 0; width: 80%; height: 90%; background: var(--brand-red); z-index: 1; }
.about-visual img { width: 90%; position: relative; z-index: 2; box-shadow: -10px 10px 30px rgba(0,0,0,0.2); display: block; }

/* --- КАРТКА ОБ'ЄКТА --- */
.bestway-container { max-width: 1200px; margin: 0 auto; display: flex; gap: 20px; align-items: flex-start; }
.bestway-left { flex: 1; min-width: 0; }
.bestway-right { flex: 0 0 350px; position: sticky; top: 20px; }
.bw-card { background: #fff; border-radius: 8px; padding: 25px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #eaeaea; }
.bw-carousel-wrap { position: relative; border-radius: 8px; overflow: hidden; margin-bottom: 25px; }
.bw-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; -ms-overflow-style: none; scrollbar-width: none; }
.bw-carousel::-webkit-scrollbar { display: none; }
.bw-carousel img { flex-shrink: 0; width: 100%; height: 500px; object-fit: cover; scroll-snap-align: center; }
.bw-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.9); color: var(--brand-red); border: none; border-radius: 50%; width: 50px; height: 50px; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: 0.2s; z-index: 10; }
.bw-btn:hover { background: var(--brand-red); color: #fff; }
.bw-prev { left: 15px; }
.bw-next { right: 15px; }
.bw-features { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.bw-feature-pill { border: 1px solid #d8dcd8; border-radius: 4px; padding: 8px 15px; font-size: 14px; color: var(--text-dark); background: var(--bg-light); }
.bw-title { font-size: 24px; font-weight: 700; color: var(--text-dark); margin: 0 0 15px 0; line-height: 1.3; }
.bw-price { font-size: 32px; font-weight: 700; color: var(--brand-red); margin-bottom: 25px; }
.bw-contact-btn { display: block; width: 100%; background: var(--brand-red); color: #fff; text-align: center; padding: 15px; border-radius: 6px; text-decoration: none; font-size: 16px; font-weight: bold; transition: 0.3s; }
.bw-contact-btn:hover { background: var(--brand-red-hover); color: #fff; }
.bw-desc { font-size: 16px; line-height: 1.6; color: var(--text-grey); }

/* --- ПІДВАЛ (FOOTER) --- */
.site-footer { background: white; padding: 60px 10% 20px; border-top: 1px solid #EAEAEA; font-size: 0.9rem; margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; margin-bottom: 40px; }
.footer-brand { font-size: 1.5rem; font-weight: 700; color: var(--brand-red); margin-bottom: 15px; }
.footer-desc { color: var(--text-grey); line-height: 1.6; max-width: 300px; }
.footer-col h4 { color: var(--text-dark); font-size: 1.1rem; margin: 0 0 20px 0; position: relative; padding-bottom: 10px; }
.footer-col h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 30px; height: 2px; background: var(--brand-red); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul a { text-decoration: none; color: var(--text-grey); transition: 0.3s; }
.footer-col ul a:hover { color: var(--brand-red); padding-left: 5px; }
.footer-col p { color: var(--text-grey); margin: 0 0 10px 0; display: flex; gap: 10px; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid #EAEAEA; color: #999; font-size: 0.8rem; }


/* =========================================
   АДАПТИВНІСТЬ ДЛЯ МОБІЛЬНИХ ТА ПЛАНШЕТІВ (ДО 900px)
   ========================================= */
@media (max-width: 900px) {
  /* 1. Глобальні виправлення */
  .page-wrap { padding: 30px 5%; }
  .bestway-container { flex-direction: column; } 
  .bestway-right { width: 100%; flex: auto; position: static; } 
  .bw-carousel img { height: 300px; }
  
  /* Фікс зсуву каталогу вправо */
  .catalog-wrap { padding: 20px 5% !important; flex-direction: column !important; }
  .catalog-sidebar { width: 100% !important; flex: auto !important; position: static !important; }

  /* 2. Шапка: Виправлення кривини та відступів */
  .site-header, .site-header.solid, .header-static, .header-absolute {
    position: relative !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    width: 100% !important;
    top: 0 !important;
  }
  .site-logo {
    width: 100% !important;
    text-align: center !important;
    padding: 15px 0 !important;
    background: var(--brand-red) !important;
  }
  .header-bar {
    width: 100% !important;
    flex-direction: column !important;
    height: auto !important;
  }
  .main-nav {
    flex-wrap: wrap !important;
    justify-content: center !important;
    padding: 15px 5% !important;
    gap: 10px !important;
  }
  .main-nav a { padding: 5px 10px !important; font-size: 0.85rem !important; }
  .main-nav a.active::after { display: none !important; }
  
  .header-contact {
    width: 100% !important;
    justify-content: center !important;
    padding: 15px !important;
    margin: 0 !important;
    background: var(--brand-red) !important;
  }

  /* 3. Головний екран: Трапеція знизу */
  .hero-wrap {
    height: auto !important;
    min-height: 60vh !important;
    align-items: flex-start !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    /* Залишаємо білий фон замість картинки */
    background-image: none !important; 
    background-color: #ffffff !important; 
  }
  
  .hero-red-slant {
    position: relative !important;
    width: 100% !important; /* Розтягуємо на всю ширину */
    height: auto !important;
    min-height: 60vh !important;
    padding: 40px 5% 120px 5% !important;
    
    /* ПОВЕРТАЄМО КУТ ЗНИЗУ */
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%) !important;
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%) !important;
  }

  /* 4. Блок Про нас */
  .about-wrap { flex-direction: column; padding: 50px 5%; }
  .about-wrap > div { width: 100%; min-height: auto; }
  
  /* 5. Підвал */
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}