/* ================================================================
   HOMEPAGE ORCHESTRATOR STYLES — Phase A Spacing Audit
   
   Design System:
   - Container:  max-width 1400px (matches .site-container)
   - Spacing:    16-20px mobile / 24px tablet / 32px desktop
   - Radius:     var(--card-radius, 16px)
   - Shadows:    var(--card-shadow) / var(--card-shadow-hover)
   - Colors:     all var() have hardcoded fallbacks
   ================================================================ */

/* ================================================================
   1. UNIFIED CONTENT CONTAINER
   Every section sits inside .ail-app-content.site-container,
   which inherits the global max-width. Hero breaks out full-bleed.
   ================================================================ */
.ail-app-content {
    padding: 0;
}

@media (min-width: 640px) {
    .ail-app-content {
        padding-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .ail-app-content {
        padding-bottom: 0;
    }
}

/* All .pm-section and .hp-section get horizontal padding to match
   the .site-container gutter (16px). The hero is excluded. */
.pm-section,
.hp-section {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* ================================================================
   2. RESPONSIVE SECTION SPACING
   16-20px mobile → 24px tablet → 32px desktop
   ================================================================ */
.pm-section {
    margin-bottom: var(--space-md);
}

@media (min-width: 640px) {
    .pm-section {
        margin-bottom: var(--space-lg);
    }
}

@media (min-width: 1024px) {
    .pm-section {
        margin-bottom: var(--space-section);
    }
}

/* Section titles */
.ail-section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin: 0 0 var(--space-sm) 0;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

@media (min-width: 640px) {
    .ail-section-title {
        font-size: 20px;
        margin-bottom: var(--space-sm);
    }
}

@media (min-width: 1024px) {
    .ail-section-title {
        font-size: 24px;
        margin-bottom: var(--space-md);
    }
}

/* Unified App Surface */
.pm-app-surface {
    background: var(--bg-color, #f8fafc);
    border-radius: 24px 24px 0 0;
    padding: 20px 20px 20px 20px;
    /* Native app spacing */
    margin-top: -20px;
    position: relative;
    z-index: 20;
    padding-top: var(--space-lg);
    padding-bottom: 20px;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.08);
}

@media (min-width: 640px) {
    .pm-app-surface {
        padding-top: var(--space-section);
        padding-bottom: var(--space-section);
    }
}

@media (min-width: 1024px) {
    .pm-app-surface {
        padding-top: var(--space-section);
        padding-bottom: var(--space-section);
    }
}

/* ================================================================
   3. HEADER + HERO UNIFIED BLOCK
   Header shadow removed on homepage. Hero sits flush below
   with no border radius, as the App Surface overlaps it.
   ================================================================ */
body.home .ail-app-header,
body.page-template-default.home .ail-app-header {
    box-shadow: none;
    margin-bottom: 0;
    border-bottom: none;
    position: sticky;
}

/* Hero — compact, content-adaptive */
.pm-hero {
    border-radius: 0;
    padding: var(--space-lg) var(--space-sm) 64px;
    /* Extra bottom padding to account for the -48px overlap */
    text-align: center;
    position: relative;
    overflow: visible;
    margin: 0;
    margin-top: 0 !important;
    margin-bottom: 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* Removed z-index: 10; to prevent a restrictive stacking context. 
       This allows the .pm-search-bar dropdown to render above .pm-app-surface */
    z-index: auto !important;
}

@media (min-width: 640px) {
    .pm-hero {
        padding: var(--space-lg) var(--space-md) 80px;
    }
}

@media (min-width: 1024px) {
    .pm-hero {
        padding: var(--space-section) var(--space-lg) 96px;
    }
}

.pm-hero-content {
    position: relative;
    /* Removed z-index: 2; to release the stacking context and allow the search dropdown to escape over the ads */
    z-index: auto !important;
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 1280px) {
    .pm-hero-content {
        max-width: 900px;
    }
}

.pm-hero h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

@media (min-width: 640px) {
    .pm-hero h1 {
        font-size: 36px;
        letter-spacing: -1px;
    }
}

@media (min-width: 1024px) {
    .pm-hero h1 {
        font-size: 48px;
        margin-bottom: 16px;
    }
}

.pm-hero p {
    font-size: 15px;
    opacity: 0.9;
    margin: 0 0 20px 0;
    font-weight: 500;
    line-height: 1.5;
}

@media (min-width: 1024px) {
    .pm-hero p {
        font-size: 18px;
        margin-bottom: 28px;
    }
}

/* ================================================================
   1.5 TRUST BADGES SECTION
   ================================================================ */
.pm-trust-grid-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .pm-trust-grid-section {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

.pm-trust-item-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color, #f8fafc);
    padding: var(--space-sm);
    border-radius: var(--card-radius, 16px);
    text-align: center;
    transition: var(--transition-smooth);
}

@media (hover: hover) and (pointer: fine) {
    .pm-trust-item-section:hover {
        transform: translateY(-2px);
        box-shadow: var(--card-shadow-hover);
    }
}

.pm-trust-icon-section {
    font-size: 24px;
    margin-bottom: 8px;
}

.pm-trust-text-section {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    line-height: 1.3;
}

/* Old Trust Grid (remove or leave commented out to avoid conflict) */
.pm-trust-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .pm-trust-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-top: 24px;
    }
}

.pm-trust-item {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border-radius: var(--card-radius, 16px);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: var(--transition, all 0.3s ease);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pm-trust-item:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}

.pm-trust-icon {
    font-size: 28px;
    line-height: 1;
}

.pm-trust-text {
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    text-align: center;
    line-height: 1.3;
}

@media (min-width: 640px) {
    .pm-trust-text {
        font-size: 13px;
    }

    .pm-trust-icon {
        font-size: 32px;
    }
}

/* ── Search Bar ── */
.pm-search-bar {
    background: var(--card-bg, #ffffff);
    padding: 6px;
    border-radius: 16px;
    display: flex;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

@media (min-width: 640px) {
    .pm-search-bar {
        padding: 8px;
        border-radius: 20px;
    }
}

.pm-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    padding: var(--space-sm);
    font-size: 15px;
    border-radius: 12px;
    outline: none;
    color: var(--text-primary, #1e293b);
    background: transparent;
}

@media (min-width: 640px) {
    .pm-search-input {
        padding: var(--space-sm) var(--space-md);
        font-size: 16px;
        border-radius: 16px;
    }
}

.pm-search-btn {
    flex-shrink: 0;
    background: var(--btn-primary-bg, var(--primary-color)) !important;
    color: var(--btn-primary-text, #ffffff) !important;
    border: none;
    border-radius: var(--btn-radius, 12px) !important;
    padding: 0 var(--space-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

@media (min-width: 640px) {
    .pm-search-btn {
        border-radius: var(--card-radius, 16px);
        padding: 0 32px;
        font-size: 15px;
    }
}

.pm-search-btn:hover {
    background: var(--btn-hover-bg, var(--secondary-color)) !important;
    transform: translateY(-1px);
}

/* ================================================================
   4. CATEGORIES GRID
   Responsive grid — no cut cards, no empty whitespace.
   overflow:hidden prevents any card from bleeding out.
   ================================================================ */
.pm-cats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    overflow: hidden;
}

@media (min-width: 480px) {
    .pm-cats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }
}

@media (min-width: 640px) {
    .pm-cats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-sm);
    }
}

@media (min-width: 768px) {
    .pm-cats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1024px) {
    .pm-cats-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1280px) {
    .pm-cats-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

.pm-cat-card {
    background: var(--card-bg, #ffffff);
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    height: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .pm-cat-card {
        border-radius: 16px;
        padding: 20px 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    }
}

@media (hover: hover) and (pointer: fine) {
    .pm-cat-card:hover {
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
        transform: translateY(-3px);
        border-color: rgba(0, 0, 0, 0.08);
    }
}

.pm-cat-icon {
    font-size: 28px;
    line-height: 1;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #6C3BFF);
}

@media (min-width: 640px) {
    .pm-cat-icon {
        font-size: 32px;
        height: 40px;
    }
}

.pm-cat-name {
    color: var(--text-primary, #1e293b);
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    margin: 0;
}

@media (min-width: 640px) {
    .pm-cat-name {
        font-size: 14px;
        font-weight: 700;
    }
}

/* ================================================================
   5. FEATURED SERVICES + RECENT LISTINGS (Cards & Scroll Row)
   No auto slider. Static responsive grid.
   ================================================================ */
.pm-scroll-row {
    display: flex;
    overflow-x: auto;
    gap: var(--space-sm);
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pm-scroll-row::-webkit-scrollbar {
    display: none;
}

@media (min-width: 640px) {
    .pm-scroll-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        overflow-x: visible;
        gap: 16px;
        padding-bottom: 0;
    }
}

@media (min-width: 768px) {
    .pm-scroll-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .pm-scroll-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

.pm-card {
    background: var(--card-bg, #ffffff);
    border-radius: var(--card-radius, 16px);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    flex: 0 0 calc(85vw - 32px);
    scroll-snap-align: start;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.04);
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .pm-card {
        flex: unset;
    }
}

@media (hover: hover) and (pointer: fine) {
    .pm-card:hover {
        box-shadow: var(--card-shadow-hover);
        transform: translateY(-3px);
    }
}

/* ── Service Cards ── */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.pm-service-img {
    height: 180px;
    background: linear-gradient(90deg, #f8fafc 25%, #e2e8f0 50%, #f8fafc 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    position: relative;
    overflow: hidden;
}

.pm-service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.pm-service-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color, var(--primary-color));
}

.pm-service-info {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pm-service-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.pm-service-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--rating-color, #f59e0b);
    margin-top: auto;
}

/* -- View All Card -- */
.pm-card-view-all {
    background: linear-gradient(135deg, var(--primary-color, var(--primary-color)), var(--secondary-color, #8b5cf6));
    border-radius: var(--card-radius, 16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;

    transition: var(--transition-smooth);
    box-shadow: var(--card-shadow);
}

@media (hover: hover) and (pointer: fine) {
    .pm-card-view-all:hover {
        transform: translateY(-3px);
        box-shadow: var(--card-shadow-hover);
    }
}

.pm-card-view-all .pm-va-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.pm-card-view-all .pm-va-label {
    font-size: 14px;
    font-weight: 800;
}

/* -- Badges -- */
.pm-badge-rating {
    background: var(--card-bg, #ffffff);
    padding: 4px 10px;
    border-radius: var(--card-radius, 16px);
    font-size: 12px;
    font-weight: 800;
    color: var(--rating-color, #f59e0b);
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pm-badge-verified {
    background: var(--success-color, #10b981);
    color: white;
    padding: 4px 10px;
    border-radius: var(--card-radius, 16px);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ================================================================
   6. CUSTOMER REVIEWS — Auto height, hide when empty
   ================================================================ */
.ail-testi-slider .swiper-wrapper {
    align-items: stretch;
}

.pm-testi-card {
    background: var(--card-bg, #ffffff);
    border-radius: var(--card-radius, 16px);
    padding: var(--space-md);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: auto;
    min-height: 0;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.pm-testi-stars {
    font-size: 14px;
    margin-bottom: 12px;
}

.pm-testi-text {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    line-height: 1.6;
    margin-bottom: 16px;
    font-style: italic;
}

.pm-testi-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding-top: 14px;
    margin-top: auto;
}

.pm-testi-avatar {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: var(--btn-primary-bg, var(--primary-color)) !important;
    color: var(--btn-primary-text, #ffffff) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.pm-testi-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
}

.pm-testi-loc {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin-top: 2px;
}

/* Reviews section collapses completely if empty */
.pm-section-reviews:empty,
[data-section="customer_reviews"]:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ================================================================
   7. ICON CONTRAST — Auto-contrast for header icons
   The PHP already computes --header-text via get_readable_color().
   These CSS rules ensure all header interactive elements inherit it.
   ================================================================ */
.ail-app-header .dashicons,
.ail-app-header .ail-notif-bell .dashicons,
.ail-app-header .ail-user-icon .dashicons {
    color: var(--header-text, #1e293b) !important;
}

.ail-app-header a {
    color: var(--header-text, #1e293b);
}

.ail-app-header .ail-loc-title,
.ail-app-header .ail-loc-sub,
.ail-app-header .ail-loc-sub i {
    color: var(--header-text, #1e293b) !important;
}

/* Footer icon contrast — inherits from inline footer text color */
.ail-brand-footer a,
.ail-brand-footer .dashicons {
    color: inherit;
}

/* ================================================================
   8. FOOTER WIDTH ALIGNMENT
   Footer background is full-width; content matches .site-container.
   Remove the hard-coded max-width: 1200px on the grid.
   ================================================================ */
.ail-brand-footer {
    width: 100%;
    margin-top: 0;
}

.ail-app-footer-inner.site-container {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

/* Override the core.css 1200px max-width so footer matches content */
.ail-footer-grid {
    max-width: none;
}

/* ================================================================
   9. SWIPER PAGINATION & FOOTER SPACING
   ================================================================ */

/* Swiper pagination area - compact */
.ail-listing-slider .swiper-pagination,
.ail-testi-slider .swiper-pagination {
    position: relative;
    margin-top: 16px;
}

/* Last section before footer - remove bottom margin */
.ail-app-content>.pm-section:last-child,
.ail-app-content>.hp-section:last-child,
.pm-app-surface>.pm-section:last-child,
.pm-app-surface>.hp-section:last-child {
    margin-bottom: 0 !important;
}

/* Footer - kill excessive top margin from core.css */
body.home .ail-brand-footer {
    margin-top: 0 !important;
    padding-top: 24px !important;
    padding-bottom: 16px !important;
}

body.home .ail-footer-grid {
    gap: 16px !important;
}

/* ================================================================
   ADS — Device-Specific Banner Visibility
   ================================================================ */
.hp-ads-device-banners {
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .hp-ads-device-banners {
        margin-bottom: 24px;
    }
}

@media (min-width: 1024px) {
    .hp-ads-device-banners {
        margin-bottom: 32px;
    }
}

.hp-ad-mobile {
    display: block;
}

.hp-ad-tablet {
    display: none;
}

.hp-ad-desktop {
    display: none;
}

@media (min-width: 640px) and (max-width: 1023px) {
    .hp-ad-mobile {
        display: none;
    }

    .hp-ad-tablet {
        display: block;
    }

    .hp-ad-desktop {
        display: none;
    }
}

@media (min-width: 1024px) {
    .hp-ad-mobile {
        display: none;
    }

    .hp-ad-tablet {
        display: none;
    }

    .hp-ad-desktop {
        display: block;
    }
}

.hp-ads-device-banners img {
    width: 100%;
    border-radius: var(--card-radius, 16px);
    display: block;
}

/* ================================================================
   HERO COUNTERS
   ================================================================ */
.pm-hero-counters>div {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .pm-hero-counters>div:hover {
        transform: translateY(-2px);
        opacity: 1;
    }
}

/* ================================================================
   AD CAMPAIGN SLIDER (Premium Marketplace Advertisement)
   Strictly enforced fixed-height compact banner.
   Mobile: 120px | Tablet: 180px | Desktop: 250px

   ROOT CAUSE FIX:
   1. front-page.php had inline aspect-ratio:21/9 on <img> — removed.
   2. core.css .swiper { padding-bottom:20px } at ≤991px inflates height — overridden.
   3. Swiper auto-height could inject inline height — blocked via CSS.
   All containers are height-locked with overflow:hidden.
   ================================================================ */

/* ── Elementor wrapper collapse (when rendered via Elementor widget) ── */
.elementor-widget-container:has(.ail-ad-slider),
.elementor-widget-container:has(#ail-ad-slider),
.elementor-element:has(.ail-ad-slider),
.elementor-element:has(#ail-ad-slider),
.elementor-column:has(.ail-ad-slider),
.elementor-column:has(#ail-ad-slider),
.elementor-section:has(.ail-ad-slider),
.elementor-section:has(#ail-ad-slider) {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
}

/* ── Parent wrapper — collapse to content ── */
.ail-promotional-block,
.pm-section:has(.ail-ad-slider),
.pm-section:has(#ail-ad-slider) {
    margin-top: 0 !important;
    margin-bottom: var(--space-sm, 16px) !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
    overflow: hidden !important;
    /* Height driven by the slider child, never larger */
    height: 120px !important;
}

@media (min-width: 640px) {

    .ail-promotional-block,
    .pm-section:has(.ail-ad-slider),
    .pm-section:has(#ail-ad-slider) {
        height: 180px !important;
    }
}

@media (min-width: 1024px) {

    .ail-promotional-block,
    .pm-section:has(.ail-ad-slider),
    .pm-section:has(#ail-ad-slider) {
        height: 250px !important;
    }
}

/* ── Slider container — locked height, kill core.css padding-bottom ── */
.ail-ad-slider,
#ail-ad-slider {
    border-radius: var(--card-radius, 16px) !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: var(--card-shadow) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    /* Kills core.css .swiper padding-bottom:20px */
    padding-bottom: 0 !important;
    /* Explicit override for specificity */
    width: 100% !important;
    height: 120px !important;
    /* Mobile lock */
    max-height: 120px !important;
    min-height: 0 !important;
    display: block !important;
}

@media (min-width: 640px) {

    .ail-ad-slider,
    #ail-ad-slider {
        height: 180px !important;
        /* Tablet lock */
        max-height: 180px !important;
    }
}

@media (min-width: 1024px) {

    .ail-ad-slider,
    #ail-ad-slider {
        height: 250px !important;
        /* Desktop lock */
        max-height: 250px !important;
    }
}

/* ── Inner Swiper structure — must allow horizontal expansion ── */
.ail-ad-slider .swiper-wrapper,
#ail-ad-slider .swiper-wrapper {
    height: 100% !important;
    display: flex !important;
    box-sizing: content-box !important;
    /* Required by Swiper */
    margin: 0 !important;
    padding: 0 !important;
    /* REMOVED: overflow: hidden and width: 100% so cloned slides don't get clipped */
}

/* Let Swiper calculate the width of the slide via inline styles. Do NOT force width here. */
.ail-ad-slider .swiper-slide,
#ail-ad-slider .swiper-slide {
    height: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

/* The anchor tag and image can safely take 100% of the correctly sized slide */
.ail-ad-slider .swiper-slide a,
#ail-ad-slider .swiper-slide a {
    height: 100% !important;
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}



/* ── Images — fill & crop, no intrinsic sizing ── */
.ail-ad-slider img,
#ail-ad-slider img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-height: none !important;
    max-width: none !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    /* Kill any inherited or inline aspect-ratio */
    border-radius: 0 !important;
    /* Parent already has border-radius */
}

/* ── Pagination dots overlaid inside the banner ── */
.ail-ad-slider .swiper-pagination,
#ail-ad-slider .swiper-pagination {
    position: absolute !important;
    bottom: 10px !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10 !important;
    height: auto !important;
    /* Don't contribute to container height */
}

.ail-ad-slider .swiper-pagination-bullet,
#ail-ad-slider .swiper-pagination-bullet {
    background: var(--card-bg, #ffffff);
    opacity: 0.5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ail-ad-slider .swiper-pagination-bullet-active,
#ail-ad-slider .swiper-pagination-bullet-active {
    opacity: 1;
}

/* ================================================================
   MOBILE UI PREMIUM REFACTOR (max-width: 767px)
   Remove nested box design: Section -> Inner White Box -> Content
   ================================================================ */
@media (max-width: 767px) {

    .hp-section[data-section="featured_services"],
    .hp-section[data-section="recent_listings"],
    .hp-section[data-section="featured-providers"],
    .hp-section[data-section="locations"],
    .hp-section[data-section="customer_reviews"],
    .hp-section[data-section="how_it_works"] {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-bottom: 24px !important;
    }
}

/* ================================================================
   PHASE 3: MOBILE PREMIUM UI REFACTOR (Master Prompt)
   ================================================================ */
@media (max-width: 639px) {

    /* Single Background Layer */
    .pm-app-surface {
        background: var(--card-bg, #ffffff) !important;
        padding: 24px 0 24px 0 !important;
    }

    /* Outer Section Padding: 16px, Section Gap: 24px */
    .pm-section,
    .hp-section {
        padding-left: 16px !important;
        padding-right: 16px !important;
        margin-bottom: 24px !important;
    }



    /* Single Border Radius for images within borderless cards */
    .ail-loc-card-img,
    .ail-service-card-img-wrap,
    .ail-listing-card-img-wrap,
    .pm-hiw-card-icon {
        border-radius: var(--global-radius, 16px) !important;
    }
}