/* Storefront V2 visual polish — composition, fallback art, spacing, and home rhythm. */

body[data-sf-page="home"] .sf-page-stack {
    padding-top: clamp(1.75rem, 3vw, 3rem);
    padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

body[data-sf-page="home"] .sf-footer-v2 {
    margin-top: clamp(2.75rem, 5vw, 4.5rem);
}

/* Header V2 account menu: native to the storefront shell, no Tailwind dependency. */
.sf-header-v2__account {
    position: relative;
}

.sf-header-v2__account > summary {
    list-style: none;
}

.sf-header-v2__account > summary::-webkit-details-marker {
    display: none;
}

.sf-header-v2__account > summary > svg {
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 1.2rem;
}

.sf-header-v2__account-menu {
    position: absolute;
    z-index: 90;
    inset-inline-end: 0;
    top: calc(100% + .65rem);
    width: min(20rem, calc(100vw - 1.75rem));
    padding: .6rem;
    border: 1px solid color-mix(in srgb, var(--brand-500) 12%, #dbe4ea);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 24px 60px -32px rgba(15,23,42,.45);
}

.sf-header-v2__account-user,
.sf-header-v2__account-intro {
    padding: .85rem;
    border-radius: .8rem;
    background: color-mix(in srgb, var(--brand-50) 55%, #fff);
}

.sf-header-v2__account-user {
    display: grid;
    gap: .25rem;
}

.sf-header-v2__account-user strong,
.sf-header-v2__account-intro strong {
    color: var(--text-color);
    font-size: .86rem;
    font-weight: 900;
}

.sf-header-v2__account-user small,
.sf-header-v2__account-intro p {
    margin: .2rem 0 0;
    color: var(--muted-text);
    font-size: .75rem;
    line-height: 1.7;
}

.sf-header-v2__account-link,
.sf-header-v2__account-link--muted,
.sf-header-v2__account-primary,
.sf-header-v2__account-secondary {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 2.8rem;
    margin-top: .45rem;
    border-radius: .8rem;
    font-size: .82rem;
    font-weight: 850;
    text-decoration: none;
    transition: .18s ease;
}

.sf-header-v2__account-link {
    justify-content: flex-start;
    padding-inline: .75rem;
    color: var(--text-color);
}

.sf-header-v2__account-link:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

.sf-header-v2__account-link svg {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 1.1rem;
}

.sf-header-v2__account-link--muted {
    border: 0;
    background: transparent;
    color: var(--muted-text);
    cursor: pointer;
}

.sf-header-v2__account-primary {
    background: var(--brand-600);
    color: #fff;
}

.sf-header-v2__account-primary:hover {
    background: var(--brand-700);
}

.sf-header-v2__account-secondary {
    border: 1px solid color-mix(in srgb, var(--brand-500) 18%, #dbe4ea);
    color: var(--text-color);
    background: #fff;
}

.sf-header-v2__account-secondary:hover {
    border-color: var(--brand-500);
    color: var(--brand-700);
    background: var(--brand-50);
}

/* Hero fallback must feel designed even when the merchant has no banner image. */
.sf-home-v2__hero:not(:has(.sf-home-v2__hero-media)) .sf-home-v2__hero-content {
    max-width: min(48rem, 58%);
    padding-inline-end: clamp(3rem, 7vw, 7rem);
}

.sf-home-v2__hero-art {
    position: absolute;
    z-index: 1;
    inset-block: 8%;
    inset-inline-end: 4%;
    width: min(40%, 31rem);
    pointer-events: none;
}

.sf-home-v2__hero-orb {
    position: absolute;
    display: block;
    border-radius: 999px;
    filter: blur(1px);
}

.sf-home-v2__hero-orb--one {
    width: 17rem;
    aspect-ratio: 1;
    inset-inline-end: 4%;
    top: 4%;
    background: color-mix(in srgb, var(--brand-500) 24%, transparent);
    box-shadow: 0 0 100px color-mix(in srgb, var(--brand-500) 20%, transparent);
}

.sf-home-v2__hero-orb--two {
    width: 10rem;
    aspect-ratio: 1;
    inset-inline-start: 6%;
    bottom: 5%;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.11);
}

.sf-home-v2__hero-card {
    position: absolute;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.18);
    background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.055));
    box-shadow: 0 30px 70px -30px rgba(0,0,0,.52);
    backdrop-filter: blur(18px);
}

.sf-home-v2__hero-card--main {
    width: 16.5rem;
    height: 20rem;
    inset-inline-end: 11%;
    top: 14%;
    border-radius: 2rem;
    transform: rotate(-7deg);
}

.sf-home-v2__hero-card--main::before {
    content: "";
    position: absolute;
    inset: 1rem 1rem 6.4rem;
    border-radius: 1.35rem;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.34), transparent 22%),
        linear-gradient(145deg, color-mix(in srgb, var(--brand-500) 48%, #fff), color-mix(in srgb, var(--brand-900) 78%, #111827));
}

.sf-home-v2__hero-card-icon {
    position: absolute;
    z-index: 2;
    inset-inline-start: 2rem;
    top: 2rem;
    display: grid;
    width: 2.8rem;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    color: var(--brand-700);
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.16);
}

.sf-home-v2__hero-card-lines {
    position: absolute;
    inset-inline: 1.35rem;
    bottom: 1.55rem;
    display: grid;
    gap: .62rem;
}

.sf-home-v2__hero-card-lines i {
    display: block;
    height: .52rem;
    border-radius: 999px;
    background: rgba(255,255,255,.24);
}
.sf-home-v2__hero-card-lines i:nth-child(2) { width: 72%; }
.sf-home-v2__hero-card-lines i:nth-child(3) { width: 48%; background: rgba(255,255,255,.12); }

.sf-home-v2__hero-card--small {
    width: 10.5rem;
    height: 7.5rem;
    inset-inline-start: 2%;
    bottom: 15%;
    display: flex;
    align-items: end;
    gap: .5rem;
    padding: 1.15rem;
    border-radius: 1.4rem;
    transform: rotate(8deg);
}

.sf-home-v2__hero-card--small span {
    display: block;
    flex: 1;
    border-radius: 999px 999px .35rem .35rem;
    background: rgba(255,255,255,.26);
}
.sf-home-v2__hero-card--small span:nth-child(1) { height: 42%; }
.sf-home-v2__hero-card--small span:nth-child(2) { height: 72%; }
.sf-home-v2__hero-card--small span:nth-child(3) { height: 100%; background: color-mix(in srgb, var(--brand-500) 70%, #fff); }

.sf-home-v2__hero-ring {
    position: absolute;
    width: 7rem;
    aspect-ratio: 1;
    inset-inline-start: 11%;
    top: 10%;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1.1rem rgba(255,255,255,.025);
}

/* Category placeholders: lighter, more premium, and less like empty image boxes. */
.sf-home-v2__category {
    isolation: isolate;
    border: 1px solid color-mix(in srgb, var(--brand-500) 10%, #e2e8f0);
    box-shadow: 0 16px 36px -30px rgba(15,23,42,.55);
}

.sf-home-v2__category.has-placeholder {
    background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--brand-50) 72%, #fff));
}

.sf-home-v2__category-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 12%, color-mix(in srgb, var(--brand-500) 18%, transparent), transparent 30%),
        linear-gradient(145deg, color-mix(in srgb, var(--brand-50) 90%, #fff), color-mix(in srgb, var(--brand-100) 78%, #fff));
}

.sf-home-v2__category-placeholder::before,
.sf-home-v2__category-placeholder::after {
    content: "";
    position: absolute;
    border: 1px solid color-mix(in srgb, var(--brand-700) 11%, transparent);
    border-radius: 999px;
}
.sf-home-v2__category-placeholder::before { width: 9rem; aspect-ratio: 1; inset-inline-end: -3rem; top: -3.2rem; }
.sf-home-v2__category-placeholder::after { width: 5rem; aspect-ratio: 1; inset-inline-start: -1.6rem; bottom: -1.8rem; }

.sf-home-v2__category-placeholder > span {
    position: relative;
    z-index: 2;
    display: grid;
    width: 4.2rem;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 1.35rem;
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.82);
    color: var(--brand-800, var(--brand-700));
    font-size: 1.7rem;
    font-weight: 950;
    box-shadow: 0 18px 40px -28px rgba(15,23,42,.5);
    backdrop-filter: blur(8px);
}

.sf-home-v2__category-name {
    position: absolute;
    z-index: 3;
    inset-inline: 1rem;
    bottom: 1rem;
    color: #0f172a;
    font-size: .82rem;
    font-weight: 900;
    text-shadow: none;
}

.sf-home-v2__category.has-image .sf-home-v2__category-name {
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,.45);
}

/* Give product sections a surface so the page does not dissolve into empty background. */
.sf-home-v2__product-section {
    padding: clamp(1.1rem, 2vw, 1.8rem);
    border: 1px solid color-mix(in srgb, var(--text-color) 7%, transparent);
    border-radius: clamp(1.25rem, 2.2vw, 2rem);
    background: color-mix(in srgb, #fff 62%, transparent);
    box-shadow: 0 22px 55px -48px rgba(15,23,42,.5);
}

.sf-home-v2__product-section .sf-home-v2__section-head {
    margin-bottom: clamp(1rem, 1.8vw, 1.5rem);
}

/* Six columns are intentionally dense; tighten only typography/padding rather than ignoring merchant choice. */
@media (min-width: 1200px) {
    body[style*="--sf-grid-desktop:6"] .product-card__body,
    body[data-sf-page="home"] .sf-home-v2__products[style*="--sf-grid-desktop:6"] .product-card__body {
        padding: .75rem;
    }
}

body[data-sf-personality="minimal"] .sf-home-v2__product-section {
    border-radius: 6px;
    box-shadow: none;
    background: #fff;
}

body[data-sf-personality="luxury"] .sf-home-v2__product-section {
    border-radius: 0;
    padding-block: 2.25rem;
    background: rgba(255,255,255,.72);
}

body[data-sf-personality="fashion"] .sf-home-v2__product-section {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding-inline: 0;
}

@media (max-width: 900px) {
    .sf-home-v2__hero:not(:has(.sf-home-v2__hero-media)) .sf-home-v2__hero-content {
        max-width: 72%;
        padding-inline-end: 2rem;
    }
    .sf-home-v2__hero-art { width: 38%; inset-inline-end: 1%; opacity: .72; }
    .sf-home-v2__hero-card--main { width: 12rem; height: 15rem; }
    .sf-home-v2__hero-card--small { width: 8rem; height: 5.5rem; }
}

@media (max-width: 640px) {
    .sf-header-v2__account-menu {
        position: fixed;
        inset-inline: .75rem;
        top: 5.6rem;
        width: auto;
    }
    .sf-home-v2__hero-art { opacity: .34; width: 72%; inset-inline-end: -24%; }
    .sf-home-v2__hero:not(:has(.sf-home-v2__hero-media)) .sf-home-v2__hero-content {
        max-width: 100%;
        padding-inline: 1.5rem;
    }
    .sf-home-v2__category-placeholder > span { width: 3.35rem; font-size: 1.3rem; border-radius: 1rem; }
    .sf-home-v2__product-section { padding: .8rem; border-radius: 1.2rem; }
}
