/* ============================================================
   SERVICES.CSS - СТИЛИ КАТАЛОГА И СПИСКА УСЛУГ
   ============================================================ */

/* ============================================================
   КАТАЛОГ КАТЕГОРИЙ УСЛУГ (/services)
   ============================================================ */

.catalog {
    padding: 70px 0;
    background: #232323;
}
.catalog .section-title {
    margin-bottom: 5px;
    font-size: 32px;
    font-weight: 700;
    color: #f0f0f0;
    text-align: center;
}
.catalog__subtitle {
    text-align: center;
    color: #b0b0b0;
    font-size: 1.1rem;
    margin-bottom: 40px;
}
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.catalog-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #3a3a3a;
    aspect-ratio: 1 / 1;
    position: relative;
}
.catalog-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.catalog-item__image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #1e1e1e;
    overflow: hidden;
}
.catalog-item__image img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0; left: 0;
}
.catalog-item__placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a4a;
    font-size: 64px;
}
.catalog-item__overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 2;
    padding: 16px 18px 18px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.80) 40%,
        rgba(0, 0, 0, 0.40) 75%,
        rgba(0, 0, 0, 0) 100%
    );
}
.catalog-item:hover .catalog-item__overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.98) 0%,
        rgba(0, 0, 0, 0.85) 40%,
        rgba(0, 0, 0, 0.45) 75%,
        rgba(0, 0, 0, 0) 100%
    );
}
.catalog-item__name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.8);
}
.catalog-item__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.catalog-item__count {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.8);
}
.catalog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #8a8a8a;
}
.catalog-empty p { font-size: 18px; }

/* ============================================================
   СТРАНИЦА КАТЕГОРИИ УСЛУГ (/services/{cat})
   ============================================================ */

.category-page {
    padding: 70px 0;
    background: #232323;
}
.category-header {
    margin-bottom: 40px;
    text-align: center;
}
.category-title {
    font-size: 32px;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ===== КАРТОЧКА УСЛУГИ — КВАДРАТНАЯ ===== */
.product-card {
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #3a3a3a;
    aspect-ratio: 1 / 1;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.product-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}
.product-card__image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #1e1e1e;
    overflow: hidden;
}
.product-card__image img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0; left: 0;
}
.product-card__placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a4a;
    font-size: 48px;
}
.product-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
}
.badge-new {
    background: rgba(58, 186, 106, 0.9);
    color: #ffffff;
    border: 1px solid rgba(58, 186, 106, 0.3);
}
.badge-popular {
    background: rgba(186, 170, 58, 0.9);
    color: #ffffff;
    border: 1px solid rgba(186, 170, 58, 0.3);
}

/* ============================================================
   КАРТОЧКА УСЛУГИ — ОВЕРЛЕЙ СНИЗУ (НОВАЯ КОМПОНОВКА)
   ============================================================ */

.product-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 14px 16px 16px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.85) 40%,
        rgba(0, 0, 0, 0.45) 75%,
        rgba(0, 0, 0, 0) 100%
    );
    transition: background 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card:hover .product-card__overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.98) 0%,
        rgba(0, 0, 0, 0.9) 40%,
        rgba(0, 0, 0, 0.5) 75%,
        rgba(0, 0, 0, 0) 100%
    );
}

/* ===== НАЗВАНИЕ УСЛУГИ ===== */
.product-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.8);
    word-break: break-word;
}

/* ===== ЦЕНА — ОТДЕЛЬНОЙ СТРОКОЙ, СПРАВА ===== */
.product-card__price-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.product-card__price {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 3px rgba(0, 0, 0, 0.8);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ===== КНОПКИ + СТРЕЛКА ===== */
.product-card__buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    flex-wrap: nowrap;
}

.product-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    background: rgba(80, 80, 80, 0.85);
    border: 1px solid rgba(120, 120, 120, 0.6);
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    text-shadow: none;
    flex-shrink: 0;
}

.product-card__button--phone {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    padding: 6px 10px;
}

.product-card__button--phone i {
    font-size: 10px;
    opacity: 0.85;
    flex-shrink: 0;
}

.product-card__button--order {
    flex-shrink: 0;
}

/* ===== КНОПКА-СТРЕЛКА ===== */
.product-card__button--arrow {
    width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.15);
    border-color: rgba(74, 144, 217, 0.4);
    color: #4a90d9;
}

.product-card__button--arrow i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card__button--arrow {
    background: rgba(74, 144, 217, 0.3);
    border-color: rgba(74, 144, 217, 0.7);
    color: #6aa9e9;
}

.product-card:hover .product-card__button--arrow i {
    transform: translateX(2px);
}

/* ===== ОБЩИЕ HOVER-ЭФФЕКТЫ КНОПОК ===== */
.product-card:hover .product-card__button {
    background: rgba(105, 105, 105, 0.95);
    border-color: rgba(140, 140, 140, 0.8);
}

.product-card:hover .product-card__button--arrow {
    background: rgba(74, 144, 217, 0.3);
    border-color: rgba(74, 144, 217, 0.7);
}

.product-card__button--phone:hover {
    background: rgba(105, 105, 105, 0.95);
}

.product-card__button--order:hover {
    background: rgba(120, 120, 120, 1);
    box-shadow: 0 4px 12px rgba(150, 150, 150, 0.3);
}

.product-card__button--arrow:hover {
    background: rgba(74, 144, 217, 0.4);
    border-color: rgba(74, 144, 217, 0.9);
    color: #ffffff;
}

/* ===== ПУСТАЯ КАТЕГОРИЯ ===== */
.category-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8a8a8a;
}
.category-empty p {
    font-size: 18px;
    margin-bottom: 16px;
}
.btn-secondary {
    background: #2a2a2a;
    color: #b0b0b0;
    border: 1px solid #3a3a3a;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background: #3a3a3a;
    color: #f0f0f0;
}

/* ===== SEO-ТЕКСТ КАТЕГОРИИ ===== */
.category-seo-text {
    margin-top: 50px;
    padding-top: 35px;
    border-top: 1px solid #333;
}
.category-seo-text h1,
.category-seo-text h2,
.category-seo-text h3 {
    color: #f0f0f0;
    margin-top: 25px;
    margin-bottom: 12px;
}
.category-seo-text h1 { font-size: 30px; }
.category-seo-text h2 { font-size: 24px; }
.category-seo-text h3 { font-size: 20px; }
.category-seo-text p {
    margin-bottom: 18px;
    color: #d0d0d0;
    line-height: 1.9;
    font-size: 16px;
}
.category-seo-text strong { color: #f0f0f0; }
.category-seo-text a {
    color: #4a90d9;
    text-decoration: none;
}
.category-seo-text a:hover { text-decoration: underline; }

/* ============================================================
   МОДАЛЬНОЕ ОКНО ЗАПИСИ НА УСЛУГУ
   ============================================================ */

.quick-order-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.quick-order-modal.active {
    display: flex;
}
.quick-order-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: qoFadeIn 0.25s ease;
}
.quick-order-modal__window {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 780px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    padding: 28px;
    animation: qoScaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes qoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes qoScaleIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.quick-order-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #b0b0b0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.25s ease;
    z-index: 3;
}
.quick-order-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: rotate(90deg);
}
.quick-order-modal__body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}
.quick-order-modal__image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #3a3a3a;
}
.quick-order-modal__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.quick-order-modal__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a4a;
    font-size: 48px;
}
.quick-order-modal__info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.quick-order-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0;
    line-height: 1.3;
    padding-right: 40px;
}
.quick-order-modal__price {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
}
.quick-order-modal .form-group {
    margin-bottom: 12px;
}
.quick-order-modal .form-group label {
    display: block;
    color: #d0d0d0;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}
.quick-order-modal .form-group input,
.quick-order-modal .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #f0f0f0;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.quick-order-modal .form-group input:focus,
.quick-order-modal .form-group textarea:focus {
    outline: none;
    border-color: #6a6a6a;
    background: #252525;
}
.quick-order-modal .form-group textarea {
    resize: vertical;
    min-height: 70px;
}
.quick-order-modal .required {
    color: #ba5a5a;
}
.quick-order-modal__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.quick-order-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    border: 1px solid transparent;
    flex: 1 1 auto;
    min-width: 160px;
    font-family: inherit;
}
.quick-order-modal__btn--add {
    background: #4a4a4a;
    color: #ffffff;
    border-color: #5a5a5a;
}
.quick-order-modal__btn--add:hover {
    background: #5a5a5a;
    border-color: #6a6a6a;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.quick-order-modal__btn--add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.quick-order-modal__btn--cart {
    background: transparent;
    color: #d0d0d0;
    border-color: #4a4a4a;
}
.quick-order-modal__btn--cart:hover {
    background: #3a3a3a;
    color: #ffffff;
    border-color: #5a5a5a;
    transform: translateY(-1px);
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 1024px) {
    .catalog-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .catalog, .category-page { padding: 60px 0; }
    .catalog .section-title, .category-title { font-size: 26px; }

    .product-card__title {
        font-size: 15px;
    }

    .product-card__price {
        font-size: 14px;
    }

    .product-card__button {
        padding: 5px 10px;
        font-size: 11px;
    }

    .product-card__button--phone {
        font-size: 10px;
        padding: 5px 8px;
    }

    .product-card__button--arrow {
        width: 26px;
        height: 26px;
    }

    .product-card__button--arrow i {
        font-size: 11px;
    }

    .quick-order-modal__window { padding: 22px; }
    .quick-order-modal__body {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .quick-order-modal__image-wrap {
        max-width: 240px;
        margin: 0 auto;
    }
    .quick-order-modal__title {
        font-size: 18px;
        text-align: center;
        padding-right: 0;
    }
    .quick-order-modal__price {
        font-size: 20px;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .catalog-grid, .products-grid {
        grid-template-columns: 1fr;
    }
    .catalog .section-title, .category-title { font-size: 22px; }
    .product-card__overlay { padding: 12px 14px 14px; }
    .product-card__title { font-size: 15px; }
    .product-card__button { padding: 5px 10px; font-size: 11px; }

    .quick-order-modal { padding: 12px; }
    .quick-order-modal__window { padding: 20px 16px; border-radius: 14px; }
    .quick-order-modal__close {
        top: 10px; right: 10px;
        width: 32px; height: 32px;
        font-size: 14px;
    }
    .quick-order-modal__image-wrap { max-width: 200px; }
    .quick-order-modal__title { font-size: 16px; }
    .quick-order-modal__price { font-size: 18px; }
    .quick-order-modal__actions { flex-direction: column; }
    .quick-order-modal__btn { width: 100%; min-width: 0; }
}

@media (max-width: 480px) {
    .product-card__title {
        font-size: 14px;
    }

    .product-card__price {
        font-size: 13px;
    }

    .product-card__buttons {
        gap: 4px;
    }

    .product-card__button {
        padding: 4px 8px;
        font-size: 10px;
    }

    .product-card__button--phone {
        font-size: 9px;
        padding: 4px 6px;
    }

    .product-card__button--arrow {
        width: 24px;
        height: 24px;
    }
}
