/*
Theme Name: Samokat Promo Theme
Author: Vashe Imya
Version: 1.5
Description: Тема для отображения страницы с промокодами Самокат.
*/

/* ОСНОВНЫЕ СТИЛИ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
    height: 100%;
    scroll-behavior: smooth;
}
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    line-height: 1.6; 
    color: #333; 
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.site-main {
    flex-grow: 1;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- ШАПКА САЙТА --- */
.site-header { 
    padding: 20px 0 0;
    position: relative;
    z-index: 100;
}
.site-header-content { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background-color: #fe3360;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.site-logo { flex-shrink: 0; }
.site-logo img { height: 40px; width: auto; display: block; }
.header-controls { display: flex; align-items: center; gap: 15px; }

/* --- Поиск в шапке --- */
.promo-search-container {
    background: #fff;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}
.promo-search-container.is-active {
    padding: 20px 0;
    max-height: 100px;
}
#promo-search {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
}
#promo-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.header-search-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    line-height: 1;
    display: none; /* Скрыт по-умолчанию, виден на мобильных */
}

/* --- НАВИГАЦИОННОЕ МЕНЮ --- */
.main-navigation .nav-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 30px; }
.main-navigation .nav-menu li { margin: 0; padding: 0; }
.main-navigation .nav-menu a { color: white; text-decoration: none; font-weight: 500; font-size: 1rem; padding: 5px 0; position: relative; transition: color 0.2s ease; white-space: nowrap; }
.main-navigation .nav-menu a:hover { color: rgba(255, 255, 255, 0.8); }
.main-navigation .nav-menu a::after { content: ''; position: absolute; width: 100%; height: 2px; bottom: 0; left: 0; background-color: white; transform: scaleX(0); transform-origin: bottom right; transition: transform 0.25s ease-out; }
.main-navigation .nav-menu a:hover::after { transform: scaleX(1); transform-origin: bottom left; }

/* --- ИКОНКА-БУРГЕР --- */
.menu-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 10px; }
.hamburger-icon, .hamburger-icon::before, .hamburger-icon::after {
    content: '';
    display: block;
    background-color: white;
    height: 3px;
    width: 25px;
    border-radius: 3px;
    position: absolute;
    transition: all 0.3s ease-in-out;
    left: 0;
}
.hamburger-icon {
    position: relative;
}
.hamburger-icon::before {
    transform: translateY(-8px);
}
.hamburger-icon::after {
    transform: translateY(8px);
}
.menu-toggle.is-active .hamburger-icon { background-color: transparent; }
.menu-toggle.is-active .hamburger-icon::before { transform: translateY(0) rotate(45deg); }
.menu-toggle.is-active .hamburger-icon::after { transform: translateY(0) rotate(-45deg); }


/* --- ЗАГОЛОВОК СТРАНИЦЫ (БЕЛЫЙ БЛОК) --- */
.page-hero { background: white; color: #333; padding: 40px; text-align: center; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin: 30px 0; }
.page-hero h1 { font-size: 2.5rem; margin-bottom: 15px; font-weight: 700; color: #2c3e50; }
.page-hero p { font-size: 1.2rem; opacity: 0.9; color: #333; }
.updated-badge { background: #28a745; color: white; padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; margin: 15px 0; display: inline-block; }

/* --- ФИЛЬТРЫ И ПОИСК --- */
.promo-filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding: 20px !important; margin-bottom: 0 !important; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-btn { background: #f1f3f5; border: 1px solid #dee2e6; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; font-weight: 500; transition: all 0.2s ease; white-space: nowrap; }
.filter-btn:hover { background: #e9ecef; border-color: #ced4da; }
.filter-btn.active { background: #667eea; color: white; border-color: #667eea; }

/* ПРОМОКОДЫ */
.promo-grid { 
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px; 
    margin: 40px 0; 
}
.promo-card { background: white; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-left: 4px solid #667eea; transition: transform 0.3s ease; }
.promo-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.promo-title { font-size: 1.3rem; font-weight: 600; color: #2c3e50; margin-bottom: 10px; }
.promo-discount { font-size: 2rem; font-weight: 700; color: #e74c3c; margin-bottom: 10px; }
.promo-condition { color: #666; margin-bottom: 15px; }
.promo-code { background: #f8f9fa; border: 2px dashed #667eea; padding: 12px; border-radius: 8px; text-align: center; margin-bottom: 15px; }
.code-text { font-family: 'Courier New', monospace; font-size: 1.2rem; font-weight: bold; color: #667eea; letter-spacing: 2px; }
.copy-btn { background: #667eea; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; width: 100%; margin-top: 10px; font-size: 1rem; font-weight: 500; }
.copy-btn:hover { background: #5a67d8; transform: translateY(-2px); }
.copy-btn:active { transform: translateY(0); }
.expires { color: #e74c3c; font-size: 0.9rem; font-weight: 500; margin-top: 10px; }
.content-section { background: white; margin: 30px 0; padding: 40px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.section-title { font-size: 2rem; font-weight: 600; color: #2c3e50; margin-bottom: 25px; position: relative; }
.section-title::after { content: ''; position: absolute; bottom: -10px; left: 0; width: 60px; height: 3px; background: #667eea; }

/* --- БЛОК О СЕРВИСЕ --- */
.content-section p {
    margin-bottom: 1em;
}
.about-banner {
    margin-top: 30px;
}
.about-service-banner {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}
.advantages-list {
    list-style: none;
    padding-left: 0;
    margin-top: 15px;
}
.advantages-list li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
}
.advantages-list li::before {
    content: '✅';
    position: absolute;
    left: 0;
    top: 0;
}
.advantages-list li strong {
    color: #2c3e50;
}


/* --- ТАБЛИЦА С ПРОМОКОДАМИ --- */
.promo-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 0.95rem; }
.promo-table th, .promo-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #e9ecef; }
.promo-table thead th { background-color: #f8f9fa; font-weight: 600; color: #495057; }
.promo-table tbody tr:hover { background-color: #f1f3f5; }
.promo-table td strong { font-family: 'Courier New', monospace; color: #667eea; }
.promo-table .status-ok { color: #28a745; font-weight: 500; }

/* --- БЛОК С ШАГАМИ --- */
.steps-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; counter-reset: steps-counter; }
.step { background-color: #f8f9fa; padding: 20px; border-radius: 8px; border-left: 3px solid #667eea; position: relative; padding-top: 30px; }
.step::before { counter-increment: steps-counter; content: counter(steps-counter); position: absolute; top: 20px; left: -15px; width: 30px; height: 30px; background-color: #667eea; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.step strong { font-size: 1.1rem; color: #2c3e50; display: block; margin-bottom: 8px; }

/* --- БЛОК FAQ --- */
.faq-item { border-bottom: 1px solid #e9ecef; margin-bottom: 15px; padding-bottom: 15px; }
.faq-item:last-child { border-bottom: none; margin-bottom: 0; }
.faq-question { font-size: 1.1rem; font-weight: 500; cursor: pointer; position: relative; padding-right: 30px; transition: color 0.2s ease; }
.faq-question:hover { color: #667eea; }
.faq-question::after { content: '+'; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 300; color: #667eea; transition: transform 0.2s ease; }
.faq-question.active::after { content: '−'; }
.faq-answer { display: none; margin-top: 15px; padding-left: 10px; color: #555; line-height: 1.7; }

/* --- АРХИВНЫЕ ПРОМОКОДЫ --- */
.promo-table-archived tbody {
    opacity: 0.7;
}
.promo-table-archived td strong {
    text-decoration: line-through;
    color: #868e96;
}
.promo-row-archived:hover {
    background-color: transparent !important;
}

/* --- БЛОК КОНТАКТЫ --- */
.contact-info {
    text-align: left;
    font-size: 1.1rem;
    margin-top: 10px;
}
.contact-info a {
    color: #fe3360;
    font-weight: 500;
    text-decoration: none;
}
.contact-info a:hover {
    text-decoration: underline;
}

/* --- ПОДВАЛ САЙТА --- */
.site-footer { padding: 0 0 20px; margin-top: 30px; }
.site-footer-content { background-color: #fe3360; color: white; text-align: center; padding: 20px 30px; border-radius: 12px; font-size: 0.9rem; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.site-footer-content a { color: white; text-decoration: underline; }

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 768px) {
    .container { padding: 0 10px; }
    .site-header { padding: 10px 0 0; }
    .site-header-content { padding: 10px 15px; }
    .main-navigation { display: none; position: absolute; top: calc(100% + 10px); left: 0; width: 100%; background-color: #fe3360; box-shadow: 0 4px 8px rgba(0,0,0,0.1); border-radius: 0 0 12px 12px; }
    .main-navigation.is-active { display: block; }
    .main-navigation .nav-menu { flex-direction: column; align-items: center; padding: 20px 0; gap: 0; }
    .main-navigation .nav-menu li { width: 100%; }
    .main-navigation .nav-menu a { display: block; padding: 15px 20px; text-align: center; width: 100%; }
    .main-navigation .nav-menu a::after { display: none; }
    
    .menu-toggle, .header-search-toggle { display: block; }
    
    .promo-filters { flex-direction: column; align-items: stretch; justify-content: center; }
    .page-hero h1 { font-size: 2rem; }
    .promo-grid { grid-template-columns: 1fr; }
    .content-section { padding: 20px; margin: 20px 10px; }
    .promo-card { padding: 20px; }
    .section-title { font-size: 1.5rem; }

    /* Адаптивная таблица */
    .promo-table, .promo-table thead, .promo-table tbody, .promo-table th, .promo-table td, .promo-table tr { display: block; }
    .promo-table thead tr { position: absolute; top: -9999px; left: -9999px; }
    .promo-table tr { border: 1px solid #dee2e6; border-radius: 8px; margin-bottom: 15px; background: #fff; }
    .promo-table td { border: none; border-bottom: 1px solid #e9ecef; position: relative; padding-left: 50%; white-space: normal; text-align: right; }
    .promo-table td:last-child { border-bottom: 0; }
    .promo-table td::before { content: attr(data-label); position: absolute; left: 15px; width: calc(50% - 30px); padding-right: 10px; white-space: nowrap; text-align: left; font-weight: 600; color: #495057; }
}
@media (max-width: 480px) {
    .page-hero h1 { font-size: 1.8rem; }
    .promo-discount { font-size: 1.5rem; }
    .code-text { font-size: 1rem; letter-spacing: 1px; }
}

/* --- КНОПКА "НАВЕРХ" --- */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #fe3360;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 1000;
}
#back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- СТРАНИЦА 404 --- */
.error-404-section {
    text-align: center;
    padding: 60px 20px;
}
.error-404-section .page-title {
    font-size: 3rem;
    margin-bottom: 20px;
}
.error-404-section p {
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
}
.button-404 {
    display: inline-block;
    background-color: #fe3360;
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}
.button-404:hover {
    background-color: #d62c50;
}