/* =========================================================================
   Toyota dealer — UI v2 homepage (feature/001-ui-v2-homepage-shell)
   Mobile-first. Scoped under .home-v2 so it never affects v1 pages.
   Visual tuning against https://www.toyota.com.vn is expected during review.
   ========================================================================= */

:root {
    --v2-red: #EB0A1E;
    --v2-red-dark: #c00817;
    --v2-black: #1a1a1a;
    --v2-gray: #58595b;
    --v2-gray-light: #f4f4f4;
    --v2-border: #e0e0e0;
    --v2-white: #ffffff;
    --v2-container: 1200px;
    --v2-radius: 8px;
    --v2-gap: 16px;
    --v2-font: "Toyota", Arial, Helvetica, sans-serif;
}

.home-v2 { font-family: var(--v2-font); color: var(--v2-black); line-height: 1.5; }
.home-v2 *, .home-v2 *::before, .home-v2 *::after { box-sizing: border-box; }
.home-v2 img { max-width: 100%; height: auto; display: block; }

.v2-container { width: 100%; max-width: var(--v2-container); margin: 0 auto; padding: 0 16px; }

.v2-section-title {
    font-size: 22px; font-weight: 300; text-transform: uppercase;
    text-align: center; margin: 32px 0 24px; letter-spacing: .3px;
}

/* ---- Buttons & links ---- */
.v2-btn {
    display: inline-block; padding: 10px 22px; border-radius: 24px;
    font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
    border: 1px solid transparent; transition: all .2s ease; text-align: center;
}
.v2-btn--primary { background: var(--v2-red); color: #fff; }
.v2-btn--primary:hover { background: var(--v2-red-dark); }
.v2-btn--ghost { background: transparent; color: var(--v2-red); border-color: var(--v2-red); }
.v2-btn--ghost:hover { background: var(--v2-red); color: #fff; }
.v2-btn--light { background: transparent; color: #fff; border-color: #fff; }
.v2-btn--light:hover { background: #fff; color: var(--v2-black); }
.v2-link { color: var(--v2-red); font-weight: 700; text-decoration: none; font-size: 13px; }
.v2-link:hover { text-decoration: underline; }

/* ---- Tabs (shared by vehicles/service/technology/news) ---- */
.v2-tab {
    background: transparent; border: none; border-bottom: 2px solid transparent;
    padding: 10px 14px; font-size: 18px; font-weight: 300; color: #000;
    text-transform: uppercase; cursor: pointer; white-space: nowrap;
    font-family: "Toyota Type", Arial, sans-serif;
}
.v2-tab.is-active { border-bottom-color: var(--v2-red); }

/* ================= Hero ================= */
.v2-hero { position: relative; width: 100%; }
.v2-hero__swiper { width: 100%; }
.v2-hero__slide { position: relative; }
.v2-hero__media { width: 100%; height: auto; object-fit: cover; aspect-ratio: 1600 / 679; }
@media (max-width: 767px) {
    .v2-hero__media { aspect-ratio: 1 / 1; }
}
.v2-hero__content {
    position: absolute; left: 0; right: 0; bottom: 12%;
    text-align: center; color: #fff; padding: 0 16px;
    text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.v2-hero__title { font-size: 28px; font-weight: 700; margin: 0 0 8px; }
.v2-hero__subtitle { font-size: 15px; margin: 0 0 16px; }
.v2-hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ================= Vehicle explorer ================= */
.v2-vehicles { padding: 24px 0 40px; background: #fff; }
.v2-vehicles__tabs { display: flex; gap: 8px; overflow-x: auto; justify-content: flex-start;
    border-bottom: 1px solid #d0d0d0; margin-bottom: 24px; -webkit-overflow-scrolling: touch; }
.v2-vehicles__tabs .v2-tab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.v2-tab__icon { width: 18px; height: 18px; }
.v2-vehicles__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.v2-car-card { position: relative; background: transparent; text-align: left; padding: 8px 8px 16px; }
.v2-car-card.is-hidden { display: none; }
.v2-car-card__top { display: flex; align-items: center; gap: 10px; min-height: 22px; margin-bottom: 4px; flex-wrap: wrap; }
.v2-car-card__promo { color: var(--v2-red); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.v2-car-card__hev { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: #0072c6; }
.v2-car-card__hev img { width: 16px; height: 16px; }
.v2-car-card__link { display: block; text-decoration: none; color: inherit; }
.v2-car-card__media img { width: 100%; height: auto; object-fit: contain; }
.v2-car-card__name { font-size: 20px; font-weight: 300; margin: 10px 0 4px; }
.v2-car-card__price { font-size: 14px; color: #3A3A3A; margin: 0; }
.v2-car-card:hover .v2-car-card__name { color: var(--v2-red); }
.v2-vehicles__compare { text-align: center; margin-top: 28px; }
.v2-vehicles__compare .v2-btn { 
    background: #fff; 
    color: #101010; 
    border: 1px solid #101010; 
    border-radius: 0; 
    padding: 12px 32px; 
    font-weight: 400; 
}
.v2-vehicles__compare .v2-btn:hover {
    background: #101010;
    color: #fff;
}

/* ================= Purchase tools ================= */
.v2-tools { padding: 48px 0; background: #fff; }
.v2-tools__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; background: var(--v2-gray-light); border: 1px solid #e5e5e5; border-radius: 4px; overflow: hidden; }
.v2-tool {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: 24px 32px; background: transparent; border-radius: 0;
    text-decoration: none; color: #101010; text-align: center; font-weight: 400; font-size: 18px;
    font-family: "Toyota Type", Arial, sans-serif;
    border-right: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}
.v2-tool:nth-child(even) { border-right: none; }
.v2-tool:nth-last-child(-n+2) { border-bottom: none; }
.v2-tool__icon img, .v2-tool__icon span, .v2-tool__icon svg { width: 65px; height: 64px; object-fit: contain; font-size: 32px; color: #101010; }

/* ---- Shared section tabs (service / technology / news) ---- */
.v2-service__tabs, .v2-technology__tabs, .v2-news__tabs {
    display: flex; gap: 0; overflow-x: auto; justify-content: space-between;
    border-bottom: 1px solid var(--v2-border); margin-bottom: 24px; -webkit-overflow-scrolling: touch;
}
.v2-service__tabs .v2-tab, .v2-technology__tabs .v2-tab, .v2-news__tabs .v2-tab {
    flex: 1; text-align: center;
}
.v2-service__panel, .v2-technology__panel, .v2-news__panel { display: none; }
.v2-service__panel.is-active, .v2-technology__panel.is-active, .v2-news__panel.is-active { display: block; }

/* ================= Service (image-card slider) ================= */
.v2-service { padding: 36px 0; }
.v2-service__track { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 4px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.v2-service__track::-webkit-scrollbar { display: none; }
.v2-service-card { position: relative; flex: 0 0 calc((100% - 32px) / 3); height: 520px; max-width: none;
    border-radius: 6px; overflow: hidden; display: block; text-decoration: none; scroll-snap-align: start;
    background-size: cover; background-position: center; background-color: #333; }
.v2-service-card::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.15) 45%, rgba(0,0,0,0) 70%); }
.v2-service-card__overlay { position: absolute; left: 20px; right: 20px; bottom: 24px; z-index: 1; }
.v2-service-card__title { color: #fff; font-size: 22px; font-weight: 400; margin: 0 0 16px; line-height: 1.2; }
.v2-service-card__more { display: inline-flex; align-items: center; justify-content: center;
    width: 150px; height: 50px; background: #fff; color: #101010; border: none;
    font-size: 16px; font-weight: 400; transition: all .2s ease; text-decoration: none; }
.v2-service-card:hover .v2-service-card__more { background: #f5f5f5; }
.v2-service__nav { display: flex; justify-content: center; gap: 20px; margin-top: 28px; }
.v2-service__arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #cfcfcf; background: #fff;
    cursor: pointer; color: #333; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.v2-service__arrow:hover { border-color: var(--v2-red); color: var(--v2-red); }
/* 3 cards per view on desktop; 1 (with a peek) on mobile */
@media (max-width: 767px) { .v2-service-card { flex-basis: 82%; } }

/* ================= Technology (featured + cards) ================= */
.v2-technology { padding: 36px 0; background: var(--v2-gray-light); }
.v2-tech-featured { display: grid; grid-template-columns: 1fr; margin-bottom: 20px;
    background: #333; border-radius: var(--v2-radius); overflow: hidden; }
.v2-tech-featured__media { position: relative; min-height: 220px; background: #222; }
.v2-tech-featured__media img, .v2-tech-featured__video { width: 100%; height: 100%; display: block; object-fit: cover; }
.v2-tech-featured__video { position: relative; }
.v2-tech-featured__panel { padding: 28px 24px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.v2-tech-featured__title { font-size: 22px; font-weight: 400; margin: 0 0 16px; font-family: "Toyota Type", Arial, sans-serif; }
.v2-tech-featured__desc { font-size: 14px; line-height: 1.6; color: #d5d5d5; margin: 0 0 22px; font-weight: 400; }
.v2-tech-featured__panel .v2-btn {
    align-self: flex-start; display: inline-flex; align-items: center; justify-content: center;
    width: 130px; height: 54px; background: #fff; color: #101010; border: none;
    font-size: 16px; font-weight: 400; font-family: "Toyota Type", Arial, sans-serif;
    text-decoration: none; padding: 0; border-radius: 0; transition: all .2s ease;
}
.v2-tech-featured__panel .v2-btn:hover { background: #f5f5f5; color: #101010; }
.v2-tech-cards { display: grid; grid-template-columns: 1fr; gap: var(--v2-gap); }
.v2-tech-card { position: relative; display: block; border-radius: var(--v2-radius); overflow: hidden;
    background: #ddd; aspect-ratio: 16 / 10; }
.v2-tech-card img { width: 100%; height: 100%; object-fit: cover; }
/* video play badge (shared by featured + cards) */
.v2-tech-item__play { position: absolute; top: 50%; left: 50%; width: 54px; height: 54px;
    transform: translate(-50%, -50%); background: rgba(235,10,30,.9); border-radius: 50%; z-index: 1; }
.v2-tech-item__play::before { content: ""; position: absolute; top: 50%; left: 54%;
    transform: translate(-50%, -50%); border-style: solid; border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff; }

/* ================= News & promotions (image + title overlay) ================= */
.v2-news { padding: 36px 0; }
.v2-news__grid { display: grid; grid-template-columns: 1fr; gap: var(--v2-gap); }
.v2-news-card { position: relative; display: block; text-decoration: none; border-radius: var(--v2-radius);
    overflow: hidden; aspect-ratio: 1 / 1; background: #ccc; }
.v2-news-card__media, .v2-news-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.v2-news-card__media img { object-fit: cover; }
.v2-news-card::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 45%, rgba(0,0,0,0) 65%); }
.v2-news-card__title { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1; margin: 0;
    color: #fff; font-size: 14px; font-weight: 400; line-height: 1.35; font-family: "Toyota Type", Arial, sans-serif;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.v2-news__more { text-align: center; margin-top: 40px; }
.v2-news__more .v2-btn { 
    display: inline-flex; justify-content: center; align-items: center;
    background: #fff; color: #101010; border: 1px solid #101010;
    padding: 12px 32px; font-size: 14px; font-weight: 400; font-family: "Toyota Type", Arial, sans-serif;
    border-radius: 0; text-decoration: none; transition: all .2s ease;
}
.v2-news__more .v2-btn:hover { background: #f5f5f5; }

/* ================= Contact ================= */
.v2-contact { padding: 32px 0 48px; }
.v2-contact__inner { max-width: 760px; border: 1px solid var(--v2-border); border-radius: var(--v2-radius); padding: 24px; }
.v2-contact__divider { width: 120px; height: 3px; background: var(--v2-red); margin: 0 auto 24px; }
.v2-field { display: flex; flex-direction: column; margin-bottom: 18px; }
.v2-field__label { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.v2-field__input, .v2-field__textarea, .v2-field__select select {
    width: 100%; padding: 8px 0; border: none; border-bottom: 1px solid #ccc; outline: none; background: transparent; font-size: 14px;
}
.v2-field__textarea { border: 1px solid #ccc; border-radius: 4px; padding: 8px; }
.v2-field__select { position: relative; }
.v2-field-row { display: grid; grid-template-columns: 1fr; gap: 0; }
.v2-consent { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--v2-gray); }
.v2-consent .required-checkbox-input { width: 18px; height: 18px; accent-color: var(--v2-red); flex: 0 0 auto; margin-top: 2px; }
.v2-contact__actions { text-align: center; margin-top: 24px; }
.button-submit-custom:disabled { opacity: .5; cursor: not-allowed; }
.loading-spinner { display: none; margin-top: 12px; text-align: center; color: var(--v2-red); }

/* ================= Responsive ================= */
@media (min-width: 576px) {
    .v2-tools__grid { grid-template-columns: repeat(4, 1fr); }
    .v2-tool { border-bottom: none !important; border-right: 1px solid #e5e5e5 !important; }
    .v2-tool:last-child { border-right: none !important; }
    .v2-field-row { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (min-width: 768px) {
    .v2-section-title { font-size: 26px; }
    .v2-car-card__name { font-size: 26px; }
    .v2-vehicles__grid, .v2-service__grid, .v2-news__grid { grid-template-columns: repeat(2, 1fr); }
    .v2-vehicles__tabs { justify-content: space-between; overflow-x: visible; }
    .v2-hero__title { font-size: 40px; }
    .v2-tech-featured { grid-template-columns: 1.6fr 1fr; }
    .v2-tech-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
    .v2-vehicles__grid { grid-template-columns: repeat(4, 1fr); }
    .v2-news__grid { grid-template-columns: repeat(4, 1fr); }
    .v2-service__grid { grid-template-columns: repeat(4, 1fr); }
}
