/* ============================================
   rating-okon58.ru - Рейтинг оконных компаний Пензы
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #1a5fb4;
    --color-primary-dark: #154a8c;
    --color-primary-light: #e8f0fe;
    --color-accent: #f5a623;
    --color-accent-dark: #e09400;
    --color-success: #2e7d32;
    --color-bg: #f5f7fa;
    --color-card: #ffffff;
    --color-text: #1a1a2e;
    --color-text-secondary: #5a5a6e;
    --color-border: #e0e4e8;
    --color-star-empty: #d0d5dd;
    --color-star-filled: #f5a623;
    --color-featured-bg: linear-gradient(135deg, #1a5fb4 0%, #2d7dd2 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-featured: 0 12px 48px rgba(26, 95, 180, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.header {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}

.logo-text span {
    color: var(--color-primary);
}

.header-subtitle {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 400;
}

.header-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-primary-light);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.header-phone:hover {
    background: var(--color-primary);
    color: #fff;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, #1a5fb4 0%, #2d7dd2 50%, #4a9eff 100%);
    color: #fff;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 600px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: 36px;
    font-weight: 800;
    display: block;
}

.hero-stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.hero-arrow {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    font-size: 32px;
    opacity: 0.7;
    cursor: pointer;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* --- Filter Section --- */
.filter-section {
    padding: 24px 0;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 32px;
}

.filter-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    border: 1px solid var(--color-border);
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* --- Rating Legend --- */
.rating-legend {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.rating-legend-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.rating-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* --- Stars --- */
.stars {
    display: inline-flex;
    gap: 2px;
}

.star {
    font-size: 20px;
    color: var(--color-star-empty);
    line-height: 1;
}

.star.filled {
    color: var(--color-star-filled);
}

.star.half {
    background: linear-gradient(90deg, var(--color-star-filled) 50%, var(--color-star-empty) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stars-small .star {
    font-size: 14px;
}

.stars-large .star {
    font-size: 28px;
}

.rating-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-accent-dark);
    margin-left: 8px;
}

/* --- Company Cards --- */
.companies-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 60px;
}

/* Card Images */
.featured-image {
    height: 280px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.featured-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(26, 95, 180, 0.3) 0%, rgba(26, 95, 180, 0.1) 40%, rgba(255,255,255,0) 100%);
}

.card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 50%, rgba(255,255,255,0) 100%);
}

/* Featured Card (Экосоюз) */
.company-card-featured {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-featured);
    overflow: hidden;
    position: relative;
    border: 2px solid var(--color-primary);
}

.company-card-featured::before {
    content: '★ ЛИДЕР РЕЙТИНГА';
    position: absolute;
    top: 0;
    right: 24px;
    background: var(--color-primary);
    color: #fff;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 2;
}

.company-card-featured .card-inner {
    padding: 40px;
    min-height: 320px;
}

/* Regular Card */
.company-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.company-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-inner {
    padding: 28px;
}

/* Card Header */
.card-header {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.company-position {
    width: 48px;
    height: 48px;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--color-primary);
    flex-shrink: 0;
}

.company-card-featured .company-position {
    width: 56px;
    height: 56px;
    font-size: 26px;
    background: var(--color-primary);
    color: #fff;
}

.company-main {
    flex: 1;
    min-width: 0;
}

.company-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}

.company-card-featured .company-name {
    font-size: 28px;
    color: var(--color-primary);
}

.company-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.company-reviews {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.company-year {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-success);
    background: rgba(46, 125, 50, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Card Body */
.card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.company-card-featured .card-body {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 16px;
}

.company-description {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.company-card-featured .company-description {
    font-size: 16px;
}

/* Info Block */
.company-info-block h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--color-text);
}

.info-item i {
    color: var(--color-primary);
    font-size: 14px;
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.info-item span {
    word-break: break-word;
}

/* Advantages */
.advantages-list {
    list-style: none;
}

.advantages-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--color-text);
}

.advantages-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: 700;
}

.company-card-featured .advantages-list li {
    font-size: 15px;
    margin-bottom: 8px;
}

/* Card Footer */
.card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.company-card-featured .card-footer {
    margin-top: 28px;
    padding-top: 24px;
}

.company-specialties {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-style: italic;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary-light);
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--color-bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.modal-header {
    padding: 32px 32px 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-body {
    padding: 24px 32px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.modal-section p {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* Reviews in Modal */
.review-item {
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.review-author {
    font-weight: 600;
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.review-text {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.no-reviews {
    text-align: center;
    padding: 24px;
    color: var(--color-text-secondary);
    font-style: italic;
}

/* --- Footer --- */
.footer {
    background: var(--color-text);
    color: #a0a0b0;
    padding: 40px 0;
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}

.footer-block h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-block p,
.footer-block a {
    font-size: 14px;
    color: #a0a0b0;
    text-decoration: none;
    line-height: 1.8;
}

.footer-block a:hover {
    color: #fff;
}

.footer-bottom {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #33334d;
    text-align: center;
    font-size: 13px;
}

.seo-text {
    margin-top: 32px;
    padding: 32px;
    background: var(--color-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.seo-text h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--color-text);
}

.seo-text p {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.seo-text h3 {
    font-size: 16px;
    margin: 20px 0 12px;
    color: var(--color-text);
}

.seo-text ul {
    margin-left: 20px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

/* --- Scroll to top --- */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    z-index: 99;
}

.scroll-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

.scroll-top.visible {
    display: flex;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 15px;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .hero-stat-number {
        font-size: 28px;
    }
    
    .card-body {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .company-card-featured .card-inner,
    .card-inner {
        padding: 24px;
    }
    
    .company-card-featured .card-inner {
        min-height: auto;
    }
    
    .featured-image {
        height: 200px;
    }
    
    .card-image {
        height: 140px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .filter-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .company-name {
        font-size: 18px;
    }
    
    .company-card-featured .company-name {
        font-size: 22px;
    }
    
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-phone {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0 60px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .company-card-featured .card-inner,
    .card-inner {
        padding: 16px;
    }
    
    .card-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}
