/* =========================================
   UBER / DOORDASH STYLE MODAL (V2 PREMIUM)
   mobile-first, content-rich, sticky footer
   ========================================= */

/* --- LAYOUT & BASE --- */
.service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    font-family: 'Inter', 'Roboto', sans-serif;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-modal.active {
    visibility: visible;
}

.service-modal.active .modal-overlay {
    opacity: 1;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 94vh;
    background: #FFFFFF;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}

.service-modal.active .modal-card {
    transform: translateY(0);
}

/* --- FIXED HEADER --- */
.modal-header-fixed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    z-index: 100;
    pointer-events: none;
}

.modal-close-floating,
.modal-share-floating {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-size: 1.1rem;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.modal-close-floating:active,
.modal-share-floating:active {
    transform: scale(0.9);
    background: #fff;
}

/* --- SCROLL BODY --- */
.modal-scroll-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.modal-scroll-body::-webkit-scrollbar {
    display: none;
}

/* --- HERO SECTION --- */
.modal-hero-container {
    width: 100%;
    height: 260px;
    position: relative;
    background: #F3F4F6;
}

.hero-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
}

/* --- CONTENT WRAPPER --- */
.modal-content-wrapper {
    background: #FFFFFF;
    border-radius: 24px 24px 0 0;
    margin-top: -24px;
    position: relative;
    padding-top: 24px;
    padding-bottom: 110px;
    min-height: 100%;
}

/* --- HEADER INFO --- */
.modal-header-info {
    padding: 0 24px;
    margin-bottom: 24px;
}

.modal-header-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 1rem;
    color: #6B7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-meta-row {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.star-gold {
    color: #FBBF24;
}

.text-green {
    color: #10B981;
}

/* --- BENEFITS PILLS --- */
.benefits-pills-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 0 24px 8px;
    scrollbar-width: none;
}

.benefit-pill {
    flex: 0 0 auto;
    background: #F9FAFB;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #4B5563;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #F3F4F6;
}

/* --- SECTIONS --- */
.modal-section {
    padding: 0 24px;
    margin-top: 32px;
}

.modal-section h4 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 16px;
}

.modal-section-divider {
    height: 8px;
    background: #F9FAFB;
    margin: 32px 0 0;
}

/* --- LISTS --- */
.includes-list-simple {
    list-style: none;
    padding: 0;
}

.includes-list-simple li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.95rem;
    color: #374151;
    border-bottom: 1px solid #F3F4F6;
}

.includes-list-simple li:last-child {
    border-bottom: none;
}

.includes-list-simple li i {
    color: #10B981;
    font-size: 0.9rem;
}

/* --- FAQ ACCORDION --- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-card {
    background: #F9FAFB;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.faq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-q-text {
    font-weight: 700;
    color: #111;
    font-size: 0.95rem;
}

.faq-arrow {
    font-size: 0.8rem;
    color: #9CA3AF;
    transition: transform 0.3s ease;
}

.faq-card.active .faq-arrow {
    transform: rotate(180deg);
}

.faq-body {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #4B5563;
    line-height: 1.6;
    display: none;
}

/* --- CAROUSELS (Reviews & Related) --- */
.reviews-horizontal-carousel,
.related-services-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 4px 0 20px;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
    scrollbar-width: none;
}

.reviews-horizontal-carousel::-webkit-scrollbar,
.related-services-scroll::-webkit-scrollbar {
    display: none;
}

/* Review Card */
.review-card-large {
    flex: 0 0 85%;
    background: #FFFFFF;
    border: 1px solid #F3F4F6;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.review-avatar {
    width: 40px;
    height: 40px;
    background: #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #374151;
}

.review-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.r-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.r-date {
    font-size: 0.75rem;
    color: #9CA3AF;
}

.review-stars {
    color: #FBBF24;
    font-size: 0.75rem;
}

.review-body {
    font-size: 0.9rem;
    color: #4B5563;
    line-height: 1.6;
    font-style: italic;
}

/* Related Card */
.related-card {
    flex: 0 0 140px;
    background: #FFFFFF;
    border: 1px solid #F3F4F6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.related-img {
    height: 80px;
    background-size: cover;
    background-position: center;
}

.related-info {
    padding: 10px;
}

.related-info h5 {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111;
    line-height: 1.2;
}

.related-info .r-price {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--red-brand);
}

/* --- TRUST BOX --- */
.premium-guarantee-box {
    background: #ECFDF5;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.premium-guarantee-box i {
    color: #10B981;
    font-size: 1.2rem;
    margin-top: 2px;
}

.premium-guarantee-box p {
    font-size: 0.85rem;
    color: #065F46;
    line-height: 1.5;
}

/* --- STICKY FOOTER --- */
.modal-sticky-footer {
    padding: 16px 24px;
    background: #FFFFFF;
    border-top: 1px solid #F3F4F6;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
    /* Soft top shadow */
    padding-bottom: max(16px, env(safe-area-inset-bottom));

    /* Intelligent Behavior: Initially Hidden */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.18s ease-in, opacity 0.18s ease-in, visibility 0.18s;
}

/* Intelligent Visibility State */
.modal-sticky-footer.is-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.24s ease-out,
        visibility 0.26s;
}

/* --- INLINE CTA STYLE --- */
.modal-inline-cta-container {
    margin: 20px 0 0;
}

.btn-inline-cta {
    width: 100%;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.2);
}

.cta-microcopy-inline {
    text-align: center;
    font-size: 0.75rem;
    color: #6B7280;
    font-weight: 500;
}

.cta-microcopy-inline i {
    color: #FBBF24;
    margin-right: 4px;
}

/* --- PRIMARY BUTTON STYLE --- */
.btn-primary-action {
    background: var(--red-brand);
    color: #FFFFFF;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.3);
    transition: all 0.2s ease;
}

.btn-primary-action:active {
    transform: scale(0.97);
}

.cta-microcopy {
    text-align: center;
    font-size: 0.7rem;
    color: #9CA3AF;
    margin-top: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- STAGGERED ENTRANCE --- */
@keyframes premiumSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-item {
    opacity: 0;
}

.service-modal.active .stagger-item {
    animation: premiumSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.15s;
}

.delay-3 {
    animation-delay: 0.2s;
}

.delay-4 {
    animation-delay: 0.25s;
}

.delay-5 {
    animation-delay: 0.3s;
}

.delay-6 {
    animation-delay: 0.35s;
}

.delay-7 {
    animation-delay: 0.4s;
}

.delay-8 {
    animation-delay: 0.45s;
}

.delay-9 {
    animation-delay: 0.5s;
}