/* Páginas de stands. As públicas (/criar-stand, /stands, /stand/{slug}) seguem as landings
   (vehicle-seo-landing.css, botões em pílula em autoexpo.css); a área de gestão segue
   /meus-destaques (promotion-* em car-cards.css). Aqui fica só o que é próprio dos stands. */

/* Logótipo (ou ícone quando o stand não tem) */
.stand-logo {
    display: inline-flex;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--ae-primary-soft);
    color: var(--ae-primary);
    font-size: 1.5rem;
}

img.stand-logo {
    padding: 4px;
    border: 1px solid #e3e9ee;
    background: #fff;
    object-fit: contain;
}

.stand-logo--lg {
    width: 112px;
    height: 112px;
    margin-bottom: 1.25rem;
    font-size: 2.6rem;
    box-shadow: 0 6px 20px rgba(26, 37, 47, 0.08);
}

/* Pesquisa do diretório: campo e botão numa só pílula */
.stand-search {
    display: flex;
    gap: 0.5rem;
    max-width: 620px;
    margin: 0 auto;
    padding: 6px;
    border: 1px solid #dfe6ec;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(26, 37, 47, 0.08);
}

.stand-search:focus-within {
    border-color: var(--ae-accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.stand-search .form-control {
    flex: 1;
    min-width: 0;
    height: auto;
    padding-left: 1rem;
    border: none;
    background: transparent;
    box-shadow: none;
}

.stand-search .btn {
    flex-shrink: 0;
}

/* Cartões do diretório */
.stand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stand-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid #e3e9ee;
    border-radius: var(--ae-radius);
    background: #fff;
    color: inherit;
    box-shadow: 0 3px 14px rgba(26, 37, 47, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stand-card:hover,
.stand-card:focus-visible {
    border-color: var(--ae-accent);
    box-shadow: 0 6px 18px rgba(26, 37, 47, 0.1);
    color: inherit;
    text-decoration: none;
}

/* Item flex com min-width:auto não encolhe abaixo da palavra mais longa: um nome sem espaços
   saía do cartão (e do ecrã, em telemóvel). */
.stand-grid > li,
.stand-card-text {
    min-width: 0;
}

.stand-card-text {
    overflow-wrap: anywhere;
}

.stand-card-name {
    display: block;
    color: var(--ae-primary-dark);
    font-size: 1.05rem;
    font-weight: 700;
}

.stand-card-place {
    display: block;
    color: #5d6973;
    font-size: 0.92rem;
}

.stand-pager {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Perfil público. O hero tem overflow:hidden (vehicle-seo-landing.css): nome, morada e
   contactos têm de quebrar linha, senão um email comprido fica cortado em telemóvel. */
.stand-hero h1,
.stand-address {
    overflow-wrap: anywhere;
}

.stand-contacts .btn {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.stand-address {
    margin: 0 auto 1.5rem;
    color: #465563;
    font-style: normal;
    line-height: 1.6;
}

.stand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.stand-card-title {
    margin-bottom: 0.75rem;
    color: var(--ae-primary-dark);
    font-size: 1.15rem;
    font-weight: 700;
}

.stand-prewrap {
    white-space: pre-line;
}

.stand-tabs {
    margin-right: auto;
    margin-left: auto;
    max-width: 420px;
}

.stand-empty {
    max-width: 620px;
    margin: 0 auto;
}

/* Área de gestão */
.stand-panel {
    margin-bottom: 1.5rem;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid #e6e9ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(35, 45, 65, 0.05);
}

.stand-name,
.stand-panel-title {
    color: var(--ae-primary-dark);
    font-weight: 700;
}

.stand-name {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    overflow-wrap: anywhere;
}

.stand-panel-title {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* Vários stands: o controlo segmentado de /meus-destaques, mas a quebrar linha */
.stand-switch {
    flex-wrap: wrap;
    max-width: none;
    border-radius: 22px;
}

.stand-switch .nav-item {
    flex: 0 1 auto;
}

.stand-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.stand-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stand-actions form {
    margin: 0;
}

.stand-rows {
    margin-bottom: 1rem;
}

.stand-rows .list-group-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 12px 16px;
}

.stand-rows .list-group-item:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.stand-rows .list-group-item:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.stand-rows .list-group-item > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.stand-rows .custom-control-label {
    cursor: pointer;
}

.stand-history {
    margin: 0;
    padding: 0;
    color: #5d6973;
    font-size: 0.9rem;
    list-style: none;
}

.stand-history li + li {
    margin-top: 0.35rem;
}

/* Gestão do stand: cada secção mostra as primeiras entradas e leva à página da secção */
.stand-more {
    margin-top: 1rem;
}

.stand-sync-note {
    margin-top: -0.5rem;
}

.stand-back {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stand-section-head h1 {
    font-size: 1.75rem;
}

.stand-form .form-group > label {
    font-weight: 600;
}

/* Partilha do perfil (WhatsApp, Facebook, copiar ligação) */
.stand-share {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.stand-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 44px;
    height: 44px;
    padding: 0 0.9rem;
    border: 1px solid #dfe6ec;
    border-radius: 999px;
    background: #fff;
    color: var(--ae-primary);
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
}

.stand-share-btn:hover,
.stand-share-btn:focus {
    border-color: var(--ae-accent);
    color: var(--ae-primary-dark);
    text-decoration: none;
}

.stand-share-btn.is-copied {
    border-color: #2e7d32;
    color: #2e7d32;
}

.stand-share-field {
    max-width: 640px;
}

.stand-share-field .form-control[readonly] {
    background: #fff;
}

/* O .btn do site (autoexpo.css) impõe padding e cantos com !important: o campo acompanha a altura do
   botão e os dois só arredondam do lado de fora. */
.stand-share-field > .form-control {
    height: auto;
    border-radius: 8px 0 0 8px;
}

.stand-share-field > .input-group-append > .btn {
    border-radius: 0 8px 8px 0 !important;
    white-space: nowrap;
}

/* Desempenho do stock na gestão */
.stand-metric-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.stand-metric-tiles > div {
    padding: 0.85rem 1rem;
    border: 1px solid #e3e9ee;
    border-radius: 12px;
    background: #f8fafc;
}

.stand-metric-tiles dt {
    color: #5d6973;
    font-size: 0.85rem;
    font-weight: 500;
}

.stand-metric-tiles dd {
    margin: 0.15rem 0 0;
    color: var(--ae-primary-dark);
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stand-metric-table th[scope="row"] {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.stand-metric-table td {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .stand-search {
        flex-direction: column;
        border-radius: 16px;
    }

    .stand-search .form-control {
        padding: 0.6rem 0.75rem;
    }

    .stand-rows .list-group-item {
        align-items: flex-start;
        flex-direction: column;
    }
}
