/* ============================================
   АДАПТИВНЫЙ CSS ДЛЯ СТРАНИЦЫ ПРОЕКТА
   ============================================ */

/* ============================================
   БОЛЬШИЕ ПЛАНШЕТЫ (1024px - 1280px)
   ============================================ */
@media (max-width: 1280px) {
    .project-detail-page .container {
        gap: 2rem;
        padding: 0 20px 60px;
    }

    .gallery-main {
        height: 380px;
    }

    .project-detail-title {
        font-size: 2rem;
    }

    .price-block .price {
        font-size: 1.75rem;
    }

    .completion-btn {
        min-width: 110px;
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   ПЛАНШЕТЫ (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .project-detail-page .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 16px 50px;
    }

    .project-detail-page {
        padding-top: 100px;
    }

    .gallery-main {
        height: 320px;
    }

    .gallery-thumb {
        width: 80px;
        height: 60px;
    }

    .project-detail-title {
        font-size: 1.75rem;
    }

    .project-detail-info {
        gap: 1.25rem;
    }

    .info-block {
        padding: 1.25rem;
    }

    .completion-btn {
        min-width: calc(50% - 0.5rem);
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .completion-btn small {
        font-size: 0.75rem;
    }

    .price-block .price {
        font-size: 1.5rem;
    }

    .project-features {
        padding: 1.25rem;
    }

    .request-btn {
        padding: 0.9rem;
        font-size: 1rem;
    }

    .plan-image {
        max-height: 300px;
        object-fit: cover;
    }

    .project-specs {
        padding: 1rem;
    }

    .specs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .spec-item {
        padding: 0.75rem;
    }

    .spec-value {
        font-size: 1rem;
    }

    /* Лайтбокс */
    .lightbox-image {
        max-height: 70vh;
    }

    #lightboxModal .modal-close {
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* ============================================
   МАЛЕНЬКИЕ ПЛАНШЕТЫ И БОЛЬШИЕ ТЕЛЕФОНЫ (600px - 768px)
   ============================================ */
@media (max-width: 768px) {
    .project-detail-page {
        padding-top: 80px;
    }

    .project-detail-page .container {
        padding: 0 12px 40px;
        gap: 1.5rem;
    }

    .gallery-main {
        height: 260px;
        border-radius: var(--radius-medium);
    }

    .gallery-thumb {
        width: 70px;
        height: 55px;
    }

    .gallery-thumbs {
        gap: 0.5rem;
    }

    .plan-section h4 {
        font-size: 1rem;
    }

    .plan-image {
        border-radius: var(--radius-medium);
        max-height: 220px;
    }

    .project-detail-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .project-detail-info {
        gap: 1rem;
    }

    .info-block {
        padding: 1rem;
        border-radius: var(--radius-medium);
    }

    .info-block h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .project-description-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .completion-buttons {
        gap: 0.5rem;
    }

    .completion-btn {
        min-width: calc(50% - 0.25rem);
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        border-radius: var(--radius-medium);
    }

    .completion-btn small {
        font-size: 0.7rem;
        margin-top: 0.15rem;
    }

    .price-block {
        padding: 1rem;
        border-radius: var(--radius-medium);
    }

    .price-block .price {
        font-size: 1.35rem;
    }

    .price-block .sub {
        font-size: 0.8rem;
    }

    .project-features {
        padding: 1rem;
        border-radius: var(--radius-medium);
    }

    .project-features h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .completion-tagline {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .feature-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        border-left-width: 2px;
    }

    .feature-icon svg {
        width: 14px;
        height: 14px;
    }

    .request-btn {
        padding: 0.8rem;
        font-size: 0.95rem;
        border-radius: var(--radius-large);
    }

    /* Спецификации */
    .specs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .spec-item {
        padding: 0.6rem 0.75rem;
    }

    .spec-label {
        font-size: 0.65rem;
    }

    .spec-value {
        font-size: 0.9rem;
    }

    /* Лайтбокс */
    .lightbox-container {
        max-width: 100%;
        padding: 0.5rem;
    }

    .lightbox-image {
        max-height: 60vh;
        max-width: 95vw;
        border-radius: var(--radius-small);
    }

    .gallery-prev,
    .gallery-next {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .gallery-prev {
        left: 0.5rem;
    }

    .gallery-next {
        right: 0.5rem;
    }

    .gallery-counter {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
        bottom: 0.75rem;
        right: 0.75rem;
    }

    .gallery-prev:hover,
    .gallery-next:hover {
        transform: translateY(-50%) scale(1.05);
    }

    #lightboxModal .modal-close {
        top: 0.25rem;
        right: 0.25rem;
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }

    /* Загрузка */
    .loading p {
        font-size: 0.9rem;
    }

    .loading div {
        width: 32px;
        height: 32px;
    }
}

/* ============================================
   МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 480px)
   ============================================ */
@media (max-width: 480px) {
    .project-detail-page {
        padding-top: 70px;
    }

    .project-detail-page .container {
        padding: 0 10px 30px;
        gap: 1rem;
    }

    .gallery-main {
        height: 220px;
        border-radius: var(--radius-small);
    }

    .gallery-thumb {
        width: 60px;
        height: 45px;
        border-radius: var(--radius-small);
        border-width: 1.5px;
    }

    .gallery-thumbs {
        gap: 0.4rem;
    }

    .plan-section h4 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .plan-image {
        border-radius: var(--radius-small);
        max-height: 180px;
    }

    .project-detail-title {
        font-size: 1.3rem;
    }

    .project-detail-info {
        gap: 0.75rem;
    }

    .info-block {
        padding: 0.75rem;
        border-radius: var(--radius-medium);
    }

    .info-block h4 {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .project-description-text {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }

    .completion-btn {
        min-width: 100%;
        padding: 0.45rem 0.6rem;
        font-size: 0.75rem;
        border-radius: var(--radius-small);
        border-width: 1.5px;
    }

    .completion-btn small {
        font-size: 0.65rem;
        margin-top: 0.1rem;
    }

    .price-block {
        padding: 0.75rem;
        border-width: 1.5px;
    }

    .price-block .price {
        font-size: 1.2rem;
    }

    .price-block .sub {
        font-size: 0.7rem;
    }

    .project-features {
        padding: 0.75rem;
    }

    .project-features h4 {
        font-size: 0.9rem;
    }

    .completion-tagline {
        font-size: 0.75rem;
    }

    .features-grid {
        gap: 0.4rem;
    }

    .feature-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        gap: 0.5rem;
        border-left-width: 2px;
        border-radius: var(--radius-small);
    }

    .feature-icon svg {
        width: 12px;
        height: 12px;
    }

    .request-btn {
        padding: 0.7rem;
        font-size: 0.85rem;
        border-radius: var(--radius-medium);
    }

    /* Спецификации */
    .specs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .spec-item {
        padding: 0.4rem 0.6rem;
        border-left-width: 2px;
        border-radius: var(--radius-small);
    }

    .spec-label {
        font-size: 0.55rem;
        margin-bottom: 0.2rem;
    }

    .spec-value {
        font-size: 0.8rem;
    }

    /* Лайтбокс */
    .lightbox-container {
        padding: 0.25rem;
    }

    .lightbox-image {
        max-height: 50vh;
        max-width: 98vw;
        border-radius: var(--radius-small);
    }

    .gallery-prev,
    .gallery-next {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .gallery-prev {
        left: 0.25rem;
    }

    .gallery-next {
        right: 0.25rem;
    }

    .gallery-counter {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        bottom: 0.5rem;
        right: 0.5rem;
        border-radius: var(--radius-small);
    }

    #lightboxModal .modal-close {
        top: 0.15rem;
        right: 0.15rem;
        width: 28px;
        height: 28px;
        font-size: 1rem;
        border-radius: 50%;
    }

    /* Загрузка */
    .loading p {
        font-size: 0.8rem;
    }

    .loading div {
        width: 28px;
        height: 28px;
        border-width: 3px;
    }
}

/* ============================================
   ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 360px)
   ============================================ */
@media (max-width: 360px) {
    .project-detail-page .container {
        padding: 0 8px 20px;
    }

    .gallery-main {
        height: 180px;
    }

    .gallery-thumb {
        width: 50px;
        height: 38px;
    }

    .project-detail-title {
        font-size: 1.1rem;
    }

    .info-block {
        padding: 0.6rem;
    }

    .info-block h4 {
        font-size: 0.8rem;
    }

    .project-description-text {
        font-size: 0.75rem;
    }

    .completion-btn {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }

    .completion-btn small {
        font-size: 0.6rem;
    }

    .price-block .price {
        font-size: 1rem;
    }

    .price-block .sub {
        font-size: 0.65rem;
    }

    .project-features {
        padding: 0.6rem;
    }

    .project-features h4 {
        font-size: 0.8rem;
    }

    .feature-item {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .feature-icon svg {
        width: 10px;
        height: 10px;
    }

    .request-btn {
        font-size: 0.75rem;
        padding: 0.6rem;
    }

    /* Спецификации */
    .specs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem;
    }

    .spec-item {
        padding: 0.3rem 0.5rem;
    }

    .spec-label {
        font-size: 0.5rem;
    }

    .spec-value {
        font-size: 0.7rem;
    }

    /* Лайтбокс */
    .gallery-prev,
    .gallery-next {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .gallery-counter {
        font-size: 0.55rem;
        padding: 0.15rem 0.4rem;
    }

    #lightboxModal .modal-close {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .lightbox-image {
        max-height: 45vh;
    }
}

/* ============================================
   ОРИЕНТАЦИЯ: АЛЬБОМНАЯ НА ТЕЛЕФОНАХ
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .project-detail-page {
        padding-top: 75px;
    }

    .gallery-main {
        height: 200px;
    }

    .gallery-thumb {
        width: 65px;
        height: 48px;
    }

    .project-detail-page .container {
        gap: 1.25rem;
    }

    .project-detail-title {
        font-size: 1.4rem;
    }

    .completion-btn {
        min-width: calc(33.333% - 0.5rem);
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .info-block {
        padding: 0.75rem;
    }

    .price-block .price {
        font-size: 1.2rem;
    }

    .project-features {
        padding: 0.75rem;
    }

    .request-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ДЛЯ ТАЧ-УСТРОЙСТВ
   ============================================ */
@media (hover: none) and (max-width: 768px) {
    .gallery-main:hover img {
        transform: none;
    }

    .gallery-thumb:hover {
        transform: none;
        opacity: 0.6;
    }

    .gallery-thumb.active {
        opacity: 1;
        transform: scale(1.05);
    }

    .completion-btn:hover {
        transform: none;
    }

    .completion-btn.active {
        transform: scale(1.02);
    }

    .request-btn:hover {
        transform: none;
    }

    .gallery-prev:hover,
    .gallery-next:hover {
        transform: translateY(-50%) scale(1.05);
    }

    .zoom-btn:hover {
        transform: none;
    }

    .zoom-btn:active {
        transform: scale(0.95);
    }

    .completion-btn:active {
        transform: scale(0.97);
    }

    .request-btn:active {
        transform: scale(0.97);
    }

    .gallery-thumb:active {
        transform: scale(0.95);
    }
}

/* ============================================
   ПОДДЕРЖКА УМЕНЬШЕННОГО ДВИЖЕНИЯ
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .gallery-main:hover img {
        transform: none;
    }

    .gallery-thumb:hover {
        transform: none;
    }

    .completion-btn:hover {
        transform: none;
    }

    .request-btn:hover {
        transform: none;
    }

    .modal-container {
        animation: none;
    }

    .modal-overlay {
        animation: none;
    }

    .notification {
        animation: none;
    }
}

/* ============================================
   ТЕМНАЯ ТЕМА (опционально)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Если нужно поддержать темную тему, можно добавить стили здесь */
}

/* ============================================
   ВЫСОКАЯ КОНТРАСТНОСТЬ (доступность)
   ============================================ */
@media (prefers-contrast: high) {
    .completion-btn {
        border-width: 3px;
    }

    .completion-btn.active {
        border-color: var(--brand-primary);
        background: var(--brand-primary);
        color: var(--white);
    }

    .price-block {
        border-width: 3px;
    }

    .feature-item {
        border-left-width: 4px;
    }

    .gallery-thumb {
        border-width: 3px;
    }

    .gallery-thumb.active {
        border-color: var(--brand-primary);
    }
}

/* ============================================
   ПЕЧАТЬ
   ============================================ */
@media print {
    .project-detail-page {
        padding-top: 20px;
    }

    .header,
    .footer,
    .request-btn,
    .completion-buttons,
    .zoom-btn,
    .gallery-thumbs,
    .modal {
        display: none !important;
    }

    .project-detail-page .container {
        display: block !important;
        padding: 0 !important;
    }

    .gallery-main {
        height: auto !important;
        max-height: 400px;
    }

    .gallery-main img {
        object-fit: contain !important;
    }

    .project-detail-info {
        margin-top: 1rem;
    }

    .price-block {
        border: 2px solid var(--brand-primary);
        background: var(--brand-light) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .project-features {
        background: var(--light-bg-1) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .info-block {
        background: var(--light-bg-1) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .spec-item {
        background: var(--white) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}