/* =========================================
   HOME (index.php) – premium motion, fehér alap
   Scope: csak a főoldal (body.page-home)
   ========================================= */

body.page-home {
    background: var(--bg-page, #ffffff);
}

body.page-home .home-page {
    --home-max: 1240px;
    --home-pad-x: clamp(14px, 3vw, 22px);
    --home-pad-y: clamp(16px, 3vw, 36px);
    --home-ease: cubic-bezier(.22, .61, .36, 1);
    --home-section-min-h: auto;
    --home-motion-factor-local: var(--home-motion-factor, .75);
    --home-motion-opacity-start-local: var(--home-motion-opacity-start, 0);
    --home-motion-delay-scale-local: var(--home-motion-delay-scale, 1);
    --home-motion-speed-local: var(--home-motion-speed, 1);
    background: transparent;
    display: grid;
    gap: 0;
}

/* Főoldali szekciók: NE legyen full-screen (túl nagy whitespace) */
body.page-home .home-page > section {
    position: relative;
    min-height: auto;
    padding: var(--home-pad-y) var(--home-pad-x);
    display: grid;
    align-content: start;
    overflow: hidden;
    background: transparent;
    animation: homeSectionIn calc(760ms * var(--home-motion-speed-local)) var(--home-ease) both;
    animation-delay: calc((var(--home-section-delay, 0ms) + 120ms) * var(--home-motion-delay-scale-local));
    opacity: 1;
}

/* JS nélkül se maradjon "elrejtett" állapotban a tartalom. */
body.page-home:not(.is-ui-ready) .home-page > section,
body.page-home:not(.is-ui-ready) .home-section--sale-hero .home-sale-hero,
body.page-home:not(.is-ui-ready) .home-section--featured .category-product {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

body.page-home .home-page > section:nth-child(1) { --home-section-delay: 40ms; }
body.page-home .home-page > section:nth-child(2) { --home-section-delay: 130ms; }
body.page-home .home-page > section:nth-child(3) { --home-section-delay: 220ms; }
body.page-home .home-page > section:nth-child(4) { --home-section-delay: 310ms; }

body.page-home .home-page > section > * {
    position: relative;
    z-index: 1;
}

/* Márkák blokk ne legyen teljes képernyős */
body.page-home .home-page > section.home-media {
    --home-section-min-h: auto;
    min-height: auto;
    align-content: start;
    padding: 0;
    animation-delay: calc(0ms * var(--home-motion-delay-scale-local));
}

/* Tisztán fehér lap, ne legyen overlay */
body.page-home .home-page > section::before {
    display: none;
}

/* Headline / subline */
body.page-home .home-page .home-h2 {
    margin: 0 0 6px;
    font-size: clamp(20px, 2.2vw, 30px);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: rgba(15, 23, 42, 0.98);
}

body.page-home .home-page .home-p {
    margin: 0;
    max-width: 70ch;
    font-size: clamp(12px, 1.15vw, 14px);
    line-height: 1.55;
    color: rgba(71, 85, 105, 0.92);
}

/* Márka blokk layout */
body.page-home .home-media {
    margin: 0;
    padding: 0;
    border-top: 0;
}

body.page-home .brand-marquee {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
}

/* Márkák: tényleg menjen ki a szélekig, ne hagyjon nagy belső paddinget */
body.page-home .brand-track {
    padding: 10px 8px;
}

body.page-home .home-page > section.home-section--sale-hero {
    padding-top: 10px;
    padding-bottom: 12px;
}

/* Featured: ritmusban legyen az akció blokkal (ne legyen "széteső" nagy whitespace) */
body.page-home .home-page > section.home-section--featured {
    padding-top: 6px;
    padding-bottom: 18px;
}

body.page-home .home-media .brand-item {
    transition:
        transform 220ms var(--home-ease),
        border-color 220ms var(--home-ease),
        background-color 220ms var(--home-ease),
        box-shadow 220ms var(--home-ease);
}

@media (hover: hover) and (pointer: fine) {
    body.page-home .home-media .brand-item:hover {
        transform: translateY(-2px);
        border-color: rgba(15, 23, 42, .18);
        box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
        background: rgba(255, 255, 255, 1);
    }
}

@media (hover: none) {
    body.page-home .home-media .brand-item:active {
        transform: scale(0.985);
    }
}

/* Akció hero wrapper */
body.page-home .home-section--sale-hero .home-sale-hero {
    padding: 0;
    animation: homeLift calc(820ms * var(--home-motion-speed-local)) var(--home-ease) both;
    animation-delay: calc((var(--home-section-delay, 0ms) + 180ms) * var(--home-motion-delay-scale-local));
}

body.page-home .home-section--featured .home-featured-head,
body.page-home .home-section--featured .home-featured-grid {
    max-width: var(--home-max);
    margin-left: auto;
    margin-right: auto;
}

body.page-home .home-section--featured {
    margin-top: 0;
}

body.page-home .home-section--featured .home-featured-head {
    margin-bottom: 16px;
}

body.page-home .home-section--featured .home-featured-grid {
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1024px) {
    body.page-home .home-section--featured .home-featured-grid {
        grid-template-columns: repeat(4, minmax(0, var(--pc-card-max, 220px)));
        justify-content: center;
        gap: 14px;
    }
}

/* Kategória szekció (adminból választható) */
body.page-home .home-section--category .home-section-head,
body.page-home .home-section--category .home-cat-grid {
    max-width: var(--home-max);
    margin-left: auto;
    margin-right: auto;
}

body.page-home .home-section--category .home-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

body.page-home .home-section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .26);
    background: rgba(248, 250, 252, .92);
    color: rgba(15, 23, 42, .86);
    text-decoration: none;
    font-weight: 850;
    font-size: 12px;
}

body.page-home .home-section-link:hover {
    border-color: rgba(245, 158, 11, .55);
    background: rgba(255, 255, 255, 1);
}

body.page-home .home-cat-subcats {
    max-width: var(--home-max);
    margin: 0 auto 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.page-home .home-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(255, 255, 255, .92);
    color: rgba(15, 23, 42, .86);
    text-decoration: none;
    font-weight: 800;
    font-size: 12px;
}

body.page-home .home-chip:hover {
    border-color: rgba(245, 158, 11, .55);
}

body.page-home .home-cat-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 860px) {
    body.page-home .home-cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1120px) {
    body.page-home .home-cat-grid {
        grid-template-columns: repeat(4, minmax(0, 220px));
        justify-content: center;
        gap: 14px;
    }
}

/* Akciós sáv */
body.page-home .home-section--sale-strip .home-section-head {
    max-width: var(--home-max);
    margin: 0 auto 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

body.page-home .home-sale-strip {
    max-width: var(--home-max);
    margin: 0 auto;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
}

body.page-home .home-sale-strip::-webkit-scrollbar {
    height: 6px;
}

body.page-home .home-sale-strip::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .5);
    border-radius: 999px;
}

body.page-home .home-sale-item {
    scroll-snap-align: start;
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(255, 255, 255, .96);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

body.page-home .home-sale-item__media {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    background: rgba(248, 250, 252, .9);
    display: grid;
    place-items: center;
    overflow: hidden;
}

body.page-home .home-sale-item__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.page-home .home-sale-item__title {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    color: rgba(15, 23, 42, 0.9);
    min-height: 2.4em;
}

body.page-home .home-sale-item__prices {
    display: flex;
    gap: 8px;
    align-items: center;
}

body.page-home .home-sale-item__price {
    font-weight: 900;
    color: rgba(15, 23, 42, 0.92);
}

body.page-home .home-sale-item__old {
    font-size: 12px;
    color: rgba(148, 163, 184, .9);
    text-decoration: line-through;
}

/* Népszerű / Újdonság */
body.page-home .home-section--popular .home-featured-head,
body.page-home .home-section--popular .home-featured-grid,
body.page-home .home-section--new .home-featured-head,
body.page-home .home-section--new .home-featured-grid,
body.page-home .home-section--muncs .home-featured-head,
body.page-home .home-section--muncs .home-featured-grid {
    max-width: var(--home-max);
    margin-left: auto;
    margin-right: auto;
}

body.page-home .home-section--popular .home-featured-grid,
body.page-home .home-section--new .home-featured-grid,
body.page-home .home-section--muncs .home-featured-grid {
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1024px) {
    body.page-home .home-section--popular .home-featured-grid,
    body.page-home .home-section--new .home-featured-grid,
    body.page-home .home-section--muncs .home-featured-grid {
        grid-template-columns: repeat(4, minmax(0, var(--pc-card-max, 220px)));
        justify-content: center;
        gap: 14px;
    }
}

/* Szolgaltatas blokk */
body.page-home .home-section--services .home-featured-head,
body.page-home .home-section--services .home-services-grid {
    max-width: var(--home-max);
    margin-left: auto;
    margin-right: auto;
}

body.page-home .home-section--services .home-featured-head {
    margin-bottom: 14px;
}

body.page-home .home-services-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 760px) {
    body.page-home .home-services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1120px) {
    body.page-home .home-services-grid {
        grid-template-columns: repeat(3, minmax(0, min(360px, 100%)));
        justify-content: center;
    }
}

body.page-home .home-service-card {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 100%;
    padding: 16px 16px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .20);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-sm);
}

body.page-home .home-service-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: rgba(15, 23, 42, .96);
}

body.page-home .home-service-card__category {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    height: 26px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, .28);
    background: rgba(245, 158, 11, .10);
    color: rgba(120, 53, 15, .92);
    font-size: 11px;
    font-weight: 800;
}

body.page-home .home-service-card p {
    margin: 0;
    color: rgba(71, 85, 105, .92);
    font-size: 13px;
    line-height: 1.55;
}

body.page-home .home-service-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .24);
    background: rgba(248, 250, 252, .92);
    color: rgba(15, 23, 42, .88);
    text-decoration: none;
    font-size: 12px;
    font-weight: 850;
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

body.page-home .home-service-card__link:hover {
    border-color: rgba(245, 158, 11, .58);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

/* Kategória-választó blokk */
body.page-home .home-section--categories .home-section-head {
    max-width: var(--home-max);
    margin: 0 auto 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

body.page-home .home-cats-grid {
    max-width: var(--home-max);
    margin: 0 auto;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.page-home .home-section--categories.layout-mini .home-cats-grid {
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 980px) {
    body.page-home .home-cats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body.page-home .home-section--categories.layout-mini .home-cats-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

body.page-home .home-cat-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .18);
    background: rgba(255, 255, 255, .96);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

body.page-home .home-section--categories.layout-mini .home-cat-tile {
    padding: 9px 10px;
}

body.page-home .home-cat-tile__name {
    font-weight: 850;
    font-size: 13px;
    color: rgba(15, 23, 42, 0.92);
}

body.page-home .home-cat-tile__meta {
    font-size: 12px;
    color: rgba(71, 85, 105, 0.8);
}

body.page-home .home-cats-chips {
    max-width: var(--home-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Szöveges banner */
body.page-home .home-section--text .home-banner {
    max-width: var(--home-max);
    margin: 0 auto;
    border-radius: var(--radius-lg, 20px);
    border: 1px solid rgba(148, 163, 184, .22);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

body.page-home .home-banner__title {
    font-weight: 950;
    font-size: 14px;
    color: rgba(15, 23, 42, .96);
    margin-bottom: 6px;
}

body.page-home .home-banner__body {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(71, 85, 105, .92);
}

body.page-home .home-banner--neutral {
    background: rgba(255, 255, 255, .96);
}

body.page-home .home-banner--info {
    background: rgba(59, 130, 246, .06);
    border-color: rgba(59, 130, 246, .18);
}

body.page-home .home-banner--promo {
    background: rgba(245, 158, 11, .10);
    border-color: rgba(245, 158, 11, .22);
}

/* Kép banner */
body.page-home .home-section--image .home-image-banner {
    max-width: var(--home-max);
    margin: 0 auto;
    border-radius: var(--radius-lg, 20px);
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

body.page-home .home-image-banner__title {
    padding: 14px 16px 0;
    font-weight: 950;
    font-size: 14px;
    color: rgba(15, 23, 42, .96);
}

body.page-home .home-image-banner__media {
    display: block;
    padding: 12px 16px 16px;
}

body.page-home .home-image-banner__media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md, 12px);
}

body.page-home .home-image-banner__cta {
    padding: 0 16px 16px;
}

/* Interakciós kártya animációk és hover/tap */
body.page-home .home-section--featured .category-product {
    --home-card-delay: 0ms;
    opacity: 1;
    transform: translateY(calc(12px * var(--home-motion-factor-local)));
    transition:
        transform 220ms var(--home-ease),
        box-shadow 220ms var(--home-ease),
        border-color 220ms var(--home-ease);
    animation: homeCardIn calc(640ms * var(--home-motion-speed-local)) var(--home-ease) both;
    animation-delay: calc((var(--home-card-delay) + 240ms) * var(--home-motion-delay-scale-local));
}

body.page-home .home-section--featured .category-product:nth-child(1) { --home-card-delay: 0ms; }
body.page-home .home-section--featured .category-product:nth-child(2) { --home-card-delay: 60ms; }
body.page-home .home-section--featured .category-product:nth-child(3) { --home-card-delay: 120ms; }
body.page-home .home-section--featured .category-product:nth-child(4) { --home-card-delay: 180ms; }
body.page-home .home-section--featured .category-product:nth-child(5) { --home-card-delay: 240ms; }
body.page-home .home-section--featured .category-product:nth-child(6) { --home-card-delay: 300ms; }
body.page-home .home-section--featured .category-product:nth-child(7) { --home-card-delay: 360ms; }
body.page-home .home-section--featured .category-product:nth-child(8) { --home-card-delay: 420ms; }
body.page-home .home-section--featured .category-product:nth-child(9) { --home-card-delay: 480ms; }
body.page-home .home-section--featured .category-product:nth-child(10) { --home-card-delay: 540ms; }
body.page-home .home-section--featured .category-product:nth-child(11) { --home-card-delay: 600ms; }
body.page-home .home-section--featured .category-product:nth-child(12) { --home-card-delay: 660ms; }

@media (hover: hover) and (pointer: fine) {
    body.page-home .home-section--featured .category-product:hover {
        transform: translateY(-3px);
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
        border-color: rgba(15, 23, 42, .2);
    }
}

@media (hover: none) {
    body.page-home .home-section--featured .category-product:active {
        transform: translateY(-2px) scale(1.01);
    }
}

/* Section load-in + micro-motion */
@media (prefers-reduced-motion: no-preference) {
    body.page-home .home-page > section {
        opacity: 1;
    }

    body.page-home .home-page > section.home-media {
        opacity: 1;
    }

    body.page-home .home-page .home-section--featured .category-product {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-home .home-page > section,
    body.page-home .home-page .home-section--featured .category-product,
    body.page-home .home-section--sale-hero .home-sale-hero,
    body.page-home .home-page .home-section--featured .home-featured-head {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Animációk */
@keyframes homeSectionIn {
    from {
        opacity: 1;
        transform: translate3d(0, calc(12px * var(--home-motion-factor-local, 1)), 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes homeLift {
    from {
        opacity: 1;
        transform: translate3d(0, calc(18px * var(--home-motion-factor-local, 1)), 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes homeCardIn {
    from {
        opacity: 1;
        transform: translateY(calc(14px * var(--home-motion-factor-local, 1)))
            scale(calc(1 - (0.015 * var(--home-motion-factor-local, 1))));
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobilon extra levegő + szakaszok láthatósága */
@media (max-width: 720px) {
    body.page-home .home-page {
        --home-pad-x: 14px;
        --home-pad-y: 22px;
    }

    body.page-home .home-page > section:not(.home-media):not(.home-section--sale-hero) {
        min-height: auto;
        align-content: start;
        padding-top: 28px;
        padding-bottom: 28px;
        gap: 10px;
    }

    body.page-home .brand-track {
        padding: 8px 6px;
    }

    body.page-home .home-section--featured .home-featured-grid {
        gap: 14px;
    }

    body.page-home .home-section--sale-hero .home-sale-hero {
        animation-delay: calc(180ms * var(--home-motion-delay-scale-local));
    }

    body.page-home .home-media__title {
        font-size: 17px;
    }
}
