/* ==========================================================================
   AutoStyle — Homepage à medida = CÓPIA FIEL do site antigo (autostyle.pt).
   Referência: sync/mockups-autostyle-website/website-index-1..4.
   Só carrega no front page. O header do tema é mantido (carrinho/conta).
   ========================================================================== */

.autostyle-home {
    --as-red: #e52521;
    --as-red-dark: #c11e1a;
    --as-black: #0e0e10;
    --as-ink: #1c1c20;
    --as-grey: #333338;   /* fundo das grelhas de produtos/viaturas */
    --as-grey2: #4d4d53;  /* sub-rodapé */
    --as-muted: #b8b9be;
    --as-line: #26262b;
    --as-container: 1200px;
}

/* Evita scroll horizontal do 100vw (largura inclui a scrollbar). Só na home. */
body.autostyle-home { overflow-x: hidden; }

/* Full-bleed: o template vive dentro do wrapper do tema; forçamos largura
   total para as faixas ocuparem o ecrã, com container interno centrado. */
.autostyle-home .as-home {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    background: var(--as-black);
    color: #fff;
    overflow-x: hidden;
    font-family: inherit;
}
.autostyle-home .as-container {
    width: 100%;
    max-width: var(--as-container);
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* ─── Botões ─────────────────────────────────────────────────────────── */
.autostyle-home .as-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 14px;
    padding: 15px 40px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.autostyle-home .as-btn-ghost {
    background: transparent;
    color: #fff;
    border: 2px solid var(--as-red);
}
.autostyle-home .as-btn-ghost:hover { background: var(--as-red); color: #fff; }

/* ─── HERO ───────────────────────────────────────────────────────────── */
.autostyle-home .as-hero {
    position: relative;
    background-color: #000;
    background-size: cover;
    background-position: center right;
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 90px 24px 150px;
}
.autostyle-home .as-hero-inner { max-width: 760px; }
.autostyle-home .as-hero-title {
    font-size: clamp(30px, 4.4vw, 50px);
    line-height: 1.1;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 14px;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,.6);
}
.autostyle-home .as-hero-sub {
    font-size: clamp(16px, 2vw, 20px);
    margin: 0 0 30px;
    color: #f0f0f2;
}
.autostyle-home .as-hero .as-btn-ghost { margin-bottom: 6px; }

/* Barra de filtros — pinada em baixo do hero */
.autostyle-home .as-filter {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 78px;
    width: 100%;
    max-width: 1200px;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.autostyle-home .as-filter-field { flex: 1; min-width: 0; position: relative; }
.autostyle-home .as-select {
    width: 100%;
    height: 54px;
    background: rgba(10,10,12,.72);
    color: #fff;
    border: 1px solid var(--as-red);
    padding: 0 40px 0 18px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23e52521' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}
.autostyle-home .as-select:disabled { opacity: .55; cursor: not-allowed; }
.autostyle-home .as-select option { background: #17171a; color: #fff; text-transform: none; }
.autostyle-home .as-filter-submit {
    flex: 0 0 auto;
    min-width: 190px;
    height: 54px;
    background: var(--as-red);
    color: #fff;
    border: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    transition: background .15s ease;
}
.autostyle-home .as-filter-submit:hover { background: var(--as-red-dark); }

.autostyle-home .as-hero-scroll {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    color: var(--as-red);
    line-height: 0;
    animation: as-bounce 1.8s infinite;
}
@keyframes as-bounce { 0%,100%{ transform: translateX(-50%) translateY(0);} 50%{ transform: translateX(-50%) translateY(6px);} }

/* ─── FAIXAS VERMELHAS DE SECÇÃO ─────────────────────────────────────── */
.autostyle-home .as-band { background: var(--as-red); }
.autostyle-home .as-band-inner {
    max-width: var(--as-container);
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 400;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.autostyle-home .as-band-inner b { font-weight: 800; font-family: Georgia, "Times New Roman", serif; }
.autostyle-home .as-band-dot { width: 9px; height: 9px; background: #fff; display: inline-block; }

/* ─── GRELHAS DE PRODUTOS / VIATURAS ─────────────────────────────────── */
.autostyle-home .as-grid-section { background: var(--as-grey); padding: 50px 0 58px; }
.autostyle-home .as-grid-vehicles { background: var(--as-grey); }

.autostyle-home .as-live .tp-recent-parts,
.autostyle-home .as-live .tp-recent-vehicles,
.autostyle-home .as-live > ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Card (restyle dos cards TP p/ o estilo do site antigo) */
.autostyle-home .as-live .tp-rp-card,
.autostyle-home .as-live .tp-rv-card {
    display: flex;
    flex-direction: column;
    background: #1a1a1d;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
    transition: transform .14s ease, box-shadow .14s ease;
}
.autostyle-home .as-live .tp-rp-card:hover,
.autostyle-home .as-live .tp-rv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(0,0,0,.42);
}
/* Imagem: placeholder VERMELHO (no-photo.svg) por baixo; a foto real (inline
   background-image) tapa-o quando existe. */
.autostyle-home .as-live .tp-rp-img,
.autostyle-home .as-live .tp-rv-img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--as-red);
    background-image: url("img/no-photo.svg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
/* Viaturas sem foto: o shortcode injeta fundo cinza inline → o JS marca
   .as-noimg e forçamos o placeholder vermelho (vence o inline). */
.autostyle-home .as-live .tp-rv-img.as-noimg,
.autostyle-home .as-live .tp-rp-img.as-noimg {
    background-color: var(--as-red) !important;
    background-image: url("img/no-photo.svg") !important;
    background-size: cover !important;
}
.autostyle-home .as-live .tp-rp-img img,
.autostyle-home .as-live .tp-rv-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Card de viatura (shortcode) vem com estilos inline claros → forçamos o
   card escuro do site antigo. */
.autostyle-home .as-live .tp-rv-card {
    background: #1a1a1d !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #fff !important;
}
.autostyle-home .as-live .tp-rp-body,
.autostyle-home .as-live .tp-rv-body {
    background: linear-gradient(180deg, #17171a 0%, #101012 100%) !important;
    padding: 12px 40px 12px 14px !important;
    position: relative;
    min-height: 54px;
}
.autostyle-home .as-live .tp-rp-name,
.autostyle-home .as-live .tp-rv-title {
    color: var(--as-red) !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Referência principal no título — menos destaque */
.autostyle-home .as-live .tp-rp-ref {
    font-weight: 500;
    font-size: 11px;
    color: #f0908c;
    letter-spacing: .02em;
}
/* Subtítulo MARCA MODELO - ANO por baixo do nome da peça */
.autostyle-home .as-live .tp-rp-vehicle {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #c4c4c9;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.autostyle-home .as-live .tp-rp-price,
.autostyle-home .as-live .tp-rv-year {
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
}
.autostyle-home .as-live .tp-rp-price .woocommerce-Price-amount { color: #fff; font-weight: 700; }
.autostyle-home .as-live .tp-rp-price::after { content: " + IVA"; font-weight: 400; font-size: 11px; color: #c9c9cd; }
/* chevron vermelho no canto do card */
.autostyle-home .as-live .tp-rp-body::after,
.autostyle-home .as-live .tp-rv-body::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 9px; height: 9px;
    border-right: 2px solid var(--as-red);
    border-top: 2px solid var(--as-red);
    transform: translateY(-50%) rotate(45deg);
}

/* ─── BANNER CTA (rodapé antigo) ─────────────────────────────────────── */
.autostyle-home .as-cta {
    background-color: #140404;
    background-size: cover;
    background-position: center;
    padding: 80px 0;
}
.autostyle-home .as-cta-inner { max-width: 620px; }
.autostyle-home .as-cta-title {
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.1;
    margin: 0 0 12px;
    color: #fff;
}
.autostyle-home .as-cta-sub { font-size: 18px; margin: 0 0 26px; color: #f0f0f2; }

/* ─── RODAPÉ ANTIGO ──────────────────────────────────────────────────── */
.autostyle-home .as-footer { background: var(--as-grey); color: #fff; }
.autostyle-home .as-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.1fr;
    gap: 48px;
    padding: 56px 24px;
}
/* Horários */
.autostyle-home .as-hours-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 15px; }
.autostyle-home .as-hours-day { color: var(--as-red); font-weight: 700; }
.autostyle-home .as-hours-val { color: #e8e8ea; }
/* Contactos */
.autostyle-home .as-contact-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.autostyle-home .as-contact-ic {
    flex: 0 0 auto;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--as-red);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.autostyle-home .as-contact-txt { font-size: 15px; line-height: 1.5; color: #fff; font-weight: 700; padding-top: 3px; }
.autostyle-home .as-contact-txt a { color: #fff; text-decoration: none; }
.autostyle-home .as-contact-txt a:hover { color: var(--as-red); }
.autostyle-home .as-contact-txt small { display: block; font-weight: 400; font-size: 12px; color: var(--as-muted); }
/* Newsletter */
.autostyle-home .as-news-title { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; text-transform: uppercase; margin: 0 0 4px; color: #fff; }
.autostyle-home .as-news-lead { font-family: Georgia, serif; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: #fff; margin: 0 0 20px; }
.autostyle-home .as-news-lead span { color: var(--as-red); }
.autostyle-home .as-news-form { max-width: 500px; }
/* Suporta a form própria e a do Mailchimp (mc4wp mete os campos dentro de
   .mc4wp-form-fields, por isso é aí que aplicamos o flex). Input + botão
   ficam num "pill" arredondado, mais alto e mais enquadrado. */
.autostyle-home .as-news-form,
.autostyle-home .as-news-form .mc4wp-form,
.autostyle-home .as-news-form .mc4wp-form-fields { width: 100%; }
.autostyle-home .as-news-form form,
.autostyle-home .as-news-form .mc4wp-form-fields {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.autostyle-home .as-news-form input[type="email"],
.autostyle-home .as-news-form input[type="text"] {
    flex: 1 1 auto; min-width: 0;
    height: 58px; border: 1px solid #7a7a82; border-radius: 10px;
    background: #6a6a70; color: #fff;
    padding: 0 20px; font-size: 16px;
    box-sizing: border-box;
    transition: border-color .15s ease, background .15s ease;
}
.autostyle-home .as-news-form input[type="email"]:focus,
.autostyle-home .as-news-form input[type="text"]:focus {
    outline: none; border-color: var(--as-red); background: #74747c;
}
.autostyle-home .as-news-form input::placeholder { color: #d8d8dc; opacity: 1; }
.autostyle-home .as-news-form button,
.autostyle-home .as-news-form input[type="submit"] {
    flex: 0 0 auto;
    min-width: 130px; height: 58px;
    background: var(--as-red) !important; color: #fff !important;
    border: 0 !important; border-radius: 10px !important;
    cursor: pointer;
    font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    padding: 0 26px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 6px 16px rgba(229,37,33,.28) !important;
    -webkit-appearance: none; appearance: none;
    transition: background .15s ease, transform .12s ease;
}
.autostyle-home .as-news-form button:hover,
.autostyle-home .as-news-form input[type="submit"]:hover { background: var(--as-red-dark) !important; transform: translateY(-1px); }
.autostyle-home .as-news-form button svg { width: 18px; height: 18px; }
/* mensagens do mc4wp (sucesso/erro) legíveis no fundo escuro */
.autostyle-home .as-news-form .mc4wp-response { color: #fff; font-size: 13px; margin-top: 8px; }
.autostyle-home .as-news-form label { color: #d8d8dc; font-size: 13px; }
/* Texto de consentimento por baixo do formulário */
.autostyle-home .as-news-consent {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: #a6a6ac;
    max-width: 500px;
}
.autostyle-home .as-news-consent a { color: #d7d7db; text-decoration: underline; text-underline-offset: 2px; }
.autostyle-home .as-news-consent a:hover { color: var(--as-red); }

/* Sub-rodapé */
.autostyle-home .as-subfooter { background: var(--as-grey2); }
.autostyle-home .as-subfooter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 36px;
    padding: 40px 24px;
    align-items: start;
}
.autostyle-home .as-sf-col h4 { font-size: 18px; font-weight: 700; color: #d7d7db; margin: 0 0 16px; }
.autostyle-home .as-sf-col ul { list-style: none; margin: 0; padding: 0; }
.autostyle-home .as-sf-col li { margin-bottom: 9px; }
.autostyle-home .as-sf-col a { color: #efeff1; text-decoration: none; font-size: 14px; }
.autostyle-home .as-sf-col a:hover { color: var(--as-red); }
.autostyle-home .as-sf-badge { display: flex; align-items: center; gap: 12px; }
.autostyle-home .as-cc-logo {
    width: 58px; height: 58px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--as-red); color: #fff; font-weight: 800; font-size: 20px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.autostyle-home .as-cc-txt { font-size: 12px; line-height: 1.4; color: #d7d7db; }
.autostyle-home .as-cc-txt b { display: inline-block; margin-top: 4px; background: #111; color: #fff; padding: 2px 8px; font-size: 11px; }

/* ─── Barra de copyright (após o footer — obrigatória, padrão gerido) ──── */
.autostyle-home .as-copybar { background: #0e0e10; border-top: 1px solid #26262b; }
.autostyle-home .as-copybar-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 16px 24px; flex-wrap: wrap;
}
.autostyle-home .as-copybar p { margin: 0; font-size: 13px; color: #9a9aa2; }
.autostyle-home .as-copybar-right a { color: #c4c4c9; text-decoration: none; font-weight: 700; }
.autostyle-home .as-copybar-right a:hover { color: var(--as-red); }
@media (max-width: 640px) {
    .autostyle-home .as-copybar-inner { justify-content: center; text-align: center; }
}

/* Esconde o rodapé genérico do tema (usamos o rodapé antigo acima). O
   get_footer() continua a correr (wp_footer/scripts), só ocultamos o visual. */
/* Esconde o rodapé do tema em TODO o site — usamos o rodapé costumizado
   (.as-site-footer) injetado via wp_footer em todas as páginas. */
.site-footer,
footer.site-footer,
.site-footer-inner { display: none !important; }

/* ─── RESPONSIVO ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .autostyle-home .as-live .tp-recent-parts,
    .autostyle-home .as-live .tp-recent-vehicles,
    .autostyle-home .as-live > ul.products { grid-template-columns: repeat(3, 1fr); }
    .autostyle-home .as-footer-grid { grid-template-columns: 1fr 1fr; }
    .autostyle-home .as-subfooter-grid { grid-template-columns: 1fr 1fr; }
    .autostyle-home .as-filter { position: static; transform: none; margin: 26px auto 0; flex-wrap: wrap; }
    .autostyle-home .as-hero { padding-bottom: 40px; }
    .autostyle-home .as-hero-scroll { display: none; }
}
@media (max-width: 760px) {
    .autostyle-home .as-live .tp-recent-parts,
    .autostyle-home .as-live .tp-recent-vehicles,
    .autostyle-home .as-live > ul.products { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .autostyle-home .as-filter { flex-direction: column; }
    .autostyle-home .as-filter-submit { width: 100%; }
    .autostyle-home .as-footer-grid,
    .autostyle-home .as-subfooter-grid { grid-template-columns: 1fr; gap: 30px; }
    .autostyle-home .as-hero-title { font-size: 30px; }
}
