/* --- ГЛОБАЛЬНЫЕ СТИЛИ И ПЕРЕМЕННЫЕ --- */
:root {
    --primary-color: #005A5A; /* Глубокий бирюзовый */
    --secondary-color: #E0A01E; /* Золотой */
    --dark-color: #222222;
    --light-color: #f7f7f7;
    --text-color: #333;
    --white-color: #ffffff;
}

/* Базовый сброс стилей */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color);
}
h1, h2, h3 { line-height: 1.3; font-weight: 700; color: var(--dark-color); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 20px; text-align: center; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 15px; }
a { text-decoration: none; color: var(--primary-color); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- УТИЛИТЫ (Вспомогательные классы) --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; overflow-x: hidden; }
.cta-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    border-radius: 5px;
    font-weight: 700;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Add responsive properties */
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    white-space: normal;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.cta-button.large { 
    padding: 15px 30px; 
    font-size: 1.1rem; 
    /* Responsive padding for large buttons */
}
.cta-button.secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
}
.cta-button.secondary:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    transform: none;
    box-shadow: none;
}
.link-button {
    font-weight: 700;
    color: var(--primary-color);
    transition: letter-spacing 0.3s ease;
}
.link-button:hover { letter-spacing: 0.5px; }

/* --- БЛОК 0: ШАПКА (HEADER) --- */
.header {
    background: var(--white-color);
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.header .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 0; 
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 20px;
}
.header-content {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between logo and header text */
}
.logo { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: var(--primary-color); 
    display: flex; 
    align-items: center; 
    flex-shrink: 0; /* Prevent logo from shrinking */
}
.logo img { 
    max-height: 40px; 
    width: auto; 
    object-fit: contain; 
}
.header-text {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
}
.nav-desktop { 
    display: flex; 
    align-items: center; 
}
.nav-desktop ul { 
    display: flex; 
    align-items: center;
}
.nav-desktop li { 
    margin-left: 25px; 
}
.nav-desktop a { 
    font-weight: 500; 
    color: var(--text-color); 
    transition: color 0.3s ease; 
    white-space: nowrap; /* Prevent menu items from wrapping */
}
.nav-desktop a:hover { 
    color: var(--primary-color); 
}
.nav-desktop.active { 
    display: block; 
}
.mobile-nav-toggle { 
    display: none; 
    font-size: 1.8rem; 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: var(--dark-color); 
    margin-left: 15px; /* Add some space before the mobile toggle */
    flex-shrink: 0; /* Prevent toggle from shrinking */
}

/* Ensure header is consistent across all pages */
body .header,
body.tour-constructor-page .header,
body.page-template-default .header,
body.page-template-page-main .header,
body.page-template-page-contact .header,
body.page-template-page-departure-city .header,
body.page-template-page-all-tours .header,
body.single-tour .header {
    background: var(--white-color);
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

body .header .container,
body.tour-constructor-page .header .container,
body.page-template-default .header .container,
body.page-template-page-main .header .container,
body.page-template-page-contact .header .container,
body.page-template-page-departure-city .header .container,
body.page-template-page-all-tours .header .container,
body.single-tour .header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* CTA Button alignment */
.cta-button { 
    white-space: nowrap; /* Prevent button text from wrapping */
    flex-shrink: 0; /* Prevent button from shrinking */
}

/* More specific CTA button styles for different contexts */
.header .cta-button {
    margin-left: 25px;
    /* Prevent text wrapping in header */
    white-space: nowrap;
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white-color);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        padding: 10px 0;
    }
    
    .nav-desktop.active {
        display: block;
    }
    
    .nav-desktop ul {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-desktop li {
        margin: 10px 0;
    }
    
    /* Responsive CTA buttons for mobile */
    .cta-button {
        padding: 10px 20px;
        font-size: 0.95rem;
        width: auto;
        max-width: 100%;
    }
    
    .cta-button.large {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    /* Ensure all CTA buttons are properly centered on mobile */
    .cta-button,
    .quiz-cta .cta-button,
    .design-cta .cta-button {
        display: inline-block;
        width: auto;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
    
    /* Special handling for tour card buttons on mobile */
    .tour-card-content .cta-button {
        width: 100%;
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}

/* --- БЛОК 1: ПЕРВЫЙ ЭКРАН (HERO) --- */
.hero {
    height: 90vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white-color);
    background: url('https://via.placeholder.com/1920x1080.png?text=Фон:+Видео+или+Фото+Египта') no-repeat center center/cover;
}
.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: no-repeat center center/cover;
    z-index: -1;
}
.hero-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.5); 
    z-index: 0;
}
.hero-content { 
    position: relative; 
    z-index: 1; 
}
.hero h1 { color: var(--white-color); margin-bottom: 15px; }
.hero p { font-size: 1.25rem; margin-bottom: 30px; font-weight: 400; max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- БЛОК 2: УТП (UVP) --- */
.uvp { background: var(--light-color); padding: 60px 0; }
.uvp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 30px; }
.uvp-item { text-align: center; padding: 20px; }
.uvp-item h3 { margin-bottom: 10px; color: var(--primary-color); }

/* Departure Cities Links in UVP */
.departure-cities-links { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd; }
.departure-cities-links p { margin: 0; font-size: 1rem; color: #666; }
.departure-cities-links .city-item { 
    display: inline-flex; 
    align-items: center; 
    font-size: 0.9rem; 
    color: #666; 
    background: #f5f5f5; 
    padding: 3px 10px; 
    border-radius: 15px; 
    margin: 0 5px;
}
.departure-cities-links .city-item a { 
    color: #666; 
    text-decoration: none; 
    margin-left: 5px;
}
.departure-cities-links .city-item a:hover { 
    color: var(--primary-color); 
    text-decoration: underline;
}
.departure-cities-links .city-item .location-icon { 
    margin-right: 5px; 
    width: 12px; 
    height: 12px; 
}

/* --- БЛОК 3: ТУРЫ (TOURS) --- */
.tours { padding: 60px 0; }
.tours-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 30px; }
.tour-card {
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative; /* Add positioning context */
}
.tour-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.tour-card img { width: 100%; height: 200px; object-fit: cover; }
.tour-card-content { 
    padding: 20px; 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.tour-tag {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--dark-color);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}
/* ИЗМЕНЕНО: Стиль для приватного тура */
.tour-tag.private {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* NEW: Position private tour tag on image (top left) */
.tour-card .tour-tag.private {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3; /* Increased z-index to ensure visibility */
    margin-bottom: 0;
}

/* NEW: Position tour duration on image (top right) */
.tour-card .tour-duration {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3; /* Increased z-index to ensure visibility */
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px; /* Slightly increased padding for better visibility */
    border-radius: 12px; /* Slightly larger border radius */
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap; /* Prevent text wrapping */
}

/* END NEW */

.tour-details { font-size: 0.9rem; color: #777; margin-bottom: 10px; }
.tour-price { font-size: 1.2rem; font-weight: 700; color: var(--primary-color); margin: 10px 0; min-height: 1.5em; }
.tour-card-content .cta-button { 
    width: 100%; 
    margin-top: auto; /* Push button to bottom */
    margin-bottom: 0; /* Remove default margin */
    margin-left: auto;
    margin-right: auto;
}

/* Tours CTA Button */
.tours-cta { text-align: center; margin-top: 40px; }

/* Departure Cities */
.departure-cities { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0; }
.city-item { 
    display: flex; 
    align-items: center; 
    font-size: 0.8rem; 
    color: #666; 
    background: #f5f5f5; 
    padding: 2px 8px; 
    border-radius: 10px; 
    flex-shrink: 0; /* Prevent items from shrinking */
}
.city-item .location-icon { margin-right: 3px; width: 12px; height: 12px; }

/* --- БЛОК 4: ОБ АВТОРЕ (AUTHOR) --- */
.author { padding: 60px 0; background: var(--light-color); }
.author-flex { display: flex; align-items: center; gap: 40px; }
.author-image { flex: 1; }
.author-image img { border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.author-bio { flex: 1.5; }
.author-bio h3 { font-weight: 500; color: var(--secondary-color); }
.author-bio h2 { text-align: left; margin-bottom: 20px; }

/* --- БЛОК 5: КВИЗ (QUIZ CTA) --- */
.quiz-cta { padding: 60px 0; background-color: var(--primary-color); color: var(--white-color); text-align: center; }
.quiz-cta h2 { color: var(--white-color); }
.quiz-cta p { font-size: 1.1rem; margin-bottom: 30px; max-width: 600px; margin-left: auto; margin-right: auto; }
.quiz-cta .cta-button { 
    background-color: var(--secondary-color); 
    color: var(--dark-color); 
    margin-left: 0; 
    margin-right: 0; 
}

/* --- БЛОК 6: ОТЗЫВЫ (REVIEWS) --- */
.reviews { padding: 60px 0; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; margin-top: 30px; }
.review-card { background: var(--light-color); border: 1px solid #eee; padding: 25px 25px 25px 60px; border-radius: 8px; position: relative; }
.review-card::before { content: '“'; font-size: 4rem; color: var(--primary-color); opacity: 0.2; position: absolute; top: 10px; left: 20px; }
.review-card p { font-size: 1.05rem; margin-bottom: 20px; position: relative; z-index: 1; }
.review-author { display: flex; align-items: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; }
.review-author-photo { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; margin-right: 15px; }
.review-author-name { font-weight: 500; color: #333; }

/* Review Rating Styles */
.review-rating {
    margin-bottom: 15px;
}

.review-rating .star {
    color: #ddd;
    font-size: 1.2rem;
    margin-right: 2px;
}

.review-rating .star.filled {
    color: #E0A01E;
}

/* --- БЛОК 7: ДИЗАЙН (DESIGN) --- */
.design { padding: 60px 0; background: var(--light-color); }
.design .section-subtitle { text-align: center; margin-bottom: 40px; color: #666; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 40px; }
.design-item { text-align: center; padding: 30px 20px; background: var(--white-color); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: transform 0.3s ease; }
.design-item:hover { transform: translateY(-5px); }
.design-icon { margin-bottom: 20px; }
.design-icon img { width: 80px; height: 80px; object-fit: contain; }
.design-icon i { 
    font-size: 80px; 
    color: var(--primary-color); 
    width: 80px; 
    height: 80px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
}
.design-item h3 { margin-bottom: 15px; color: var(--primary-color); }
.design-cta { text-align: center; }
.design-cta .cta-button { display: inline-block; }

/* --- БЛОК 8: РЕДАКТИРОВАНИЕ ТУРОВ (TOUR EDIT) --- */
.tour-edit { padding: 60px 0; }
.tour-edit .section-subtitle { text-align: center; margin-bottom: 40px; color: #666; }
.tour-edit-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 40px; }
.step { text-align: center; position: relative; }
.step-number { 
    width: 40px; height: 40px; 
    background: var(--primary-color); 
    color: var(--white-color); 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    margin: 0 auto 20px; 
    font-weight: 700; 
    font-size: 1.2rem; 
}
.step h3 { margin-bottom: 15px; }
.tour-edit-features { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 30px; 
    background: var(--light-color); 
    padding: 30px; 
    border-radius: 8px; 
}
.feature { text-align: center; }
.feature h4 { margin-bottom: 10px; color: var(--primary-color); }

/* --- БЛОК 9: ФУТЕР (FOOTER) --- */
.footer { background: var(--dark-color); color: #ccc; padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.footer-col .logo { color: var(--white-color); margin-bottom: 10px; display: inline-block; }
.footer-col h4 { color: var(--white-color); margin-bottom: 15px; font-size: 1.1rem; }
.footer-col p { font-size: 0.9rem; margin-bottom: 10px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a { color: #ccc; transition: color 0.3s ease; }
.footer-col a:hover { color: var(--secondary-color); }
.footer-bottom { border-top: 1px solid #444; margin-top: 40px; padding: 20px 0; font-size: 0.85rem; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; }
.footer-bottom a { color: #aaa; }

/* --- АДАПТИВНОСТЬ (MOBILE-FIRST) --- */
@media (max-width: 992px) {
    .uvp-grid { grid-template-columns: 1fr; }
    .author-flex { flex-direction: column; text-align: center; }
    .author-bio h2 { text-align: center; }
}
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    .header .cta-button { display: none; }
    .mobile-nav-toggle { display: block; }
    .hero { height: 70vh; }
    .hero p { font-size: 1.1rem; }
    .tours-grid, .reviews-grid, .footer-grid, .design-grid, .tour-edit-steps, .tour-edit-features { grid-template-columns: 1fr; }
    .footer-grid { text-align: center; }
    .footer-bottom .container { flex-direction: column; gap: 10px; }
    
    /* Center CTA buttons on mobile */
    .quiz-cta .cta-button {
        margin-left: auto;
        margin-right: auto;
        display: inline-block;
        text-align: center;
    }
    
    /* Ensure quiz-cta container properly centers content */
    .quiz-cta .container {
        text-align: center;
    }
}