/* ==========================================================================
   AutomotoPrime — /annonces vehicle catalogue (resources/views/automoto/annonces.blade.php)
   Loaded after feed.css (layout, filter box, carVertical banners, side / sponsored boxes come from there).
   Every rule is scoped to .amp-cat-page: nothing here reaches the Feed or any other page.
   ========================================================================== */

/* ---------- catalogue head: title, count, sort ---------- */

.amp-cat-page .amp-cat-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
}

.amp-cat-page .amp-cat-heading {
    margin: 0;
    color: #011e40;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.amp-cat-page .amp-cat-count {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 14px;
}

.amp-cat-page .amp-cat-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
}

.amp-cat-page .amp-cat-sort select {
    height: 40px;
    min-width: 190px;
    padding: 0 34px 0 12px;
    border: 1px solid #e3e9f1;
    border-radius: 10px;
    background-color: #fff;
    color: #011e40;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.amp-cat-page .amp-cat-sort select:hover {
    border-color: #cbd5e1;
}

.amp-cat-page .amp-cat-sort select:focus {
    outline: none;
    border-color: #ee5721;
    box-shadow: 0 0 0 3px rgba(238, 87, 33, .14);
}

/* ---------- carVertical: horizontal banner everywhere, sidebar banner from 1024px only ---------- */

.amp-cat-page .amp-cat-cv-side {
    display: none;
}

@media (min-width: 1024px) {
    .amp-cat-page .amp-cat-cv-side {
        display: block;
    }
}

/* ---------- sponsored "home_top" band (partials/top-sponsored-cars) ---------- */

/* phones: 2 slides + nav (feed.css .amp-side-slide); from 768px: the 4 slides side by side */
@media (min-width: 768px) {
    .amp-cat-page .amp-cat-sponsor-top .amp-side-slide {
        width: 25%;
    }

    .amp-cat-page .amp-cat-sponsor-top .amp-side-nav {
        display: none;
    }
}

/* ---------- grid: 1 column, 2 as soon as a card keeps ~290px ---------- */

.amp-cat-page .amp-cat-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 600px) {
    .amp-cat-page .amp-cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1440px) {
    .amp-cat-page .amp-cat-grid {
        gap: 20px;
    }
}

/* ---------- card ---------- */

.amp-cat-page .amp-cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e3e9f1;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(1, 30, 64, .04), 0 2px 8px rgba(1, 30, 64, .04);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.amp-cat-page .amp-cat-card:hover {
    border-color: #d5dee9;
    box-shadow: 0 10px 24px rgba(1, 30, 64, .10);
    transform: translateY(-2px);
}

.amp-cat-page .amp-cat-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #eef2f7;
}

.amp-cat-page .amp-cat-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.amp-cat-page .amp-cat-card:hover .amp-cat-media img:not(.is-placeholder) {
    transform: scale(1.03);
}

.amp-cat-page .amp-cat-media img.is-placeholder {
    object-fit: contain;
    padding: 16%;
}

.amp-cat-page .amp-cat-photos {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(1, 30, 64, .72);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.amp-cat-page .amp-cat-photos ion-icon {
    font-size: 14px;
}

/* above the stretched link: liking never opens the listing */
.amp-cat-page .amp-cat-like {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 12px rgba(1, 30, 64, .16);
    color: #011e40;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}

.amp-cat-page .amp-cat-like:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(1, 30, 64, .22);
}

.amp-cat-page .amp-cat-like:focus-visible {
    outline: 2px solid #ee5721;
    outline-offset: 2px;
}

.amp-cat-page .amp-cat-like ion-icon {
    font-size: 17px;
    color: #e11d48;
}

.amp-cat-page .amp-cat-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 14px;
}

.amp-cat-page .amp-cat-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.amp-cat-page .amp-cat-price strong {
    color: #011e40;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.amp-cat-page .amp-cat-price strong.is-muted {
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
}

.amp-cat-page .amp-cat-price-tag {
    color: #059669;
    font-size: 12px;
    font-weight: 600;
}

.amp-cat-page .amp-cat-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.amp-cat-page .amp-cat-link {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #0f172a;
    text-decoration: none;
    overflow-wrap: anywhere;
}

/* stretched link: the whole card opens the listing */
.amp-cat-page .amp-cat-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 16px;
}

.amp-cat-page .amp-cat-card:hover .amp-cat-link {
    color: #ee5721;
}

.amp-cat-page .amp-cat-link:focus-visible {
    outline: none;
}

.amp-cat-page .amp-cat-link:focus-visible::after {
    outline: 2px solid #ee5721;
    outline-offset: -2px;
}

.amp-cat-page .amp-cat-specs {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.amp-cat-page .amp-cat-specs li + li::before {
    content: "·";
    margin: 0 6px;
    color: #94a3b8;
}

.amp-cat-page .amp-cat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eef2f7;
    color: #64748b;
    font-size: 12.5px;
}

.amp-cat-page .amp-cat-city {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.amp-cat-page .amp-cat-city span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.amp-cat-page .amp-cat-city ion-icon {
    flex-shrink: 0;
    color: #ee5721;
    font-size: 15px;
}

.amp-cat-page .amp-cat-meta time {
    flex-shrink: 0;
}

/* ---------- empty state ---------- */

.amp-cat-page .amp-cat-reset {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    padding: 9px 16px;
    border-radius: 10px;
    background: #011e40;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.amp-cat-page .amp-cat-reset:hover {
    background: #022c5a;
}

@media (max-width: 599px) {
    .amp-cat-page .amp-cat-heading {
        font-size: 20px;
    }

    .amp-cat-page .amp-cat-sort {
        width: 100%;
    }

    .amp-cat-page .amp-cat-sort select {
        flex: 1;
        min-width: 0;
        height: 44px;
        font-size: 16px; /* avoids iOS zoom on focus */
    }

    .amp-cat-page .amp-cat-price strong {
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .amp-cat-page .amp-cat-card,
    .amp-cat-page .amp-cat-media img {
        transition: none;
    }

    .amp-cat-page .amp-cat-card:hover,
    .amp-cat-page .amp-cat-card:hover .amp-cat-media img:not(.is-placeholder) {
        transform: none;
    }
}
