/*
 * Products & services listing — official logos, compact typography, clean grid
 */

/* ── Grid layout ── */
body:not(.admin-body) .amz-product-grid,
body:not(.admin-body) .amz-product-grid.premium-product-grid,
body:not(.admin-body) .global-marketplace .amz-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)) !important;
    gap: 12px !important;
}

body:not(.admin-body) .amz-home-market.global-marketplace {
    margin-top: 18px;
    padding: 16px 18px 20px !important;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

body:not(.admin-body) .amz-home-market .section-title-row h2 {
    font-size: clamp(18px, 1.8vw, 22px) !important;
    line-height: 1.2 !important;
}

body:not(.admin-body) .amz-home-market .section-title-row p {
    font-size: 11px !important;
}

body:not(.admin-body) .amz-home-market .section-title-row span {
    font-size: 12px !important;
    line-height: 1.45 !important;
    color: #64748b !important;
}

/* ── Toolbar typography ── */
body:not(.admin-body) .amz-toolbar__copy h1 {
    font-size: clamp(17px, 1.6vw, 21px) !important;
}

body:not(.admin-body) .amz-toolbar__copy p {
    font-size: 12px !important;
}

/* ── Product card — HD photo mode ── */
body:not(.admin-body) .amz-product-card--photo .amz-product-visual--photo {
    aspect-ratio: 4 / 3 !important;
    max-height: 132px !important;
    padding: 0 !important;
    border: 1px solid #e8ecec !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    overflow: hidden !important;
}

body:not(.admin-body) .amz-product-card--photo .amz-product-photo {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    padding: 0 !important;
    transform: none !important;
}

body:not(.admin-body) .amz-product-card--photo:hover .amz-product-photo {
    transform: scale(1.03) !important;
    transition: transform 200ms ease;
}

/* ── Product card — logo mode (fallback) ── */
body:not(.admin-body) .amz-product-card--logo {
    padding: 8px 10px 10px !important;
}

body:not(.admin-body) .amz-product-visual--logo {
    aspect-ratio: 4 / 3 !important;
    max-height: 118px !important;
    margin-bottom: 8px !important;
    border: 1px solid #e8ecec !important;
    border-radius: 8px !important;
    background: #fff !important;
}

body:not(.admin-body) .amz-product-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 8px 10px;
}

body:not(.admin-body) .amz-product-logo-frame img,
body:not(.admin-body) .amz-product-visual--logo .service-logo--official {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 72px !important;
    object-fit: contain !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* PNG official logos (GST, Income Tax, EPFO) */
body:not(.admin-body) .amz-product-visual--logo img[src*="official/"][src$=".png"] {
    max-height: 68px !important;
}

/* ── Compact typography ── */
body:not(.admin-body) .amz-product-card--logo .amz-product-title {
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    min-height: 0 !important;
    -webkit-line-clamp: 2;
}

body:not(.admin-body) .amz-product-card--logo .amz-price {
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    word-break: break-word;
}

body:not(.admin-body) .amz-product-card--logo .amz-rating-row {
    font-size: 10px !important;
}

body:not(.admin-body) .amz-product-card--logo .amz-stars {
    width: 52px !important;
    height: 10px !important;
}

body:not(.admin-body) .amz-product-card--logo .amz-review-count {
    font-size: 10px !important;
}

body:not(.admin-body) .amz-product-card--logo .amz-add-btn {
    min-height: 26px !important;
    font-size: 11px !important;
}

body:not(.admin-body) .amz-product-card--logo .amz-secondary-actions button,
body:not(.admin-body) .amz-product-card--logo .amz-secondary-actions a {
    font-size: 10px !important;
}

body:not(.admin-body) .amz-product-card--logo .amz-category-chip {
    font-size: 9px !important;
    padding: 2px 7px !important;
}

body:not(.admin-body) .amz-product-card--logo .amz-product-badge {
    font-size: 9px !important;
    padding: 2px 5px !important;
}

@media (min-width: 1200px) {
    body:not(.admin-body) .amz-product-grid.premium-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    body:not(.admin-body) .amz-product-grid,
    body:not(.admin-body) .amz-product-grid.premium-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    body:not(.admin-body) .amz-product-visual--logo {
        max-height: 100px !important;
    }

    body:not(.admin-body) .amz-product-logo-frame img {
        max-height: 60px !important;
    }
}
