/* ============================================================
   RAVE WEAR — EC SITE STYLESHEET
   Standalone style. Shares design tokens with RAVE 2D.
   ============================================================ */

/* --- DESIGN TOKENS --- */
:root {
    --bg: #ffffff;
    --text: #0a0a0a;
    --text-muted: rgba(10, 10, 10, 0.55);
    --text-subtle: rgba(10, 10, 10, 0.4);
    --blue: #0022FF;
    --blue-glow: rgba(0, 34, 255, 0.18);
    --blue-dim: rgba(0, 34, 255, 0.06);
    --line: #ebebeb;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --font-en: 'Inter', system-ui, -apple-system, sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-en);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; }

/* --- LOADER --- */
.wear-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text);
    transition: opacity 0.5s var(--ease-in-out);
}
.wear-loader.is-hidden { opacity: 0; pointer-events: none; }

.wear-loader-text {
    color: var(--text);
}
.wear-loader-dot {
    color: var(--text-subtle);
    animation: loader-blink 1s linear infinite;
}
.wear-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.wear-loader-dot:nth-child(3) { animation-delay: 0.4s; }
.wear-loader-dot:nth-child(4) { animation-delay: 0.6s; }
@keyframes loader-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- REVEAL ANIMATION --- */
[data-wear-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
[data-wear-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}
[data-wear-stagger="0"] { transition-delay: 0ms; }
[data-wear-stagger="1"] { transition-delay: 100ms; }
[data-wear-stagger="2"] { transition-delay: 200ms; }
[data-wear-stagger="3"] { transition-delay: 300ms; }

/* --- WRAP --- */
.wear-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================================
   HEADER
   ============================================================ */
.wear-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 40px;
    height: 64px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.wear-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    transition: color 0.2s;
    min-height: 44px;
}
.wear-back:hover { color: var(--text); }
.wear-back-arrow {
    font-size: 1rem;
    transition: transform 0.2s var(--ease-out-expo);
}
.wear-back:hover .wear-back-arrow { transform: translateX(-4px); }

.wear-header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}
.wear-header-title {
    font-family: var(--font-en);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1;
}
.wear-header-by {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-subtle);
    letter-spacing: 0.1em;
}

.wear-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}
.wear-social-link {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    transition: color 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.wear-social-link:hover { color: var(--text); }

/* ============================================================
   HERO
   ============================================================ */
.wear-hero {
    position: relative;
    padding: 80px 60px 100px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: center top;
}
.wear-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.wear-hero-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text);
    border: 1px solid var(--line);
    padding: 6px 14px;
    border-radius: 2px;
    margin: 0 auto 28px;
}
.wear-hero-title {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin: 0 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.wear-hero-line {
    display: block;
}
.blue-outline {
    color: transparent;
    -webkit-text-stroke: 3px var(--blue);
}
.wear-hero-desc {
    font-family: var(--font-en);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
    letter-spacing: 0.12em;
}

/* ============================================================
   COLLECTION BAR
   ============================================================ */
.wear-collection-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 28px 60px 20px;
    border-bottom: none;
}
.wear-collection-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text);
    justify-self: start;
}
.wear-collection-count {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.14em;
    font-family: var(--font-en);
    justify-self: end;
}

/* ============================================================
   PRODUCT GRID
   ============================================================ */
.wear-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 40px);
    padding: 8px 60px clamp(64px, 10vw, 100px);
    background: var(--bg);
    border-bottom: none;
}

/* 各プロダクトカード */
.product-card {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* プロダクト画像 */
.product-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2vw, 20px);
}
.product-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s var(--ease-out-expo);
}
.product-card:hover .product-img,
.product-card-link:hover .product-img {
    transform: scale(1.01);
}

/* NEWバッジ */
.product-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    padding: 5px 12px;
    background: var(--text);
    color: #fff;
    z-index: 2;
}

/* カード全体を Stripe へ（画像＋商品情報） */
.product-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    color: inherit;
    text-decoration: none;
    outline: none;
}
.product-card-link:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: -2px;
}

/* 商品情報 */
.product-info {
    padding: 20px 8px 0;
    flex: 1;
    text-align: left;
}
.product-name {
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0 0 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.35;
}
.product-meta {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0 0 14px;
    font-family: var(--font-en);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.product-price {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.06em;
}
.product-tax {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
    font-family: var(--font-jp);
}

/* ============================================================
   FOOTER
   ============================================================ */
.wear-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
}
.wear-footer-inner {
    padding: 48px 60px 40px;
}
.wear-footer-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 32px;
    gap: 24px;
}
.wear-footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-self: start;
}
.wear-footer-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    opacity: 0.9;
    filter: brightness(0);
}
.wear-footer-brand-name {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}
.wear-footer-socials {
    display: flex;
    gap: 24px;
    justify-self: end;
}
.wear-footer-socials a {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    transition: color 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.wear-footer-socials a:hover { color: var(--text); }

.wear-footer-policy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    margin-bottom: 20px;
    font-family: var(--font-jp);
    font-size: 0.7rem;
}
.wear-policy-link {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 2px 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    transition: color 0.2s;
}
.wear-policy-link:hover { color: var(--text); }
.wear-policy-sep {
    color: var(--line);
    font-size: 0.65rem;
    pointer-events: none;
}
.wear-footer-copy {
    font-size: 0.65rem;
    color: var(--text-subtle);
    letter-spacing: 0.06em;
    font-family: var(--font-en);
    text-align: center;
}

/* ============================================================
   POLICY POPUP
   ============================================================ */
.wear-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.wear-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.wear-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    cursor: pointer;
}
.wear-popup-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--line);
    box-shadow: 0 24px 80px rgba(0,0,0,0.12);
    overflow: hidden;
}
.wear-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--text);
    background: transparent;
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    z-index: 2;
    transition: background 0.2s, border-color 0.2s;
}
.wear-popup-close:hover {
    background: var(--text);
    border-color: var(--text);
    color: #fff;
}
.wear-popup-title {
    flex-shrink: 0;
    margin: 0;
    padding: 24px 48px 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-jp);
}
.wear-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 32px;
    font-family: var(--font-jp);
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text);
}
.wear-popup-body .policy-heading { display: none; }
.wear-popup-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.2em 0 0.5em;
    color: var(--text);
}
.wear-popup-body h3:first-child { margin-top: 0; }
.wear-popup-body p { margin: 0 0 0.8em; }
.wear-popup-body .policy-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1em;
}
.wear-popup-body .policy-dl { margin: 1em 0; }
.wear-popup-body .policy-dl dt {
    font-weight: 600;
    margin-top: 0.8em;
    color: var(--text);
    font-size: 0.85rem;
}
.wear-popup-body .policy-dl dt:first-child { margin-top: 0; }
.wear-popup-body .policy-dl dd { margin: 0.25em 0 0; padding-left: 0.5em; }
.wear-popup-body .policy-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 1.2em; }

/* ============================================================
   RESPONSIVE: Tablet
   ============================================================ */
@media (max-width: 1024px) {
    .wear-hero { padding: 60px 40px 80px; }
    .wear-collection-bar { padding: 24px 40px 16px; }
    .wear-products { padding-left: 40px; padding-right: 40px; }
    .wear-footer-inner { padding: 40px 40px 32px; }
}

/* ============================================================
   RESPONSIVE: Mobile
   ============================================================ */
@media (max-width: 768px) {
    .wear-header {
        padding: 0 16px;
        height: 56px;
    }
    .wear-header-title { font-size: 0.85rem; }
    .wear-back-label { display: none; }
    .wear-social-link { display: none; }

    .wear-hero {
        padding: 40px 20px 60px;
    }
    .wear-hero-title {
        font-size: clamp(2.4rem, 10vw, 3.5rem);
    }
    .blue-outline {
        -webkit-text-stroke: 2px var(--blue);
    }

    .wear-collection-bar { padding: 20px 20px 14px; }

    /* モバイルは2カラム */
    .wear-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 20px;
        padding: 4px 20px 56px;
    }
    .product-info { padding: 16px 4px 0; }
    .product-name { font-size: 0.85rem; }
    .product-price { font-size: 0.9rem; }

    .wear-footer-inner { padding: 32px 20px 28px; }
    .wear-footer-top {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    .wear-footer-brand {
        justify-self: center;
        flex-direction: column;
    }
    .wear-footer-socials {
        justify-self: center;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    .wear-hero { padding: 32px 16px 48px; }
    .wear-hero-tag { font-size: 0.7rem; margin-bottom: 20px; }
    .wear-hero-title { font-size: clamp(2rem, 11vw, 2.8rem); }
    .wear-hero-desc { font-size: 0.9rem; }

    .wear-collection-bar { padding: 18px 16px 12px; }
    .wear-collection-label { font-size: 0.65rem; }

    /* 極小画面は1カラム */
    .wear-products {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 4px 16px 48px;
    }
    .product-img-wrap { aspect-ratio: 1 / 1; }
    .product-info { padding: 18px 0 0; }

    .wear-footer-inner { padding: 28px 16px 24px; }
}
