/**
 * Antigravity Core — B2B Enterprise Catalog V2 Stylesheet
 * Luxury Digital Atelier Profile Cards & Sourcing Grid
 * Fully isolated namespace: .ag-ent-*
 */

:root {
    --ag-ent-orange: #D76314;
    --ag-ent-orange-hover: #b84e0b;
    --ag-ent-orange-soft: rgba(215, 99, 20, 0.08);
    --ag-ent-orange-border: rgba(215, 99, 20, 0.2);
    --ag-ent-gold: #C59B27;
    --ag-ent-gold-soft: rgba(197, 155, 39, 0.12);
    --ag-ent-gold-border: rgba(197, 155, 39, 0.35);
    --ag-ent-bg: #F4F2EA;
    --ag-ent-card-bg: #ffffff;
    --ag-ent-text: #1a1a1a;
    --ag-ent-text-muted: #6b655f;
    --ag-ent-border: rgba(196, 164, 132, 0.3);
    --ag-ent-font-title: 'Cormorant Garamond', Georgia, serif;
    --ag-ent-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Page Background & Container Safety */
.ag-search-body,
.ag-catalog-archive-wrapper,
.ag-archive-results-content {
    background-color: var(--ag-ent-bg) !important;
}

/* Header Action Button Fix (No Clipping) */
.ag-catalog-hero-section-archive {
    padding-top: 15px !important;
    position: relative !important;
    z-index: 10 !important;
}

.ag-catalog-hero-action-group .ag-btn-brand-v2 {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 28px !important;
    background: var(--ag-brand-orange, #D76314) !important;
    color: #ffffff !important;
    font-family: var(--ag-font-primary, 'Cormorant Garamond'), Georgia, serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(215, 99, 20, 0.25) !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.ag-catalog-hero-action-group .ag-btn-brand-v2:hover {
    background: #c0540d !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(215, 99, 20, 0.35) !important;
}

/* Enterprise Card Container (Brand Block V2) */
.ag-ent-card {
    background: var(--ag-ent-card-bg) !important;
    border: 1px solid var(--ag-ent-border) !important;
    border-radius: 12px !important;
    padding: 28px 32px !important;
    margin-bottom: 24px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    color: var(--ag-ent-text) !important;
}

/* Left Brand Orange Stripe on Hover */
.ag-ent-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 5px !important;
    background: var(--ag-ent-orange) !important;
    opacity: 0 !important;
    transform: scaleY(0.3) !important;
    transform-origin: center !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    border-radius: 12px 0 0 12px !important;
}

.ag-ent-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 40px rgba(215, 99, 20, 0.09), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-color: var(--ag-ent-orange-border) !important;
}

.ag-ent-card:hover::before {
    opacity: 1 !important;
    transform: scaleY(1) !important;
}

/* Card Header: Avatar, Title, Status Badges */
.ag-ent-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.ag-ent-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    min-width: 0;
}

/* Avatar / Cover Image (300x168px, 16:9 ratio, no border, no substrate) */
.ag-ent-avatar-box {
    width: 300px !important;
    height: 168px !important;
    min-width: 300px !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.ag-ent-avatar-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 300px !important;
    max-height: 168px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: none !important;
    display: block !important;
}

.ag-ent-avatar-fallback {
    width: 100%;
    height: 100%;
    background: rgba(215, 99, 20, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-family: var(--ag-ent-font-title);
    font-size: 32px;
    font-weight: 700;
    color: var(--ag-ent-orange);
}

/* Title & Subtitle */
.ag-ent-title-group {
    flex: 1;
    min-width: 0;
}

.ag-ent-title {
    font-family: var(--ag-ent-font-title) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 0 6px 0 !important;
    color: #111111 !important;
}

.ag-ent-title a {
    color: #111111 !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.ag-ent-title a:hover {
    color: var(--ag-ent-orange) !important;
}

.ag-ent-meta-sub {
    font-size: 14px;
    color: var(--ag-ent-text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ag-ent-meta-sub .ag-ent-loc {
    color: #333333;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Badges Row */
.ag-ent-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ag-ent-badge-gold {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--ag-ent-gold-soft);
    color: #8c6d12;
    border: 1px solid var(--ag-ent-gold-border);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
}

.ag-ent-badge-pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ag-ent-orange-soft);
    color: var(--ag-ent-orange);
    border: 1px solid var(--ag-ent-orange-border);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: var(--ag-ent-font-title);
    letter-spacing: 0.02em;
}

.ag-ent-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ag-ent-orange);
    box-shadow: 0 0 0 0 rgba(215, 99, 20, 0.5);
    animation: ag-pulse 2s infinite;
}

@keyframes ag-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(215, 99, 20, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(215, 99, 20, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(215, 99, 20, 0); }
}

/* Tailor Stitch Divider */
.ag-ent-stitch-divider {
    border: none;
    border-top: 1px dashed rgba(215, 99, 20, 0.25);
    margin: 16px 0 20px 0;
}

/* B2B Specs Matrix Grid */
.ag-ent-specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ag-ent-spec-box {
    background: rgba(244, 242, 234, 0.55);
    border: 1px solid rgba(196, 164, 132, 0.25);
    border-radius: 8px;
    padding: 12px 14px;
    box-sizing: border-box;
    transition: background 0.2s ease;
}

.ag-ent-spec-box:hover {
    background: rgba(215, 99, 20, 0.05);
    border-color: var(--ag-ent-orange-border);
}

.ag-ent-spec-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ag-ent-text-muted);
    margin-bottom: 4px;
}

.ag-ent-spec-value {
    font-family: var(--ag-ent-font-title);
    font-size: 17px;
    font-weight: 700;
    color: #111111;
    line-height: 1.2;
}

.ag-ent-spec-highlight {
    color: var(--ag-ent-orange);
}

/* Specialty Tags Row */
.ag-ent-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ag-ent-tag {
    font-size: 12px;
    font-weight: 600;
    color: #444444;
    background: #f4f2ea;
    border: 1px solid rgba(196, 164, 132, 0.35);
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ag-ent-tag:hover {
    background: var(--ag-ent-orange-soft);
    color: var(--ag-ent-orange);
    border-color: var(--ag-ent-orange-border);
}

/* Vitrina / Showcase Gallery */
.ag-ent-gallery {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.ag-ent-gallery-item {
    width: 90px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--ag-ent-border);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ag-ent-gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ag-ent-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card Footer: Balanced Action Buttons */
.ag-ent-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    border-top: 1px solid rgba(196, 164, 132, 0.2);
    padding-top: 18px;
    margin-top: 6px;
}

.ag-ent-btn-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 42px !important;
    padding: 0 20px !important;
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: 1.5px solid rgba(196, 164, 132, 0.5) !important;
    border-radius: 8px !important;
    font-family: var(--ag-ent-font-title) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.ag-ent-btn-secondary:hover {
    background: #f7f6f0 !important;
    border-color: var(--ag-ent-orange) !important;
    color: var(--ag-ent-orange) !important;
}

.ag-ent-btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 42px !important;
    padding: 0 24px !important;
    background: var(--ag-ent-orange) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-family: var(--ag-ent-font-title) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(215, 99, 20, 0.25) !important;
    transition: all 0.2s ease !important;
}

.ag-ent-btn-primary:hover {
    background: var(--ag-ent-orange-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(215, 99, 20, 0.35) !important;
}

/* Responsive Overrides */
@media screen and (max-width: 991.98px) {
    .ag-ent-specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 767.98px) {
    .ag-ent-card {
        padding: 20px 16px !important;
    }
    .ag-ent-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .ag-ent-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        width: 100%;
    }
    .ag-ent-avatar-box {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 300 / 168 !important;
        min-width: 0 !important;
    }
    .ag-ent-avatar-img {
        max-width: 100% !important;
        max-height: 100% !important;
    }
    .ag-ent-title {
        font-size: 22px !important;
    }
    .ag-ent-specs-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .ag-ent-footer {
        flex-direction: column;
        width: 100%;
    }
    .ag-ent-btn-secondary,
    .ag-ent-btn-primary {
        width: 100% !important;
        height: 46px !important;
    }
}
