/* ========================================
   SERVICES PAGE STYLES
   ======================================== */

/* Hero */
.services-hero {
    background: linear-gradient(135deg, #002b49 0%, #003d6b 50%, #005a94 100%);
    color: #fff;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.services-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.services-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.services-hero h1 {
    font-size: 2.4rem;
    font-weight: 900;
    font-style: italic;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.services-hero h1 i {
    margin-right: 12px;
    opacity: 0.95;
}

.services-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
    letter-spacing: 0.3px;
}

/* Search + grouped layout (products-like flow) */
.services-search-section {
    background: #f0f2f5;
    padding: 24px 0;
}

.services-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.services-content {
    display: flex;
    flex-direction: column;
}

.services-content-full {
    grid-column: 1 / -1;
}

.services-header {
    margin-bottom: 36px;
    text-align: center;
}

.services-header h2 {
    font-size: 2.1rem;
    font-weight: 700;
    color: #002b49;
    margin: 0 0 10px;
}

.services-header p {
    font-size: 1.05rem;
    color: #666;
    margin: 0;
}

.services-category-group {
    margin-bottom: 56px;
}

.services-category-group:last-child {
    margin-bottom: 0;
}

.service-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e8ecf0;
    border-left: 5px solid #0078c1;
    cursor: pointer;
}

.service-category-text {
    flex: 1;
}

.service-detail-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #c8dff1;
    background: #fff;
    color: #0f639b;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.service-detail-link:hover {
    border-color: #8ebcde;
    color: #084f80;
    box-shadow: 0 8px 18px rgba(0, 120, 193, 0.16);
}

.service-category-text h2 {
    margin: 0 0 8px;
    color: #002b49;
    font-size: 1.8rem;
}

.service-category-text p {
    margin: 0;
    color: #555;
}

.child-services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    max-width: 100%;
    padding: 0;
}

.services-category-group.selected-main .service-category-header {
    border-color: #b8d6ec;
    box-shadow: 0 12px 30px rgba(0, 120, 193, 0.16);
}

.sub-service-card.selected-sub {
    border-color: #0078c1;
    box-shadow: 0 10px 28px rgba(0, 120, 193, 0.2);
    background: linear-gradient(135deg, #eef6fc 0%, #e8f1f9 100%);
}

.sub-service-icon {
    width: 100%;
    height: 160px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eaf2f9 0%, #dce9f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #0b6095;
    margin-bottom: 12px;
}

.service-empty-inline {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: #7c8a96;
    background: #f8fafc;
    border: 1px dashed #d7e3ee;
    border-radius: 12px;
}

/* Services Section */
.services-section {
    padding: 60px 0 80px;
    background: linear-gradient(135deg, #f8f9fa 0%, #eef3f7 100%);
    overflow: visible;
}

.services-section > .container {
    overflow: visible;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 0;
    overflow: visible;
}

#servicesContainer.services-grid {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
}

/* Service Card */
.service-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 48px rgba(0, 120, 193, 0.2);
    border-color: #0078c1;
}

.service-card-tooltip {
    position: absolute;
    top: -75px;
    left: 50%;
    transform: translateX(-50%);
    background: #002b49;
    color: #fff;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    max-width: 300px;
    white-space: normal;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.service-card:hover .service-card-tooltip {
    opacity: 1;
    visibility: visible;
}

.service-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 32px 24px;
    border-bottom: none;
}

.service-card-icon {
    display: none;
}

.service-card-icon i {
    display: none;
}

.service-card-info {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.service-card-info h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #002b49;
    margin-bottom: 10px;
    line-height: 1.3;
}

.service-card-info p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.service-card-thumb {
    display: block;
    width: 100%;
    max-width: 360px;
    height: 220px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #e6edf5;
    box-shadow: 0 6px 18px rgba(0, 43, 73, 0.12);
    background: #fff;
}

.service-card-body {
    padding: 0 24px 24px;
    flex: 1;
}

.service-card-body > p {
    color: #555;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Sub-services grid */
.sub-services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.sub-service-card {
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fb 100%);
    border-radius: 12px;
    padding: 16px;
    border: 2px solid #e8eef6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.sub-service-card:hover {
    border-color: #0078c1;
    box-shadow: 0 8px 24px rgba(0, 120, 193, 0.15);
    transform: translateY(-4px);
}

.sub-service-card-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fff;
}

.sub-service-card h4 {
    font-size: 1rem;
    color: #002b49;
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.sub-service-card h4 i {
    display: none;
}

.sub-service-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA Section */
.services-cta {
    background: linear-gradient(135deg, #0078c1 0%, #005a94 50%, #003d6b 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: 60px 0 0 0;
}

.services-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.services-cta p {
    font-size: 1.05rem;
    opacity: 0.85;
    margin-bottom: 25px;
}

.cta-btn {
    display: inline-block;
    padding: 14px 36px;
    background: #0078c1;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s, transform 0.3s;
}

.cta-btn:hover {
    background: #005a94;
    transform: translateY(-2px);
}

.cta-btn i {
    margin-right: 8px;
}

/* Loading */
.services-loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 1.1rem;
}

.services-loading i {
    display: block;
    font-size: 2rem;
    margin-bottom: 15px;
    color: #0078c1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.services-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.services-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .services-section {
        padding: 40px 0 60px;
    }

    .services-hero h1 {
        font-size: 1.8rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .service-card-header {
        padding: 24px 20px;
    }

    .service-card-body {
        padding: 0 20px 20px;
    }

    .service-category-header {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }

    .service-detail-link {
        width: 100%;
    }

    .service-category-text h2 {
        font-size: 1.4rem;
    }

    .child-services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .services-cta {
        padding: 60px 20px;
    }

    .services-cta h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .services-hero {
        padding: 40px 0 30px;
    }

    .services-hero h1 {
        font-size: 1.4rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .service-card-header {
        padding: 20px 16px;
    }

    .service-card-icon {
        display: none;
    }

    .service-card-icon i {
        display: none;
    }

    .service-card-info h2 {
        font-size: 1.1rem;
    }

    .service-card-body {
        padding: 0 16px 16px;
    }

    .child-services-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .sub-service-card {
        padding: 12px;
    }

    .sub-service-card h4 {
        font-size: 0.9rem;
    }
}
