/* ========== CSS Variables (Theme) ========== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #222;
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --accent: #ff6b6b; /* яркий акцент */
    --accent-hover: #ff4757;
    --font-main: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
    --header-height: 60px;
    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== Header ========== */
#header {
    position: relative;
    height: 25vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-secondary);
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    z-index: 0;
}



.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1rem;
}

.site-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    margin-bottom: 0.5rem;
}

.contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.1vw;
}

.contacts a {
    color: var(--text-primary);
    opacity: 0.8;
}
.contacts a:hover {
    opacity: 1;
    color: var(--accent);
}

.socials a {
    margin: 0 0.3rem;
}

/* ========== Navigation ========== */
#main-nav {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--accent);
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

#main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

#main-nav ul li {
    margin: 0;
}

#main-nav ul li a {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2vw;
    padding: 0.5rem 0;
    border-bottom: 3px solid transparent;
    transition: border-color var(--transition), color var(--transition);
}

#main-nav ul li a:hover,
#main-nav ul li a.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

#main-nav ul li a:after{
	padding-left: 1em;
	content: '/';
}
#main-nav ul li:last-child a:after{
	content: '';
}


/* ========== Main Content ========== */
#main-content {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 80%;
    margin: 0 auto;
    width: 100%;
	font-size: 1vw;
}

.ModelItemsHolder {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-around;
	width: 100%;
}

.ModelSummary{
	flex-basis: 31%;
	display: flex;
	flex-direction: column;
}
.ModelSummaryTitle{
    flex-basis: 100%;
    text-align: center;
    margin: 0.6em;
}

.GalleryWrapper{
	width: 100%;
}

.ItemGalleryHolder{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.ModelImage{
    flex-basis: 20%;
    margin: 0.3em 0;
}
.ModelImage.FirstImage{
	flex-basis: 100%;
}

/* ========== About Page ========== */
.about-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.about-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    border-left: 6px solid var(--accent);
    padding-left: 1rem;
}

.about-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ========== Gallery Grid (Portfolio & Products) ========== */
.portfolio-section,
.products-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.portfolio-section h2,
.products-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    border-left: 6px solid var(--accent);
    padding-left: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.7);
}

.gallery-item a {
    display: block;
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: filter var(--transition);
}

.gallery-item:hover img {
    filter: brightness(0.7);
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 1rem 0.5rem 0.5rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.gallery-item:hover .image-caption {
    opacity: 1;
}

.image-description {
    padding: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ========== Pagination ========== */
.gallery-pagination {
    margin-top: 2rem;
    text-align: center;
}

.gallery-pagination a,
.gallery-pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border: 1px solid var(--bg-card);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
}

.gallery-pagination a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.gallery-pagination .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ========== Footer ========== */
#footer {
    background: var(--bg-secondary);
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #333;
    color: var(--text-secondary);
}

/* IMAGE CONTAINER */

/* Оверлей на весь экран */
.image-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.92);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Кнопка закрытия */
.image-popup-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 42px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  transition: opacity 0.2s;
}
.image-popup-close:hover {
  opacity: 0.7;
}

/* Контейнер картинки, позволяющий зумировать */
.image-popup-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;               /* чтобы зумированная картинка не вылезала за экран */
  position: relative;
}

.image-popup-image-container img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  transition: transform 0.2s ease; /* плавный зум */
  transform: scale(1);
  transform-origin: center center;
}

/* Панель управления зумом */
.image-popup-zoom-controls {
  position: absolute;
  right: 30px;
  top: 30%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10001;
}

.image-popup-zoom-in,
.image-popup-zoom-out {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.image-popup-zoom-in:hover,
.image-popup-zoom-out:hover {
  background: rgba(255,255,255,0.3);
  border-color: #fff;
}

/* Курсор для контейнера с изображением */
.image-popup-image-container {
  cursor: grab;                 /* когда можно тащить */
  user-select: none;           /* запрещаем выделение текста при драге */
  -webkit-user-select: none;
}

.image-popup-image-container.dragging {
  cursor: grabbing;
}

/* Кнопки навигации (влево/вправо) */
.image-popup-nav {
  position: absolute;
  top: 80%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 64px;
  font-weight: 300;
  cursor: pointer;
  user-select: none;
  z-index: 10002;
  width: 60px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.25);
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}
.image-popup-nav:hover {
  background-color: rgba(0,0,0,0.55);
  color: #ddd;
}
.image-popup-prev {
  left: 10px;
}
.image-popup-next {
  right: 10px;
}

.ModelSummaryTitle h2{
	min-height: 4em;
}

/* ========== Responsive ========== */
@media(max-width: 1180px ){
	.header-bg{
		background: url(/images/Head_1180x205.jpg);
		background-position: top;
		background-size: cover;
	}
}

@media(max-width: 1920px ){
	.header-bg{
		background: url(/images/Head_1920x360.jpg);
		background-position: top;
		background-size: cover;
	}
}
@media(max-width: 3840px ){
	.header-bg{
		background: url(/images/Head_3840x540.jpg);
		background-position: top;
		background-size: cover;
	}
}
@media(max-width: 4096px ){
	.header-bg{
		background: url(/images/Head_4096x1024.jpg);
		background-position: top;
		background-size: cover;
	}
}


@media (max-width: 768px) {
		@media (orientation: portrait) {
		.site-title {
			font-size: 2.2rem;
		}
		.contacts {
			flex-direction: column;
			gap: 0.5rem;
			font-size: 1rem;
		}
		#header {
			height: auto;
		}
		#main-nav ul {
			flex-wrap: wrap;
			gap: 1rem;
		}
		#main-nav ul li a {
			font-size: 1rem;
		}
		.gallery-grid {
			grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
			gap: 1rem;
		}
		.about-section,
		.portfolio-section,
		.products-section {
			padding: 1rem;
		}
		#main-content{
			width: 90%;
			font-size: 4vw;
			overflow-x: hidden;
		}
		.ModelSummary{
			flex-basis: 100%;
			width: 100%;
		}
		.ModelTextContent{
			padding-top: 2em;
			text-align: justify;
		}
	}
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }
}