/* --- CSS Variables --- */
:root {
    --primary-color: rgb(0, 172, 172);
    --primary-hover: rgb(0, 134, 134);
    --header-bg: rgb(59, 59, 59);
    --accent-red: rgb(255, 87, 87);
    --text-dark: #2C3E50;
    --text-muted: #546E7A;
    --bg-light: #F7F9FC;
    --white: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --border-radius: 12px;
    --transition: 0.3s ease;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Inter', Arial, sans-serif;
}

/* --- Resets & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    color: var(--text-dark);
    background-image: url(../images/bckrnd.jpg);
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-color: #E9ECEF;
    line-height: 1.6;
    padding-top: 110px; 
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* --- Header & Navigation (Fixed, No Rounding, Static) --- */
#header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--header-bg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    border-radius: 0; /* Forced straight edges */
    z-index: 1000;
	transition: padding 0.3s ease;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%; 
}

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

.logo-text {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    display: none; 
}

#ico {
    width: 90px; /* Locked size, no transition */
	transition: width 0.3s ease;
	padding-top: 2px;
	padding-bottom: 2px;
}

/* Shrink the logo when the header has the scrolled class */
#header.scrolled #ico {
    width: 70px;
}

#menu ul {
    display: flex;
    list-style: none;
    gap: 5px;
}

#menu li a {
    display: block;
    color: var(--white);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1.05rem;
    padding: 10px 15px;
    border-radius: 4px;
    transition: all var(--transition);
    position: relative;
}

#menu li a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 15px;
    right: 15px;
    height: 2px;
    background-color: var(--accent-red);
    transform: scaleX(0);
    transition: transform var(--transition);
}

#menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#menu li a:hover::after {
    transform: scaleX(1);
}

/* --- Burger Menu (Mobile) --- */
.burger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.burger span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--white);
    transition: all 0.3s;
    border-radius: 2px;
}

.burger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --- Full Width Wrapper (Widened to 1350px) --- */
#wrapper {
    max-width: 1350px; /* Widened so everything fits on one line */
    width: 95%;
    margin: 0 auto 40px auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.section {
    padding: 60px 50px;
    border-bottom: 1px solid var(--border-color);
}

.section:last-child { border-bottom: none; }
.bg-light { background-color: var(--bg-light); }

.item {
    width:100%;
    height:auto;
}

/* --- Typography --- */
.heading {
    font-size: 2.5rem;
    font-family: var(--font-primary);
    font-weight: 700;
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.2;
}

.subheading {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.section-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
}

/* --- Categories Grid --- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.category-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid var(--border-color);
}

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

.category-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 15px;
}

.category-card p {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.category-card span {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- Cards & Lists --- */
.card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-family: var(--font-primary);
}

.feature-list {
    list-style: none;
    margin-top: 15px;
}

.feature-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* --- Tables --- */
.table-responsive { overflow-x: auto; }

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.modern-table th, .modern-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.modern-table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.modern-table tbody tr:hover { background-color: var(--bg-light); }
.modern-table tr:last-child td { border-bottom: none; }

/* --- Documents Grid (Ensures single line when wide enough) --- */
.documents-grid {
    display: grid;
    /* This setup guarantees 5 columns on big screens since max-width is 1350px */
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--white);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

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

.doc-item img {
    width: 40px;
    flex-shrink: 0;
}

.doc-item span {
    font-size: 0.95rem;
    font-weight: 500;
}

.schedule-notice {
    background: #E8F5E9; 
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 4px 8px 8px 4px;
}

/* --- Contacts & Map --- */
.contacts-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.contact-line {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.contact-line span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modern-address {
    font-style: normal;
}

/* --- Buttons --- */
.cta-container { text-align: center; }

.btn {
    display: inline-block;
    padding: 15px 35px;
    border-radius: 8px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 172, 172, 0.4);
}

/* --- About Article --- */
.about-article p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: justify;
}

/* --- Reviews Section --- */
.review-form {
    max-width: 600px;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.review-form input, .review-form textarea, .review-form select {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.review-form textarea {
    height: 120px;
    resize: vertical;
}

#reviewsList {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-card {
    background: #f9f9f9;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

.review-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}


.review-date {
    color: #888;
    font-size: 0.85rem;
    margin-left: auto;
}

/* --- Footer & Back to top --- */
#footer {
    background-color: var(--header-bg);
    color: var(--white);
    text-align: center;
    padding: 25px 0;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* --- Responsive Media Queries --- */
@media (min-width: 1150px) {
    .logo-text { display: block; }
}

@media (max-width: 900px) {
    .contacts-wrapper { grid-template-columns: 1fr; }
}

@media (max-width: 1150px) {
    body { padding-top: 100px; }
	
	/* 2. Remove 'height: 70px;' and let the container adapt */
		.header-container { 
			height: auto; 
			min-height: 70px; 
			transition: all var(--transition);
		}
    
    .section { padding: 40px 20px; }
    .heading { font-size: 2rem; }
    
    .burger { display: flex; }
    
    #menu {
        position: fixed;
        top: 94px;
        left: -100%;
        width: 100%;
        background-color: var(--header-bg);
        transition: all var(--transition);
        border-radius: 0; 
        box-shadow: 0 10px 15px rgba(0,0,0,0.2);
    }
    
	/* 4. ADD THIS: Slide the menu up when the header shrinks */
    #header.scrolled #menu {
        top: 74px; 
    }
	
    #menu.active { left: 0; }
    
    #menu ul {
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
    }
    
    #menu li a {
        display: block;
        padding: 15px 30px;
        border-radius: 0;
    }
    
	#menu li a::after {
			/* Adjusting the line to match the wider mobile padding */
			left: 30px; 
			right: 30px;
			bottom: 5px;
	}
	
	.modern-table th,
	.modern-table td {
	  padding: 10px 12px;
	  font-size: 0.9rem;
	}
}

/* --- Секція відгуків (Слайдер) --- */
.reviews-slider-wrapper { 
    max-width: 800px; 
    margin: 0 auto; 
}

.review-item { 
    background: var(--white); 
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius); 
    padding: 35px; 
    box-shadow: var(--shadow-sm); 
    /* Відступи по боках, щоб стрілочки слайдера не налазили на текст */
    margin: 10px 50px; 
}

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

.reviewer-info-wrap { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
}

.reviewer-avatar { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    background: var(--bg-light); 
    border: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    color: var(--primary-color); 
    font-size: 1.2rem; 
    flex-shrink: 0; 
}

.reviewer-name { 
    font-weight: 700; 
    color: var(--text-dark); 
    font-family: var(--font-primary); 
    line-height: 1.2;
    font-size: 1.05rem;
}

.review-stars-display { 
    display: flex; 
    gap: 2px; 
    margin-top: 5px; 
}

.review-stars-display svg { 
    width: 16px; 
    height: 16px; 
    fill: #FFB300; 
}

.review-text-content { 
    color: var(--text-dark); 
    line-height: 1.6; 
    font-size: 1rem; 
    font-style: italic;
}

/* На телефонах зменшуємо відступи, бо стрілочки зазвичай ховаються або менші */
@media (max-width: 768px) {
    .review-item { margin: 10px 15px; padding: 25px; }
}

#reviews-slider, 
#reviews-slider .slider__wrapper, 
#reviews-slider .slider__items {
    background: transparent !important;
}

.review-text-content { 
    color: var(--text-dark); 
    line-height: 1.6; 
    font-size: 1rem; 
    font-style: italic;
    
    /* Нові правила для довгих текстів */
    max-height: 350px; /* Це приблизно 5-6 рядків тексту. Можете змінити під себе */
    overflow-y: auto;  /* Додає скрол, якщо текст не поміщається */
    padding-right: 10px; /* Відступ, щоб текст не прилипав до скролбара */
}
