/* ========== GALLERY STYLES ========== */
.gallery-page {
    padding: 80px 0 100px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header h1 {
    color: #2c3e50;
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-header .subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Фильтры */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.filter-btn {
    padding: 12px 28px;
    background: white;
    border: 2px solid #e0e6ed;
    border-radius: 50px;
    color: #5a6c7d;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.filter-btn:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.15);
}

.filter-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.filter-btn i {
    font-size: 1.1em;
}

/* Галерея */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.gallery-empty {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 1px solid #e7edf5;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    color: #5a6c7d;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.gallery-empty h3 {
    margin: 0 0 8px;
    color: #2c3e50;
    font-size: 1.3rem;
}

.gallery-empty p {
    margin: 0;
}

.gallery-more {
    text-align: center;
    margin-top: 30px;
}

.gallery-show-more {
    min-width: 220px;
    display: none;
}

.gallery-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.gallery-item.highlight {
    border: 3px solid #3498db;
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.2);
}

.gallery-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.gallery-image picture {
    display: block;
    height: 100%;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

.gallery-image {
    height: 260px;
}

.work-info {
    padding: 20px 22px 24px;
}

.work-title {
    font-size: 1.15rem;
    margin-bottom: 0;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 25px;
}

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

.overlay-content {
    color: white;
    width: 100%;
}

.overlay-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: break-word;
}

.overlay-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.overlay-tag {
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.work-info {
    padding: 25px;
}

.work-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #5a6c7d;
    margin-bottom: 15px;
}

.work-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.work-description {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.work-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail {
    background: #f8fafc;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #5a6c7d;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.detail.badge {
    background: #e8f4fd;
    color: #3498db;
    font-weight: 600;
}

/* Палитра */
.color-showcase {
    margin-top: 60px;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.color-showcase h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 15px;
}

.color-showcase p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 40px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.color-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.color-card:hover {
    transform: translateY(-5px);
}

.color-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-dot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.color-info {
    padding: 15px;
    text-align: center;
    background: #f8fafc;
}

.color-info h4 {
    color: #2c3e50;
    margin-bottom: 5px;
}

.color-info span {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.color-name {
    color: white;
    font-weight: 600;
}

/* Счетчик */
.work-counter {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    margin-top: 60px;
}

.counter-number {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.counter-text {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* CTA */
.order-cta {
    text-align: center;
    margin-top: 50px;
}

.order-cta .btn + .btn {
    margin-left: 20px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-page {
        padding: 60px 0;
    }

    .gallery-header h1 {
        font-size: 2.2rem;
    }

    .gallery-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        max-width: 460px;
        margin: 0 auto 32px;
        padding: 0 14px;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
        padding: 11px 12px;
        font-size: 0.92rem;
        border-radius: 16px;
        gap: 7px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .color-showcase {
        padding: 30px;
    }

    .work-counter {
        padding: 35px;
    }

    .order-cta .btn {
        width: 100%;
        margin-bottom: 15px;
        margin-left: 0;
    }

    .order-cta .btn + .btn {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .gallery-header h1 {
        font-size: 1.8rem;
    }

    .gallery-filters {
        gap: 8px;
        padding: 0 10px;
    }

    .filter-btn {
        font-size: 0.88rem;
        padding: 10px 8px;
    }

    .gallery-image {
        height: 220px;
    }

    .counter-number {
        font-size: 2.6rem;
    }
}
