/*---------------- VDG Наши работы v1.0.1 ---------------------------*/

/* Сетка карточек */
.work-portfolio-grid {
    display: flex !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Карточка — жёстко 4 в ряд, НЕ тянется */
.work-portfolio-item {
    flex: 0 0 calc(25% - 15px) !important;
    max-width: calc(25% - 15px) !important;
    min-width: 0 !important;
    width: calc(25% - 15px) !important;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    text-decoration: none !important;
    color: inherit !important;
    display: block !important;
}

.work-portfolio-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
    color: inherit !important;
}

.work-preview-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #e5e7eb;
    margin: 0;
    padding: 0;
}

.work-preview-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out;
    display: block;
    margin: 0;
    padding: 0;
}

.work-portfolio-item:hover .work-preview-photo {
    transform: scale(1.08);
}

.work-category-label {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 7px 16px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    z-index: 10;
    margin: 0;
    border: none;
}

.work-category-label.work-type-drilling { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.work-category-label.work-type-treatment { background: linear-gradient(135deg, #059669 0%, #047857 100%); }
.work-category-label.work-type-repair { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
.work-category-label.work-type-equipment { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); }

.work-details-container { padding: 22px; box-sizing: border-box; }

.work-primary-description {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 18px 0;
    padding: 0;
    line-height: 1.45;
    min-height: 52px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-location-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    margin: 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.work-icon-location { width: 18px; height: 18px; flex-shrink: 0; color: #6b7280; }

.work-meta-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin: 0;
    border-bottom: 1px solid #e5e7eb;
}

.work-duration-info {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    padding: 0;
}

.work-icon-clock { width: 17px; height: 17px; flex-shrink: 0; }
.work-duration-value { color: #111827; font-weight: 600; }

.work-pricing-block {
    padding: 14px 0 0 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.work-price-label-text { font-size: 14px; color: #6b7280; font-weight: 500; }
.work-price-container { display: flex; flex-direction: column; }
.work-price-amount { font-size: 20px; font-weight: 700; color: #059669; line-height: 1.2; }

@keyframes work-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.work-portfolio-item:hover .work-category-label { animation: work-badge-pulse 0.6s ease-in-out; }

/* Секция */
.work-portfolio-section {
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
    padding: 0;
    box-sizing: border-box;
}

.work-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 40px 0;
    padding: 0;
    flex-wrap: wrap;
    gap: 24px;
}

.work-section-title-wrapper { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.work-section-stats { display: flex; align-items: baseline; gap: 12px; line-height: 1; }
.work-stats-number { font-size: 64px; font-weight: 700; color: #0EA5E9; letter-spacing: -1px; }
.work-stats-separator { font-size: 48px; font-weight: 300; color: #0EA5E9; margin: 0 -4px; }
.work-section-subtitle { font-size: 16px; color: #374151; font-weight: 400; text-transform: uppercase; letter-spacing: 0.5px; margin: 0; }

.work-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    text-decoration: none !important;
    white-space: nowrap;
}

.work-view-all-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
    color: #ffffff !important;
    text-decoration: none !important;
}

.work-btn-icon { width: 18px; height: 18px; transition: transform 0.3s ease; }
.work-view-all-btn:hover .work-btn-icon { transform: translateX(4px); }

.work-button-bottom { display: none; width: 100%; margin: 32px 0 0 0; }

/* === Фильтры на странице /portfolio === */
.work-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 32px 0;
}

.work-filter-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.work-filter-btn:hover { background: #e5e7eb; color: #111827; text-decoration: none; }
.work-filter-btn.active { background: #2563eb; color: #ffffff; border-color: #2563eb; }

/* === Страница отдельной работы === */
.portfolio-detail { padding: 0 0 40px 0; }

.portfolio-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    margin: 0 0 24px 0;
    font-weight: 500;
    transition: color 0.2s;
}

.portfolio-back-link:hover { color: #1d4ed8; text-decoration: none; }

.portfolio-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 24px 0;
}

.portfolio-detail-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.portfolio-detail-header .work-category-label { position: static; box-shadow: none; }

.portfolio-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    padding: 16px 0;
    margin: 0 0 24px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.portfolio-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #374151;
    font-weight: 500;
}

.portfolio-meta-price .work-price-amount { font-size: 22px; }

.portfolio-detail-image {
    margin: 0 0 24px 0;
    border-radius: 12px;
    overflow: hidden;
}

.portfolio-detail-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.portfolio-gallery-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}

.portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 0 0 32px 0;
}

.portfolio-gallery-link {
    border-radius: 8px;
    overflow: hidden;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-gallery-link:hover { transform: scale(1.03); }

.portfolio-gallery-link img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.portfolio-detail-description {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
}

.portfolio-detail-description p { margin: 0 0 16px 0; }
.portfolio-detail-description img { max-width: 100%; height: auto; border-radius: 8px; }

/* === АДАПТИВ === */

/* 3 карточки */
@media (max-width: 1200px) {
    .work-portfolio-item {
        flex: 0 0 calc(33.333% - 14px) !important;
        max-width: calc(33.333% - 14px) !important;
        width: calc(33.333% - 14px) !important;
    }
}

/* 2 карточки */
@media (max-width: 992px) {
    .work-portfolio-item {
        flex: 0 0 calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
        width: calc(50% - 10px) !important;
    }
    .work-stats-number { font-size: 52px; }
    .work-stats-separator { font-size: 40px; }
}

/* 1 карточка */
@media (max-width: 768px) {
    .work-portfolio-grid { gap: 16px !important; }
    .work-portfolio-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .work-section-header { margin-bottom: 32px; }
    .work-section-header .work-view-all-btn { display: none; }
    .work-button-bottom { display: block; }
    .work-button-bottom .work-view-all-btn { display: flex; width: 100%; justify-content: center; }
    .work-stats-number { font-size: 48px; }
    .work-stats-separator { font-size: 36px; }
    .work-section-subtitle { font-size: 14px; }
    .portfolio-detail-header h1 { font-size: 22px; }
    .portfolio-detail-meta { gap: 16px; }
    .portfolio-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* Заголовок без счётчика */
.work-section-title-plain {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}
