.vtm-services-page {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: #ffffff;
    min-height: 100vh;
    padding-top: 0 !important;
    margin-top: -16px !important;  /* Touch the Odoo header exactly */
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.vtm-services-hero {
    display: flex;
    align-items: stretch;
    min-height: 260px;
    overflow: hidden;
    background: linear-gradient(
        160deg,
        #ede5ff 0%,
        #e4d9ff 15%,
        #f2ecff 50%,
        #fcfaff 80%,
        #ffffff 100%
    );
    position: relative;
}

.vtm-services-hero__illustration {
    flex: 0 0 320px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    flex-shrink: 0;
}

.vtm-services-hero__illustration-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    mix-blend-mode: multiply;
    -webkit-mask-image: linear-gradient(
        to right,
        black 0%,
        black 55%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        black 0%,
        black 55%,
        transparent 100%
    );
}

.vtm-services-hero__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px 40px;
    z-index: 2;
}

.vtm-services-hero__title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: #2d1b69;
    margin: 0 0 14px;
}

.vtm-services-hero__subtitle {
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #6c47d4;
    margin: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(108, 71, 212, 0.08);
    padding: 5px 18px;
    border-radius: 100px;
}

/* ── Search bar (GitHub/Command Palette Style) ──────────────────────── */

.vtm-services-search-wrapper {
    display: flex;
    justify-content: center;
    padding: 32px 40px 20px;
    position: relative;
    z-index: 100;
}

.vtm-services-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 10, 31, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.vtm-services-search {
    width: 100%;
    max-width: 600px; /* GitHub style is usually a bit more compact */
    transition: transform 0.2s ease, width 0.2s ease;
    z-index: 100;
}

.vtm-services-search__form {
    display: flex;
    align-items: center;
    width: 100%;
}

.vtm-services-search__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: #ffffff;
    border: 1px solid #d0c8ec;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(45, 27, 105, 0.05);
    transition: all 0.2s ease;
    overflow: hidden;
}

.vtm-services-search__input-wrapper:focus-within {
    border-color: #6c47d4;
    box-shadow: 0 0 0 3px rgba(108, 71, 212, 0.2);
}

.vtm-services-search__icon-left {
    padding-left: 16px;
    color: #8c7fc0;
    font-size: 1.1rem;
}

.vtm-services-search__input {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font-size: 1rem;
    color: #2d1b69;
    background: transparent;
    outline: none;
    min-width: 0;
}

.vtm-services-search__input::placeholder {
    color: #a89fcc;
}

.vtm-services-search__shortcut {
    padding-right: 12px;
    display: flex;
    align-items: center;
}

.vtm-shortcut-key {
    background: #f1eff8;
    color: #6c47d4;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #e0d9f7;
    font-family: monospace;
}

.vtm-services-search__cancel-btn {
    display: none;
    background: transparent;
    border: none;
    color: #6c47d4;
    font-weight: 600;
    font-size: 0.9rem;
    padding-right: 16px;
    cursor: pointer;
}

/* ── Card grid ───────────────────────────────────────────────────────── */

.vtm-services-grid-wrapper {
    padding: 12px 40px 64px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.vtm-services-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 28px !important;
}

.vtm-services-empty {
    text-align: center;
    color: #7c7c9b;
    font-size: 1rem;
    padding: 48px 0;
}

/* ── Individual card (anchor wrapper) ───────────────────────────────── */

.vtm-service-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 3px 18px rgba(45, 27, 105, 0.09);
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
    border: 1px solid rgba(108, 71, 212, 0.07);
    text-decoration: none;   /* card is now an <a> */
    color: inherit;
}

/* Card: transparent overlay makes the whole card clickable */
.vtm-service-card__overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;          /* above card content but below footer buttons */
    display: block;
}

.vtm-service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 44px rgba(45, 27, 105, 0.16);
    text-decoration: none;
    color: inherit;
}

.vtm-service-card__photo {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #ede8ff;
    flex-shrink: 0;
    position: relative;
}

.vtm-service-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #2d1b69;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(45, 27, 105, 0.45);
    z-index: 2;
    flex-shrink: 0;
}

.vtm-service-card__badge-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.vtm-service-card__badge-img--generic {
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.vtm-service-card__body {
    padding: 18px 20px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vtm-service-card__name {
    font-size: 1rem;
    font-weight: 700;
    color: #4a2fb0;
    margin: 0 0 8px;
    line-height: 1.3;
}

.vtm-service-card__desc-wrapper {
    padding: 0 20px 12px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.vtm-service-card__desc-wrapper:hover {
    background-color: #fcfbfe;
}

.vtm-service-card__description {
    font-size: 0.875rem;
    color: #6b6b8a;
    line-height: 1.6;
    margin: 0;
    
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    
    max-height: 4.8em;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Flatten all HTML inside the description to plain text flow */
.vtm-service-card__description * {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    color: inherit !important;
    background: transparent !important;
    font-weight: normal !important;
    border: none !important;
    box-shadow: none !important;
}

/* Hide non-text elements completely */
.vtm-service-card__description img,
.vtm-service-card__description video,
.vtm-service-card__description iframe,
.vtm-service-card__description svg,
.vtm-service-card__description canvas,
.vtm-service-card__description button,
.vtm-service-card__description hr {
    display: none !important;
}

.vtm-service-card__desc-wrapper:hover .vtm-service-card__description,
.vtm-service-card__desc-wrapper.vtm-desc-expanded .vtm-service-card__description {
    -webkit-line-clamp: 7;
    max-height: 12em; /* 7 lines */
}

.vtm-service-card__desc-wrapper::after {
    content: '\f107';
    font-family: 'FontAwesome';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    color: #c4b5fd;
    font-size: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.vtm-service-card__desc-wrapper:hover::after,
.vtm-service-card__desc-wrapper.vtm-desc-expanded::after {
    opacity: 0;
    transform: translate(-50%, 8px);
}

.vtm-service-card__footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;   /* must be above the overlay link (z-index:1) */
}

.vtm-service-card__info-btn {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    color: #6c47d4;
    border: 1.5px solid #6c47d4;
    border-radius: 10px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.18s, color 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.vtm-service-card__info-btn:hover {
    background: #6c47d4;
    color: #ffffff;
    text-decoration: none;
}

.vtm-service-card__select-btn {
    flex: 1.4;
    padding: 10px 0;
    background: #2d1b69;
    color: #ffffff;
    border-radius: 10px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: background 0.18s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Highlight select-btn when the whole card is hovered */
.vtm-service-card:hover .vtm-service-card__select-btn {
    background: #4c2fa0;
    color: #ffffff;
    text-decoration: none;
}

.vtm-service-card__select-btn:hover {
    background: #4c2fa0;
    color: #ffffff;
    text-decoration: none;
}

/* ── Pager ───────────────────────────────────────────────────────────── */

.vtm-services-pager {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

/* Tablet: portrait and large landscape */
@media (max-width: 960px) {
    .vtm-services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .vtm-services-hero {
        flex-direction: column;
        min-height: auto;
    }

    .vtm-services-hero__illustration {
        flex: 0 0 auto;
        width: 100%;
        height: 220px;  /* slightly taller to not look cramped */
    }

    .vtm-services-hero__illustration-img {
        -webkit-mask-image: linear-gradient(
            to bottom,
            black 0%,
            black 55%,
            transparent 100%
        );
        mask-image: linear-gradient(
            to bottom,
            black 0%,
            black 55%,
            transparent 100%
        );
    }

    .vtm-services-hero__content {
        padding: 24px 28px 28px;
    }

    .vtm-services-hero__title {
        font-size: 1.55rem;
    }

    .vtm-services-grid-wrapper {
        padding: 12px 20px 48px;
    }

    .vtm-services-search-wrapper {
        padding: 24px 20px 16px;
    }
}

/* Mobile: landscape (width > 480px, height < 500px) */
@media (max-height: 500px) and (orientation: landscape) {
    .vtm-services-hero {
        flex-direction: row;
        min-height: 160px;
    }

    .vtm-services-hero__illustration {
        flex: 0 0 200px;
        height: auto;
    }

    .vtm-services-hero__illustration-img {
        -webkit-mask-image: linear-gradient(
            to right,
            black 0%,
            black 55%,
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            black 0%,
            black 55%,
            transparent 100%
        );
    }

    .vtm-services-hero__title {
        font-size: 1.2rem;
    }

    .vtm-services-hero__content {
        padding: 16px 20px;
    }

    .vtm-services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Small mobile: portrait */
@media (max-width: 580px) {
    .vtm-services-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .vtm-info-text {
        display: none;
    }

    .vtm-service-card__footer {
        align-items: center;
    }

    .vtm-service-card__info-btn {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        padding: 0;
        font-size: 1.1rem;
    }

    .vtm-services-hero__illustration {
        height: 180px;
    }

    .vtm-services-hero__title {
        font-size: 1.2rem;
    }

    .vtm-services-hero__subtitle {
        font-size: 0.78rem;
        padding: 4px 14px;
    }

    .vtm-services-hero__content {
        padding: 18px 20px 22px;
    }

    .vtm-services-search-wrapper {
        padding: 18px 14px 12px;
    }

    .vtm-services-search {
        max-width: 100%;
    }

    .vtm-services-search__input-wrapper {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(45, 27, 105, 0.08);
    }
    
    .vtm-services-search__shortcut {
        display: none; /* Hide keyboard shortcut hint on mobile */
    }

    /* Modal Mobile Overlay (GitHub style) */
    .vtm-search-active .vtm-services-search-overlay {
        display: block;
    }
    
    .vtm-search-active .vtm-services-search {
        position: fixed;
        /* top is set dynamically by JS (vtmGetHeaderBottom) via the
           --vtm-search-top CSS variable so it always sits exactly below
           the Odoo portal header whether it is visible or already scrolled
           away. Defaults to 0 when the header is out of view. */
        top: var(--vtm-search-top, 0px);
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        padding: 12px 14px;
        background: #ffffff;
        z-index: 101;
        border-bottom: 1px solid #e0d9f7;
        border-radius: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        animation: slideDownSearch 0.2s ease-out forwards;
    }
    
    .vtm-search-active .vtm-services-search__input-wrapper {
        border-radius: 8px;
        border: none;
        box-shadow: none;
        background: #f1eff8;
    }
    
    .vtm-search-active .vtm-services-search__input-wrapper:focus-within {
        box-shadow: none;
    }
    
    .vtm-search-active .vtm-services-search__cancel-btn {
        display: block;
    }
    
    @keyframes slideDownSearch {
        from { transform: translateY(-10px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .vtm-services-grid-wrapper {
        padding: 8px 14px 36px;
    }

    .vtm-service-card__photo {
        height: 160px;
    }

    .vtm-service-card__select-btn {
        margin: 10px 16px 14px;
    }
}

/* Very small mobile */
@media (max-width: 360px) {
    .vtm-services-hero__title {
        font-size: 1.05rem;
    }

    .vtm-services-grid-wrapper {
        padding: 6px 10px 28px;
    }
}
