/* Global responsive rules for Titans Pet (layout-safe, no branding changes) */

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video,
svg,
canvas {
    max-width: 100%;
    height: auto;
}

html,
body {
    overflow-x: hidden;
}

a,
button,
.btn,
input[type="button"],
input[type="submit"] {
    min-height: 44px;
}

/* HERO */
.banner-part {
    background-size: cover !important;
    background-position: center center !important;
}

.banner-part h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
    line-height: 1.2 !important;
}

/* Search panel wrapper in hero */
.banner-content #search-form {
    width: min(100%, 570px) !important;
    max-width: 100% !important;
}

/* Feature cards and common card grids */
.feature-part .row,
.category-part .row,
.city-part .row {
    row-gap: 16px;
}

/* Featured agencies / featured advertiser keeps horizontal scroll */
.featured-ads-slider,
.featured-advertiser-carousel .featured-ads-slider {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.featured-ad-card {
    flex: 0 0 200px;
    min-width: 200px;
    scroll-snap-align: start;
}

/* Browse New Pets cards */
.product-card {
    width: 100%;
}

/* Top cities cards */
.city-part .row {
    display: flex;
    flex-wrap: wrap;
}

.city-card {
    width: 100%;
}

/* Pricing cards */
.price-card {
    height: 100%;
}

/* Categories section */
.subcategory-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.subcategory-card-item {
    width: 100%;
}

/* CTA buttons inside listings/forms */
.product-card .whatsapp-btn,
.product-card .btn-whatsapp,
.product-card .btn-success {
    width: 100%;
}

/* Footer mobile refinements */
.titans-footer-payment,
.titans-footer-social {
    flex-wrap: wrap;
}

/* Desktop >1024 */
@media (min-width: 1025px) {
    .feature-part .col-lg-4,
    .feature-part .col-md-4 {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }

    .city-part .col-lg-3,
    .city-part .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }

    .price-part .col-lg-4,
    .price-part .col-md-4,
    .price-card {
        max-width: 100%;
    }
}

/* Tablet 768-1024 */
@media (min-width: 768px) and (max-width: 1024px) {
    .banner-part {
        min-height: 360px;
    }

    .banner-part .container {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    .banner-arrow {
        display: none !important;
    }

    .banner-content #search-form {
        margin: 20px auto 0;
        height: auto !important;
        min-height: 420px;
    }

    /* feature cards 2 columns */
    .feature-part .col-lg-4,
    .feature-part .col-md-6,
    .feature-part .col-md-4,
    .price-part .col-lg-4,
    .price-part .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* New pets 2 per row */
    .latest-part .col-xl-3,
    .latest-part .col-lg-3,
    .latest-part .col-md-4,
    .latest-part .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* top cities 2 columns */
    .city-part .col-lg-3,
    .city-part .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* footer 2 columns */
    .titans-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Mobile <768 */
@media (max-width: 767.98px) {
    .banner-part {
        min-height: 300px;
    }

    .banner-part .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .banner-arrow {
        display: none !important;
    }

    .banner-part h1 {
        margin: 12px 0 !important;
    }

    .banner-content #search-form {
        width: 100% !important;
        height: auto !important;
        min-height: 380px;
        border-radius: 20px !important;
    }

    /* Keep section cards stacked */
    .feature-part [class*="col-"],
    .latest-part [class*="col-"],
    .category-part [class*="col-"],
    .price-part [class*="col-"],
    .city-part [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* city tabs/filter horizontal scroll if present */
    .nav.nav-tabs,
    .latest-part .nav,
    .product-filter-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .nav.nav-tabs .nav-item,
    .latest-part .nav .nav-item,
    .product-filter-tabs .nav-item {
        display: inline-flex;
        float: none;
    }

    .subcategory-cards-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Top cities as horizontal touch carousel */
    .city-part .row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
    }

    .city-part .row > [class*="col-"] {
        flex: 0 0 82%;
        max-width: 82%;
    }

    /* CTA/banner internals stack */
    .home-cta-banner,
    .pet-cta-banner,
    .vet-cta-banner {
        display: flex;
        flex-direction: column;
    }

    .home-cta-banner .btn,
    .pet-cta-banner .btn,
    .vet-cta-banner .btn {
        width: 100%;
    }

    /* Footer 1 column centered */
    .titans-footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .titans-footer-address {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .titans-footer-address li {
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    .titans-footer-address li span,
    .titans-footer-address li a {
        text-align: center;
    }

    .titans-footer-brand,
    .titans-footer-copy {
        text-align: center !important;
    }

    .titans-footer-stats,
    .titans-footer-lang,
    .titans-footer-payment,
    .titans-footer-social,
    .titans-footer-bottom-row {
        justify-content: center !important;
    }

    .titans-footer-app {
        width: 100%;
        justify-content: center;
    }

    /* Hide heavy footer on small screens (use bottom mobile bar instead) */
    .titans-footer {
        display: none !important;
    }

    /* Safety: if footer is enabled later, prevent newsletter overflow on 320px */
    .titans-footer-newsletter,
    .titans-footer-news-form {
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    .titans-footer-news-form {
        display: flex !important;
        flex-direction: column !important;
        flex: 0 0 auto !important;
        min-height: 0 !important;
        border-radius: 12px !important;
    }
    .titans-footer-news-form input,
    .titans-footer-news-btn {
        width: 100% !important;
        min-height: 44px;
    }
}
