/* ==========================================================================
   home.css — Grand Motors
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { color: var(--gm-dark, #323232); background: #fff; line-height: 1.5; }

.brands-section, .brands-section *,
.why-section, .why-section *,
.catalog-section, .catalog-section *,
.services-section, .services-section *,
.contact-section, .contact-section * {
    font-family: var(--gm-font-body, 'Onest', sans-serif) !important;
}
.section-title, .brand-card-name, .why-card-title, .service-title,
.contact-title, .product-name, .product-btn, .brand-btn, .contact-btn,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button {
    font-family: var(--gm-font-heading, 'Oswald', sans-serif) !important;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 10px; }

.section-title {
    font-size: 28px; font-weight: 600;
    letter-spacing: 0.02em; text-transform: uppercase;
    color: var(--gm-dark, #323232); margin-bottom: 32px;
}


/* ── HERO SLIDER ── */
.hero-slider {
    position: relative; width: 100%; height: 520px;
    overflow: hidden; background: #1a2a3a; user-select: none;
}
.hero-slides {
    display: flex; width: 100%; height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slide {
    min-width: 100%; height: 100%;
    position: relative; overflow: hidden; background: #1a2a3a;
}
.hero-slide img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
}
.hero-slide-empty {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.3); font-size: 14px;
}

/* Стрелок нет — только точки */
.hero-dots {
    position: absolute; bottom: 24px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 10px; z-index: 10;
}
.hero-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: transparent !important;
    border: 2px solid rgba(255,255,255,0.5) !important;
    cursor: pointer; padding: 0;
    transition: border-color 0.22s ease, background 0.22s ease;
}
.hero-dot.active {
    background: transparent !important;
    border-color: var(--gm-red, #D41111) !important;
    box-shadow: 0 0 0 2px rgba(212,17,17,0.25);
}


/* ── BRANDS SECTION ── */
.brands-section { padding: 56px 0 64px; background: #fff; overflow: visible; }
.brands-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 60px; overflow: visible; padding-top: 20px; }
.brand-card {
    position: relative;
    border-radius: 16px;
    height: 540px;
    cursor: pointer;
    overflow: visible !important;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.brand-card:hover { transform: translateY(-6px); box-shadow: 0 16px 48px rgba(0,0,0,0.25); }

.brand-card-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border-radius: 16px;
    object-fit: cover;
    transition: transform 0.4s ease;
    z-index: 1;
    overflow: hidden;
}
.brand-card:hover .brand-card-bg { transform: scale(1.03); }
.brand-card-bg-fallback {
    position: absolute; inset: 0;
    border-radius: 16px;
    background: linear-gradient(160deg, #1e3a52, #2d5a7a);
    z-index: 1;
}

/* Машина — вылезает ВВЕРХ и по БОКАМ за пределы карточки */
.brand-card-truck {
    position: absolute;
    bottom: 32%;           /* нижняя граница в 42% высоты карточки */
    left: 50%;
    transform: translateX(-50%);
    width: 115%;           /* шире карточки = вылезает по бокам */
    max-width: none;
    object-fit: contain;
    z-index: 10;
    pointer-events: none;
    transition: transform 0.4s ease;
    filter: drop-shadow(0 16px 32px rgba(0,0,0,0.5));
}
.brand-card:hover .brand-card-truck {
    transform: translateX(-50%) translateY(-10px) scale(1.04);
}

.brand-card-overlay {
    position: absolute; inset: 0;
    border-radius: 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.78) 100%);
    z-index: 2;
}
.brand-card-body {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 20px 20px 24px;
    color: #fff;
    z-index: 5;
}
.brand-card-name {
    font-size: 32px; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 12px;
}
.brand-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.brand-tag {
    font-size: 10px; font-weight: 500;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 2px 8px; border-radius: 2px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.brand-btn {
    display: inline-block; background: #fff; color: var(--gm-dark, #323232);
    font-size: 13px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 8px 20px; border-radius: 4px;
    transition: background 0.22s ease, color 0.22s ease;
}
.brand-card:hover .brand-btn { background: var(--gm-red, #D41111); color: #fff; }


/* ── WHY SECTION ── */
.why-section { padding: 56px 0; background: #fff; }
.why-section .section-title { text-align: center; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.why-card {
    background: var(--gm-grey, #F7F7F7);
    border-radius: 4px; padding: 28px 24px;
    border-bottom: 3px solid transparent;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.why-card:hover {
    border-bottom-color: var(--gm-red, #D41111);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
/* PNG иконка вместо SVG */
.why-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
    background: transparent;
}
.why-icon img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}
.why-card-title {
    font-size: 15px; font-weight: 600;
    letter-spacing: 0.03em; text-transform: uppercase;
    margin-bottom: 10px; color: var(--gm-dark, #323232);
}
.why-card-text { font-size: 13px; color: var(--gm-grey-3, #6D6D6D); line-height: 1.65; }


/* ── CATALOG SECTION ── */
.catalog-section { padding: 56px 0; background: var(--gm-grey, #F7F7F7); }
.catalog-header {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 28px;
}
.catalog-header .section-title { margin-bottom: 0; }
.catalog-nav { display: flex; gap: 8px; align-items: center; }

.catalog-nav-btn {
    width: 36px !important; height: 36px !important;
    min-width: 0 !important;
    border: 1px solid var(--gm-grey-2, #ECF0F0) !important;
    background: #fff !important; color: var(--gm-dark, #323232) !important;
    border-radius: 4px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer; text-decoration: none !important;
    padding: 0 !important; line-height: 1 !important;
    box-shadow: none !important; outline: none !important;
    transition: background 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
    font-family: inherit !important;
}
.catalog-nav-btn:hover:not(:disabled) {
    background: var(--gm-red, #D41111) !important;
    border-color: var(--gm-red, #D41111) !important;
}
.catalog-nav-btn:hover:not(:disabled) svg { stroke: #fff !important; }
.catalog-nav-btn:disabled { opacity: 0.35; cursor: default; }
.catalog-nav-btn svg {
    width: 16px !important; height: 16px !important;
    stroke: var(--gm-dark, #323232) !important;
    fill: none !important; stroke-width: 2.2 !important;
    display: block !important;
    transition: stroke 0.22s ease;
}

/* Счётчик страниц */
.catalog-page-info {
    font-size: 13px; color: var(--gm-grey-3, #6D6D6D);
    min-width: 40px; text-align: center;
}

/* AJAX loading state */
.catalog-products-wrap {
    position: relative; min-height: 200px;
    transition: opacity 0.2s ease;
}
.catalog-products-wrap.loading { opacity: 0.4; pointer-events: none; }
.catalog-loading-spinner {
    display: none;
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 32px; height: 32px;
    border: 3px solid var(--gm-grey-2, #ECF0F0);
    border-top-color: var(--gm-red, #D41111);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    z-index: 10;
}
.catalog-products-wrap.loading .catalog-loading-spinner { display: block; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }


/* ── WooCommerce grid ── */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    list-style: none !important;
    padding: 0 !important; margin: 0 !important;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none !important; }

.woocommerce ul.products li.product, .product-card {
    background: #fff !important;
    border: 1px solid var(--gm-grey-2, #ECF0F0) !important;
    border-radius: 12px !important; overflow: hidden !important;
    display: flex !important; flex-direction: column !important;
    width: auto !important; margin: 0 !important; float: none !important;
    transition: box-shadow 0.22s ease, transform 0.22s ease !important;
}
.woocommerce ul.products li.product:hover, .product-card:hover {
    box-shadow: 0 6px 28px rgba(0,0,0,0.12) !important;
    transform: translateY(-2px) !important;
}
.product-card-img-wrap,
.woocommerce ul.products li.product a.woocommerce-loop-product__link {
    display: block !important; width: 100% !important;
    aspect-ratio: 4/3 !important; overflow: hidden !important;
    background: #f8f9fa !important; padding: 12px !important;
}
.product-card-img-wrap img,
.woocommerce ul.products li.product a.woocommerce-loop-product__link img {
    width: 100% !important; height: 100% !important;
    object-fit: contain !important; margin: 0 !important;
    transition: transform 0.3s ease !important; border-radius: 6px !important;
}
.product-card:hover .product-card-img-wrap img,
.woocommerce ul.products li.product:hover a img { transform: scale(1.04) !important; }

.product-card-body {
    padding: 12px 16px !important; flex: 1 !important;
    display: flex !important; flex-direction: column !important;
}
.product-brand {
    font-size: 16px !important; font-weight: 700 !important;
    color: var(--gm-red, #D41111) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.01em !important; margin-bottom: 5px !important;
}
.product-name,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 18px !important; font-weight: 600 !important;
    color: var(--gm-dark, #323232) !important;
    margin-bottom: 12px !important; letter-spacing: 0.01em !important;
    text-transform: none !important; padding: 0 !important; line-height: 1.2 !important;
}
.product-specs {
    display: flex !important; flex-direction: column !important;
    gap: 6px !important; margin-bottom: 14px !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--gm-grey-2, #ECF0F0) !important;
}
.product-spec-row {
    display: flex !important; justify-content: space-between !important;
    align-items: center !important; font-size: 13px !important;
}
.product-spec-label { color: var(--gm-grey-3, #6D6D6D) !important; }
.product-spec-value { font-weight: 600 !important; color: var(--gm-dark, #323232) !important; }

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button,
.product-btn {
    display: block !important;
    width: calc(100% - 32px) !important; margin: 0 16px 16px !important;
    background: var(--gm-red, #D41111) !important; color: #fff !important;
    font-size: 15px !important; font-weight: 600 !important;
    letter-spacing: 0.05em !important; text-transform: uppercase !important;
    text-align: center !important; padding: 12px 16px !important;
    border-radius: 4px !important; border: none !important;
    cursor: pointer !important; transition: background 0.22s ease !important;
}
.woocommerce ul.products li.product .button:hover,
.product-btn:hover { background: var(--gm-red-dark, #A71212) !important; }
.woocommerce ul.products li.product .price { display: none !important; }


/* ── SERVICES SECTION ── */
.services-section { padding: 48px 0; background: #fff; }
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.service-card {
    background: var(--gm-grey, #F7F7F7);
    border-radius: 4px; padding: 32px; display: flex; gap: 20px;
}
/* PNG иконка сервиса */
.service-icon {
    width: 64px; height: 64px; flex-shrink: 0;
    background: #F5DFDF;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.service-icon img {
    width: 80%; height: 80%;
    object-fit: contain; display: block;
}
.service-title {
    font-size: 18px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.03em;
    margin-bottom: 10px; color: var(--gm-dark, #323232);
}
.service-text { font-size: 13px; color: var(--gm-grey-3, #6D6D6D); line-height: 1.65; margin-bottom: 16px; }
.service-checklist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.service-checklist li {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--gm-dark, #323232);
}
/* Полая галочка — только граница и красная иконка внутри */
.service-checklist li::before {
    content: '';
    width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
    background: transparent;
    border: 2px solid var(--gm-red, #D41111);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3L12.5 5' stroke='%23D41111' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
}


/* ── CONTACT SECTION ── */
.contact-section { padding: 56px 0; background: var(--gm-red, #D41111); }
.contact-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.contact-title {
    font-size: 28px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.03em;
    color: #fff; margin-bottom: 10px;
}
.contact-text { font-size: 14px; color: rgba(255,255,255,0.85); max-width: 380px; line-height: 1.6; }
.contact-form { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; }
.contact-input {
    height: 46px; padding: 0 16px;
    border: none; border-radius: 4px;
    font-size: 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    width: 185px;
    outline: none;
    transition: background 0.22s ease;
    backdrop-filter: blur(4px);
}
.contact-input::placeholder { color: #000000a6; }
.contact-input:focus { background: rgba(255,255,255,0.25); }
.contact-btn {
    height: 46px; padding: 0 28px;
    background: #111111 !important; color: #fff !important;
    font-size: 14px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    border: none; border-radius: 4px; cursor: pointer; white-space: nowrap;
    transition: background 0.22s ease;
}
.contact-btn:hover { background: #000; }


/* ── ADAPTIVE ── */
@media (max-width: 1024px) {
    .hero-slider { height: 400px; }
    .why-grid { grid-template-columns: repeat(2, 1fr); }
    .woocommerce ul.products { grid-template-columns: repeat(3, 1fr) !important; }
    .contact-inner { flex-direction: column; align-items: flex-start; gap: 24px; }
    .contact-form { width: 100%; }
    .contact-input { flex: 1; min-width: 140px; }
    .brand-card { height: 280px; }
}
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .hero-slider { height: 260px; }
    .brands-section, .why-section, .catalog-section, .contact-section { padding: 40px 0; }
    .services-section { padding: 36px 0; }
    .section-title { font-size: 22px; margin-bottom: 24px; }
    .brands-grid { grid-template-columns: 1fr; gap: 12px; }
    .brand-card { height: 240px; }
    .brand-card-truck { width: 65%; bottom: 55px; left:70%; }
    .why-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .why-card { padding: 20px 16px; }
    .woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; }
    .catalog-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .services-grid { grid-template-columns: 1fr; gap: 16px; }
    .service-card { padding: 24px; }
    .contact-title { font-size: 22px; }
    .contact-form { flex-direction: column; align-items: stretch; }
    .contact-input { width: 100%; }
    .contact-btn { width: 100%; text-align: center; }
}
@media (max-width: 480px) {
    .hero-slider { height: 220px; }
    .why-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .why-card { padding: 16px 12px; }
    .why-icon { width: 44px; height: 44px; margin-bottom: 12px; }
    .woocommerce ul.products { grid-template-columns: repeat(2, 1fr) !important; }
    .product-name { font-size: 17px !important; }
    .product-spec-row { font-size: 11px !important; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: var(--gm-red, #D41111); border-radius: 3px; }