/* ---------- Services page ---------- */
.services-page,
.sv-services-section {
    padding-top: calc(var(--nav-height) + 34px);
    padding-bottom: 18px;
}

.sv-intro,
.sv-section-head {
    max-width: 820px;
    margin: 0 auto 46px;
    text-align: center;
}

.sv-section-head .section-title-dots {
    gap: 12px;
    font-size: clamp(28px, 4vw, 38px);
    margin-bottom: 0;
}

.sv-title-dots {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 0;
    color: var(--heading);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    line-height: 1.35;
}

.sv-title-dots::before {
    content: "";
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    background-image: radial-gradient(var(--primary) 3.5px, transparent 4px);
    background-size: 13px 13px;
    margin-inline-end: 4px;
}

.sv-title-dots--single {
    justify-content: flex-start;
}

.sv-intro-desc,
.sv-intro-description,
.sv-section-intro {
    max-width: 760px;
    margin: 18px auto 0;
    color: var(--text);
    font-size: clamp(20px, 2.35vw, 30px);
    font-weight: 500;
    line-height: 1.85;
}

/* ---------- Service cards — grid ---------- */
.sv-services-grid,
.sv-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(320px, 1fr);
    gap: 24px;
    align-items: stretch;
}

.sv-grid {
    margin-top: 0;
    margin-right: 0;
    margin-left: 0;
}

.sv-grid > .sv-grid-item {
    display: flex;
    width: auto;
    max-width: none;
    padding-right: 0;
    padding-left: 0;
}

/* ---------- 3D Flip card ---------- */
.sv-card {
    perspective: 1000px;
    min-width: 0;
    min-height: 320px;
    height: 100%;
    cursor: pointer;
}

.sv-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.sv-card:hover .sv-card-inner {
    transform: rotateY(180deg);
}

.sv-card-front,
.sv-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    border: 3px solid var(--border-muted);
    background-color: var(--white);
    overflow: hidden;
}

.sv-card-front {
    align-items: center;
    padding: 30px 24px 26px;
    text-align: center;
    z-index: 2;
}

.sv-card-back {
    transform: rotateY(180deg);
    align-items: center;
    justify-content: center;
    border-color: var(--primary);
    z-index: 1;
}

.sv-grid-item .sv-card {
    width: 100%;
}

/* ---------- Front face content ---------- */
.sv-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 64px;
    height: 64px;
    margin-bottom: 22px;
    color: var(--primary);
    font-size: 42px;
    line-height: 1;
}

.sv-card-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sv-card-icon img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sv-card-heading,
.sv-card-title {
    margin: 0;
    color: var(--heading);
    font-size: clamp(19px, 1.8vw, 24px);
    font-weight: 800;
    line-height: 1.45;
}

.sv-card-name {
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.sv-card-icon {
    margin-bottom: 16px;
}

.sv-card-text,
.sv-card-desc {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.95;
}

/* ---------- Back face content ---------- */
.sv-back-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sv-card-back::after {
    position: absolute;
    inset: 0;
    content: "";
    background-color: var(--primary);
    opacity: 0.65;
    z-index: 1;
}

.sv-card-more {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 30px;
    border: none;
    border-radius: 30px;
    background-color: var(--white);
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
}

.sv-card-more:hover {
    background-color: var(--white);
    color: var(--maroon);
}

/* ---------- Service detail modal ---------- */
#serviceDetailModal .modal-dialog {
    max-width: 880px;
}

.sv-modal-content {
    position: relative;
    border: none;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-red);
}

.sv-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--heading);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

[dir="rtl"] .sv-modal-close {
    right: auto;
    left: 16px;
}

.sv-modal-close:hover {
    background-color: var(--primary);
    color: var(--white);
    transform: rotate(90deg);
}

.sv-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 380px;
}

.sv-modal-image {
    min-height: 260px;
    overflow: hidden;
    background-color: var(--border-muted);
}

.sv-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sv-modal-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px 32px;
    background-color: var(--white);
}

.sv-modal-name {
    color: var(--primary);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}

.sv-modal-title {
    margin: 0 0 18px;
    color: var(--heading);
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.4;
}

.sv-modal-desc {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.9;
}

@media (max-width: 767.98px) {
    .sv-modal-body {
        grid-template-columns: 1fr;
    }

    .sv-modal-image {
        min-height: 220px;
    }

    .sv-modal-info {
        padding: 28px 24px;
    }
}

/* ---------- Focus accessible ---------- */
.sv-card:focus-within .sv-card-inner {
    transform: rotateY(180deg);
}

.sv-card:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 22px;
}

/* ---------- Why choose us ---------- */
.sv-why,
.sv-why-section {
    padding: 72px 0 84px;
    background-color: var(--white);
}

.sv-why-head {
    margin-bottom: 40px;
}

.sv-why-section .section-title-dots {
    justify-content: flex-start;
}

.sv-why-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
}

.sv-why-item {
    min-width: 0;
    text-align: center;
}

.sv-why-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    color: var(--primary);
    font-size: 36px;
    line-height: 1;
}

.sv-why-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sv-why-icon img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sv-why-heading,
.sv-why-title {
    margin: 0 0 10px;
    color: var(--heading);
    font-size: clamp(17px, 1.7vw, 21px);
    font-weight: 800;
    line-height: 1.5;
}

.sv-why-text,
.sv-why-desc {
    max-width: 250px;
    margin: 0 auto;
    color: var(--text);
    font-size: 15px;
    line-height: 1.85;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .services-page,
    .sv-services-section {
        padding-top: calc(var(--nav-height) + 24px);
    }

    .sv-intro,
    .sv-section-head {
        margin-bottom: 38px;
    }

    .sv-services-grid,
    .sv-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(300px, 1fr);
    }

    .sv-card {
        min-height: 300px;
    }

    .sv-why-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 38px;
    }
}

@media (max-width: 575.98px) {
    .services-page,
    .sv-services-section {
        padding-top: calc(var(--nav-height) + 16px);
    }

    .sv-intro,
    .sv-section-head {
        margin-bottom: 32px;
    }

    .sv-section-head .section-title-dots {
        gap: 8px;
        font-size: 26px;
    }

    .sv-section-head .section-title-dots::before {
        width: 40px;
        height: 40px;
        background-size: 10px 10px;
    }

    .sv-title-dots {
        gap: 8px;
        font-size: 26px;
    }

    .sv-title-dots::before {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        background-size: 10px 10px;
    }

    .sv-intro-desc,
    .sv-intro-description,
    .sv-section-intro {
        margin-top: 14px;
        font-size: 20px;
        line-height: 1.75;
    }

    .sv-services-grid,
    .sv-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
        gap: 18px;
    }

    .sv-card {
        min-height: 280px;
    }

    .sv-card-front {
        padding: 26px 20px 24px;
        border-radius: 18px;
    }

    .sv-card-back {
        border-radius: 18px;
    }

    .sv-card-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 18px;
        font-size: 36px;
    }

    .sv-card-heading,
    .sv-card-title {
        font-size: 19px;
    }

    .sv-card-name {
        font-size: 14px;
    }

    .sv-card-text,
    .sv-card-desc {
        font-size: 15px;
    }

    .sv-why,
    .sv-why-section {
        padding: 56px 0 68px;
    }

    .sv-why-head {
        margin-bottom: 32px;
    }

    .sv-why-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 18px;
    }

    .sv-why-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
        font-size: 30px;
    }

    .sv-why-heading,
    .sv-why-title {
        font-size: 16px;
    }

    .sv-why-text,
    .sv-why-desc {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sv-card-inner,
    .sv-card-more,
    .sv-modal-close {
        transition: none;
    }

    .sv-card:hover .sv-card-inner,
    .sv-card:focus-within .sv-card-inner {
        transform: none;
    }
}
