/* Approved compact homepage. Keep these overrides in the existing theme layer
   so its important declarations do not override the responsive layout. */
@layer home-navy-outline {
    html #main-app #home-content.home-tight-layout .home-topbar {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        min-height: 64px !important;
        margin: 0 0 10px !important;
        padding: 5px 12px !important;
        border-radius: 16px !important;
        overflow: visible !important;
    }

    html #main-app #home-content.home-tight-layout :is(.home-topbar-left, .home-logo-inline) {
        width: auto !important;
        min-width: 0 !important;
    }

    html #main-app #home-content.home-tight-layout .home-logo-inline {
        gap: 7px !important;
    }

    html #main-app #home-content.home-tight-layout .home-topbar .brand-logo {
        width: 64px !important;
        height: 64px !important;
        max-width: 64px !important;
        flex: 0 0 64px !important;
    }

    html #main-app #home-content.home-tight-layout .home-topbar .brand-word {
        font-size: 24px !important;
        line-height: 1.1 !important;
    }

    html #main-app #home-content.home-tight-layout .home-logo-slogan {
        display: none !important;
    }

    /* The existing account buttons move to Profile with their IDs intact. */
    html #main-app #profile-content .profile-auth {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
        margin: 12px 16px !important;
    }

    html #main-app #profile-content .profile-auth .btn-primary {
        min-height: 44px !important;
        width: auto !important;
        margin: 0 !important;
        padding: 10px 16px !important;
        border: 1px solid #285d9a !important;
        border-radius: 11px !important;
        background: #285d9a !important;
        color: #ffffff !important;
        font-size: 14px !important;
    }

    html #main-app #home-content.home-tight-layout .home-topbar-right {
        display: flex !important;
        flex: 0 0 auto !important;
        flex-wrap: nowrap !important;
        width: auto !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    html #main-app #home-content.home-tight-layout #notification-center-wrap {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    html #main-app #home-content.home-tight-layout .notification-bell {
        width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-radius: 11px !important;
    }

    html #main-app #home-content.home-tight-layout #home-post-ad {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 11px !important;
        gap: 5px !important;
        border-radius: 11px !important;
        font-size: 13px !important;
    }

    /* Preserve the original two-column directory and every category. */
    html #main-app #home-content.home-tight-layout #home-category-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0 15px !important;
        margin: 10px 0 12px !important;
    }

    html #main-app #home-content.home-tight-layout #home-category-nav .home-category-chip {
        min-height: 44px !important;
        padding: 11px 8px !important;
        font-size: 13px !important;
        line-height: 1.2 !important;
    }

    html #main-app #home-content.home-tight-layout .home-search {
        margin: 0 0 12px !important;
        padding: 12px !important;
        border-radius: 14px !important;
    }

    html #main-app #home-content.home-tight-layout .home-search .home-hero-copy {
        margin: 0 !important;
        padding: 0 !important;
    }

    html #main-app #home-content.home-tight-layout .home-search .home-hero-copy h1 {
        margin: 0 !important;
        font-size: 20px !important;
        line-height: 1.2 !important;
        letter-spacing: -0.5px !important;
    }

    html #main-app #home-content.home-tight-layout .home-search .home-hero-copy p {
        margin: 6px 0 10px !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    html #main-app #home-content.home-tight-layout .home-search-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    html #main-app #home-content.home-tight-layout .home-search-field {
        min-width: 0 !important;
    }

    html #main-app #home-content.home-tight-layout .home-search-field-icon {
        left: 13px !important;
    }

    html #main-app #home-content.home-tight-layout #home-use-location {
        left: 0 !important;
        width: 44px !important;
        height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html #main-app #home-content.home-tight-layout .home-search-field > :is(input, select) {
        box-sizing: border-box !important;
        width: 100% !important;
        min-height: 44px !important;
        height: 44px !important;
        padding: 9px 32px 9px 40px !important;
        border-radius: 11px !important;
        font-size: 16px !important;
        line-height: 24px !important;
    }

    html #main-app #home-content.home-tight-layout .home-search-actions {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        margin: 0 !important;
    }

    html #main-app #home-content.home-tight-layout #home-search-btn {
        width: 100% !important;
        min-height: 44px !important;
        padding: 9px 8px !important;
        gap: 10px !important;
        border-radius: 11px !important;
        font-size: 16px !important;
        line-height: 24px !important;
    }

    html #main-app #home-content.home-tight-layout .home-brand-artwork {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 43% !important;
        align-items: center !important;
        min-height: 112px !important;
        margin: 0 0 12px !important;
        border-radius: 14px !important;
        background: #081833 !important;
        color: #ffffff !important;
    }

    html #main-app #home-content.home-tight-layout .home-banner-caption {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        padding: 14px 0 14px 14px !important;
    }

    html #main-app #home-content.home-tight-layout .home-banner-caption strong {
        font-size: 17px;
        line-height: 1.25;
        font-weight: 650;
    }

    html #main-app #home-content.home-tight-layout .home-banner-caption span {
        color: #f5c25d;
        font-size: 13px;
        line-height: 1.35;
    }

    html #main-app #home-content.home-tight-layout .home-brand-artwork img {
        display: block !important;
        width: 100% !important;
        height: 112px !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
        border-radius: 0 !important;
    }

    /* Three complete featured cards immediately below the search panel. */
    html #main-app #home-content.home-tight-layout #home-featured-ads-strip {
        margin: 0 0 12px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ads-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        min-height: 44px !important;
        margin: 0 0 8px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ads-header h2 {
        margin: 0 !important;
        font-size: 17px !important;
        line-height: 1.3 !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ads-carousel {
        display: flex !important;
        align-items: stretch !important;
        gap: 8px !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-padding: 0 !important;
        scroll-snap-type: x mandatory !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-card {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 0 0 calc((100% - 16px) / 3) !important;
        width: calc((100% - 16px) / 3) !important;
        min-width: 0 !important;
        max-width: calc((100% - 16px) / 3) !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        overflow: hidden !important;
        border: 1px solid #dce5f0 !important;
        border-radius: 12px !important;
        background: #ffffff !important;
        box-shadow: none !important;
        transform: none !important;
        scroll-snap-align: start !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-card:is([hidden], [data-featured-country-hidden="1"], .device-location-excluded) {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-card::before,
    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-card::after {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .image-carousel {
        position: relative !important;
        inset: auto !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        height: 96px !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        margin: 0 !important;
        border-radius: 0 !important;
        pointer-events: none;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .carousel-track {
        height: 100% !important;
        transform: none !important;
        overflow: hidden !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .carousel-track img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip :is(.carousel-track img:not(:first-child), .carousel-btn, .mobile-carousel-dots, .featured-ad-tag, .country-featured-source-badge, .country-featured-trust-line, .country-featured-chips, .country-featured-seller-row, .country-featured-actions) {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        align-content: start !important;
        gap: 5px !important;
        min-width: 0 !important;
        padding: 8px 7px !important;
        background: #ffffff !important;
        color: #0f2747 !important;
        text-shadow: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body :is(h3, h4) {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        min-height: 32px !important;
        margin: 0 !important;
        overflow: hidden !important;
        overflow-wrap: anywhere !important;
        color: #0f2747 !important;
        font-size: 12px !important;
        font-weight: 650 !important;
        line-height: 16px !important;
        letter-spacing: normal !important;
        text-shadow: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body p {
        margin: 0 !important;
        color: #526780 !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        line-height: 15px !important;
        overflow-wrap: anywhere !important;
        text-shadow: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body > span {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .country-featured-heading {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 5px !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .country-featured-price {
        min-width: 0 !important;
        justify-items: start !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .country-featured-price strong {
        font-size: 11px !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .country-featured-price small {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip [data-featured-card-nav],
    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-row-nav[hidden] {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout .home-featured-row-nav {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        margin-top: 8px;
        color: #526780;
        font-size: 12px;
        font-variant-numeric: tabular-nums;
    }

    html #main-app #home-content.home-tight-layout .home-featured-row-nav button {
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid #dce5f0;
        border-radius: 10px;
        background: #ffffff;
        color: #285d9a;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
    }

    html #main-app #home-content.home-tight-layout .home-featured-row-nav button:disabled {
        opacity: 0.4;
        cursor: default;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-view-all {
        flex: 0 0 auto !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 2px !important;
        border: 0 !important;
        background: transparent !important;
        color: #285d9a !important;
        font-family: inherit;
        line-height: 1.4;
        font-size: 12px !important;
        font-weight: 600 !important;
        cursor: pointer;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body > :not(.home-featured-detail-copy) {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-detail-copy {
        display: grid;
        align-content: start;
        gap: 6px;
        min-width: 0;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body .home-featured-specs {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        min-height: 30px !important;
        overflow: hidden;
        color: #62758d !important;
        font-size: 11px !important;
        line-height: 15px !important;
        font-weight: 400 !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body .home-featured-price {
        min-height: 40px !important;
        color: #0f2747 !important;
        font-size: 16px !important;
        font-weight: 750 !important;
        line-height: 20px !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body .home-featured-location {
        display: flex !important;
        align-items: flex-start;
        gap: 4px;
        color: #167343 !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        line-height: 15px !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-location :is(i, span) {
        color: inherit !important;
        font-size: inherit !important;
        line-height: inherit !important;
        text-shadow: none !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-location i {
        flex: 0 0 auto;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-save {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        z-index: 8;
        display: grid !important;
        place-items: center;
        width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: #0f2747 !important;
        cursor: pointer;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-save::before {
        content: '';
        position: absolute;
        width: 30px;
        height: 30px;
        background: #ffffff;
        border-radius: 50%;
        box-shadow: 0 1px 4px #0f27471f;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-save i {
        position: relative;
        color: inherit !important;
        font-size: 17px !important;
    }

    html #main-app #home-content.home-tight-layout #home-featured-ads-strip .home-featured-save[aria-pressed="true"] {
        color: #c8384d !important;
    }

    html #main-app #home-content.home-tight-layout .home-featured-announcement {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    html #main-app #home-content.home-tight-layout[data-featured-view="all"] > :not(.home-topbar):not(#home-featured-ads-strip) {
        display: none !important;
    }

    html #main-app #home-content.home-tight-layout[data-featured-view="all"] #home-featured-carousel {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        overflow: visible !important;
        scroll-snap-type: none !important;
        touch-action: pan-y pinch-zoom !important;
    }

    html #main-app #home-content.home-tight-layout[data-featured-view="all"] #home-featured-carousel .featured-ad-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    html #main-app #home-content.home-tight-layout[data-featured-view="all"] #home-featured-carousel .image-carousel {
        height: 150px !important;
    }

    html #main-app #home-content.home-tight-layout[data-featured-view="all"] .home-featured-row-nav {
        display: none !important;
    }

    @media (min-width: 641px) {
        html #main-app #home-content.home-tight-layout[data-featured-view="all"] #home-featured-carousel {
            grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        }

        html #main-app #home-content.home-tight-layout[data-featured-view="all"] #home-featured-carousel .image-carousel {
            height: clamp(140px, 18vw, 220px) !important;
        }

        html #main-app #home-content.home-tight-layout #home-featured-ads-strip .image-carousel {
            height: clamp(140px, 18vw, 220px) !important;
        }

        html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body {
            padding: 12px !important;
        }

        html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body :is(h3, h4) {
            min-height: 40px !important;
            font-size: 16px !important;
            line-height: 20px !important;
        }

        html #main-app #home-content.home-tight-layout #home-featured-ads-strip .featured-ad-body p {
            font-size: 13px !important;
            line-height: 18px !important;
        }

        html #main-app #home-content.home-tight-layout .home-search-row {
            grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) !important;
        }

        html #main-app #home-content.home-tight-layout .home-brand-artwork {
            grid-template-columns: minmax(0, 1fr) minmax(180px, 30%) !important;
        }
    }

    @media (max-width: 380px) {
        html #main-app #home-content.home-tight-layout .home-topbar {
            padding-inline: 9px !important;
            gap: 6px !important;
        }

        html #main-app #home-content.home-tight-layout .home-topbar .brand-word {
            font-size: 20px !important;
        }

        html #main-app #home-content.home-tight-layout .home-topbar-right {
            gap: 6px !important;
        }

        html #main-app #home-content.home-tight-layout .home-banner-caption {
            padding-left: 12px !important;
            padding-right: 5px !important;
        }

        html #main-app #home-content.home-tight-layout .home-banner-caption strong {
            font-size: 15px;
        }

        html #main-app #home-content.home-tight-layout .home-banner-caption span {
            font-size: 12px;
        }
    }

    @media (max-width: 350px) {
        html #main-app #home-content.home-tight-layout .home-topbar .brand-logo {
            width: 56px !important;
            height: 56px !important;
            max-width: 56px !important;
            flex-basis: 56px !important;
        }
    }

}
