/* ==========================================================================
   1. VARIABLES & RESET (SCOPED)
   ========================================================================== */

/* 変数を :root ではなくラッパーに定義することで、
   外部（ヘッダー・フッター）への干渉を防ぎます
*/
.aston-premium-wrapper {
    /* 背景色 */
    --bg-main: #0f0b0c; 
    --bg-secondary: #181214;
    
    /* テキスト色 */
    --text-primary: #e6e6e6;
    --text-secondary: #ffffff;
    
    /* アクセントカラー (Deep Burgundy) */
    --accent-color: #9e1b32;
    --accent-glow: rgba(158, 27, 50, 0.4);
    
    /* フォント */
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Cormorant Garamond', serif;

    /* bodyタグに当てていたスタイルをここに移動 */
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 200;
    line-height: 1.8;
    letter-spacing: 0.05em;
    width: 100%;
    position: relative;
    /* 箱の中で文字サイズ計算の基準を作る */
    font-size: 16px; 
}

/* ラッパー内のリンクのみに適用 */
.aston-premium-wrapper a {
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* スクロールバー設定（これはブラウザ全体に効くためグローバルのままでもOKですが、念のため残します） */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f0b0c; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9e1b32; }

/* ==========================================================================
   2. TYPOGRAPHY & UTILITIES
   ========================================================================== */

/* .container などの汎用クラスもラッパー内限定にする */
.aston-premium-wrapper .container { max-width: 1400px; margin: 0 auto; padding: 0 4vw; }
.aston-premium-wrapper .container.narrow { max-width: 800px; }

.aston-premium-wrapper .text-italic { font-family: var(--font-serif); font-style: italic; font-weight: 300; }
.aston-premium-wrapper .mt-large { margin-top: 40px; }
.aston-premium-wrapper .mb-large { margin-bottom: 80px; }

.aston-premium-wrapper .accent-color { 
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
}

.aston-premium-wrapper .section-heading {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 200;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.aston-premium-wrapper .sub-heading {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.aston-premium-wrapper .lead-paragraph {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* JSアニメーション状態 */
.aston-premium-wrapper .js-fade-up.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ==========================================================================
   3. COMPONENTS
   ========================================================================== */

/* プレミアムリンクボタン */
.aston-premium-wrapper .btn-link-premium {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.aston-premium-wrapper .btn-link-premium .arrow { transition: transform 0.3s; }

.aston-premium-wrapper .btn-link-premium::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    transition: left 0.6s ease;
}

.aston-premium-wrapper .btn-link-premium:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}
.aston-premium-wrapper .btn-link-premium:hover .arrow { transform: translateX(10px); }
.aston-premium-wrapper .btn-link-premium:hover::after { left: 100%; }

/* アクションボタン */
.aston-premium-wrapper .product-actions {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.aston-premium-wrapper .btn-action {
    display: inline-block;
    padding: 12px 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-width: 180px;
    text-align: center;
    transition: all 0.3s ease;
}

.aston-premium-wrapper .btn-buy {
    background-color: var(--accent-color);
    color: #fff;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(158, 27, 50, 0.3);
}
.aston-premium-wrapper .btn-buy:hover {
    background-color: #fff;
    color: var(--accent-color);
}

.aston-premium-wrapper .btn-manual {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.2);
}
.aston-premium-wrapper .btn-manual:hover {
    border-color: #fff;
    color: #fff;
}

/* ==========================================================================
   4. NAVIGATION (Brand Nav)
   ========================================================================== */

.aston-premium-wrapper .brand-nav-sticky {
    position: sticky;
    top: 80px;
    z-index: 999;
    width: 100%;
    padding: 20px 0;
    background: rgba(15, 11, 12, 0.85); 
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.aston-premium-wrapper .brand-nav-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.aston-premium-wrapper .brand-nav-list li a {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s;
}

/* ホバー時の下線 */
.aston-premium-wrapper .brand-nav-list li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.aston-premium-wrapper .brand-nav-list li a:hover { color: #fff; }
.aston-premium-wrapper .brand-nav-list li a:hover::after { width: 100%; }

/* 現在地ハイライト */
.aston-premium-wrapper .brand-nav-list li a.current {
    color: #fff !important;
    opacity: 1 !important;
}
.aston-premium-wrapper .brand-nav-list li a.current::after {
    width: 100% !important;
    background-color: #9e1b32 !important;
}

/* ==========================================================================
   5. HERO SECTION (Global)
   ========================================================================== */

.aston-premium-wrapper .hero-premium {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    text-align: center;
    margin-bottom: -200px; 
    z-index: 1; 
}

.aston-premium-wrapper .hero-image-wrap {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.aston-premium-wrapper .hero-image-wrap::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(15,11,12,0.5) 0%, rgba(15,11,12,0.8) 100%);
    z-index: 1;
}

.aston-premium-wrapper .hero-img {
    width: 100%;
    height: 120%; 
    margin-top: -10%; 
    object-fit: cover;
    z-index: 0;
}

.aston-premium-wrapper .hero-content-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
    margin: 0 auto !important;
}

.aston-premium-wrapper .brand-title {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.1;
    margin: 0 0 40px 0;
    width: 100%;
}

.aston-premium-wrapper .hero-logo-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
}

.aston-premium-wrapper .hero-logo {
    width: 250px; 
    height: auto;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

.aston-premium-wrapper .scroll-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 40px;
}

/* ==========================================================================
   6. SECTIONS (General)
   ========================================================================== */

.aston-premium-wrapper .philosophy-premium { padding: 180px 0; text-align: center; }
.aston-premium-wrapper .section-padding { padding: 100px 0; }
.aston-premium-wrapper .footer-premium { padding: 100px 0; border-top: 1px solid rgba(255,255,255,0.05); font-size: 0.8rem; color: var(--text-secondary); }

/* ==========================================================================
   7. PRODUCT LIST (Index Page)
   ========================================================================== */

.aston-premium-wrapper .products-premium { padding-bottom: 180px; }
.aston-premium-wrapper .product-list { display: flex; flex-direction: column; gap: 150px; }

.aston-premium-wrapper .product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}
.aston-premium-wrapper .product-item.layout-right { flex-direction: row-reverse; }
.aston-premium-wrapper .product-visual-col { flex: 1 1 50%; position: relative; }
.aston-premium-wrapper .product-info-col { flex: 1 1 40%; }

.aston-premium-wrapper .img-reveal-wrap {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-secondary);
}
.aston-premium-wrapper .product-img {
    width: 100%;
    display: block;
    transition: transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.aston-premium-wrapper .img-link:hover .product-img { transform: scale(1.03); }

.aston-premium-wrapper .model-number { font-family: var(--font-serif); font-style: italic; color: var(--accent-color); font-size: 1.2rem; }
.aston-premium-wrapper .product-name { font-size: 3rem; font-weight: 200; margin: 0 0 10px 0; }
.aston-premium-wrapper .product-tagline { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 30px; }
.aston-premium-wrapper .product-desc { color: var(--text-secondary); margin-bottom: 50px; max-width: 400px; }

/* ==========================================================================
   8. PRODUCT DETAILS (Product Page)
   ========================================================================== */

/* Product Page Hero */
.aston-premium-wrapper .product-hero-section {
    height: auto;
    min-height: 80vh;
    padding: 120px 0 80px;
}
.aston-premium-wrapper .product-title { font-size: 3rem; margin-bottom: 10px; }

/* --- ギャラリー --- */
.aston-premium-wrapper .product-gallery-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.aston-premium-wrapper .gallery-main-stage {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.aston-premium-wrapper .main-img-entity {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6));
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: zoom-in;
    position: relative !important;
    z-index: 10 !important;
    pointer-events: auto !important;
}
.aston-premium-wrapper .main-img-entity:hover { transform: scale(1.02); }

.aston-premium-wrapper .stage-backdrop { z-index: 0 !important; pointer-events: none !important; }

.aston-premium-wrapper .gallery-thumbnails { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.aston-premium-wrapper .thumb-item {
    width: 80px; height: 80px;
    border: 1px solid #333; background: #000;
    cursor: pointer; transition: all 0.3s; opacity: 0.6;
    display: flex; align-items: center; justify-content: center; padding: 5px;
}
.aston-premium-wrapper .thumb-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aston-premium-wrapper .thumb-item:hover { opacity: 1; border-color: #666; }
.aston-premium-wrapper .thumb-item.active { opacity: 1; border-color: var(--accent-color); box-shadow: 0 0 10px var(--accent-color); }

/* --- スペック表 --- */
.aston-premium-wrapper .specs-container {
    background: #161214;
    padding: 50px;
    border: 1px solid #333;
}
.aston-premium-wrapper .specs-title { border-bottom: 1px solid #333; padding-bottom: 20px; margin-bottom: 30px; }

/* ==========================================================================
   9. LIGHTBOX (Modal)
   ========================================================================== */
/* ライトボックスは通常body直下やz-index最前面に来るため、wrapper外でも動くようにするか、
   もしくはwrapper内にあるならプレフィックスをつける。今回はwrapper内に置く想定でつけます。 */
.aston-premium-wrapper .lightbox-overlay, 
/* wrapperの外に配置した場合の保険として、IDでも指定 */
#img-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center; align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}
.aston-premium-wrapper .lightbox-overlay.active,
#img-lightbox.active { display: flex; opacity: 1; }

.aston-premium-wrapper .lightbox-overlay img,
#img-lightbox img {
    max-width: 90%; max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transform: scale(0.9); transition: transform 0.3s ease;
    cursor: zoom-out;
}
.aston-premium-wrapper .lightbox-overlay.active img,
#img-lightbox.active img { transform: scale(1); }

.aston-premium-wrapper .lightbox-close,
#img-lightbox .lightbox-close {
    position: absolute; top: 20px; right: 30px;
    color: #fff; font-size: 40px; font-weight: bold;
    cursor: pointer; transition: color 0.3s; z-index: 10001;
}
.aston-premium-wrapper .lightbox-close:hover,
#img-lightbox .lightbox-close:hover { color: var(--accent-color); }


/* ==========================================================================
   10. MEDIA QUERIES (Mobile & PC Specifics)
   ========================================================================== */

/* --- PC専用設定 (レイアウト保持) --- */
@media (min-width: 769px) {
    .aston-premium-wrapper .product-hero-section {
        height: auto !important;
        min-height: 80vh !important;
        padding-top: 150px !important;
        padding-bottom: 100px !important;
        margin-bottom: 0 !important; 
    }
    
    .aston-premium-wrapper .section-padding {
        margin-top: 0 !important;
        padding-top: 100px !important;
    }

    .aston-premium-wrapper .specs-list {
        display: grid !important;
        grid-template-columns: max-content 1fr !important;
        gap: 15px 40px !important;
        margin: 0;
    }
    .aston-premium-wrapper .specs-label {
        color: var(--text-secondary) !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        margin-top: 0 !important;
    }
    .aston-premium-wrapper .specs-value {
        color: var(--text-primary) !important;
        margin: 0 !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .aston-premium-wrapper .product-actions {
        flex-direction: row !important;
        gap: 20px !important;
    }
    .aston-premium-wrapper .btn-action { width: auto !important; }
}


/* --- スマホ専用設定 (Mobile Overrides) --- */
@media (max-width: 768px) {
    
    /* ブランドナビ */
    .aston-premium-wrapper .brand-nav-sticky .container { width: 100% !important; max-width: 100% !important; padding: 0 !important; }
    .aston-premium-wrapper .brand-nav-list {
        display: flex !important; justify-content: flex-start !important; flex-wrap: nowrap !important;
        width: 100% !important; overflow-x: auto !important;
        padding: 0 20px !important; gap: 30px !important;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none; scrollbar-width: none;
    }
    .aston-premium-wrapper .brand-nav-list::-webkit-scrollbar { display: none; }
    .aston-premium-wrapper .brand-nav-list li { flex: 0 0 auto !important; flex-shrink: 0 !important; }
    .aston-premium-wrapper .brand-nav-list li a { font-size: 0.8rem; display: block; padding: 5px 0; white-space: nowrap !important; }

    /* Indexページ HERO修正 (重要：ナビ被り解消) */
    .aston-premium-wrapper section.hero-premium:not(.product-hero-section) {
        height: auto !important; min-height: 100vh !important;
        padding-top: 100px !important; padding-bottom: 120px !important;
        display: flex !important; flex-direction: column !important;
        justify-content: center !important; align-items: center !important;
        
        /* ★重要: ここを0にすることでナビの重なりを回避 */
        margin-bottom: 0 !important; 
    }
    .aston-premium-wrapper section.hero-premium:not(.product-hero-section) .hero-logo {
        width: 90px !important; height: auto !important; margin-bottom: 20px !important;
        display: block !important; visibility: visible !important; opacity: 1 !important;
    }
    .aston-premium-wrapper section.hero-premium:not(.product-hero-section) .brand-title { font-size: 2.2rem !important; }

    /* 製品ページ HERO修正 */
    .aston-premium-wrapper .product-hero-section {
        margin-bottom: 0 !important;
        height: auto !important; min-height: auto !important;
        padding: 100px 0 60px !important;
    }
    .aston-premium-wrapper .product-hero-section + section,
    .aston-premium-wrapper .section-padding {
        margin-top: 50px !important; padding-top: 0 !important;
        position: relative !important; z-index: 10 !important;
        background-color: var(--bg-main);
    }
    .aston-premium-wrapper .hero-content-wrap { margin-bottom: 40px !important; }

    /* 製品画像リスト (Index) */
    .aston-premium-wrapper .img-reveal-wrap { width: 100% !important; height: 280px !important; display: flex !important; align-items: center !important; justify-content: center !important; margin: 0 auto 20px !important; }
    .aston-premium-wrapper .product-img { width: 100% !important; height: 100% !important; object-fit: contain !important; padding: 10px !important; }
    .aston-premium-wrapper .product-item { display: flex !important; flex-direction: column !important; gap: 20px !important; margin-bottom: 60px !important; }
    .aston-premium-wrapper .product-visual-col, .aston-premium-wrapper .product-info-col { width: 100% !important; max-width: 100% !important; flex: 0 0 auto !important; }

    /* 製品ギャラリー (詳細) */
    .aston-premium-wrapper .gallery-main-stage { height: 300px; }
    .aston-premium-wrapper .gallery-thumbnails { justify-content: flex-start; overflow-x: auto; padding-bottom: 10px; flex-wrap: nowrap; }
    .aston-premium-wrapper .thumb-item { flex-shrink: 0; width: 60px; height: 60px; }

    /* タイトル & テキスト */
    .aston-premium-wrapper .product-title { font-size: 2rem; }
    .aston-premium-wrapper .lead-paragraph { font-size: 0.95rem; text-align: left !important; }

    /* アクションボタン (縦並び) */
    .aston-premium-wrapper .product-actions { flex-direction: column; align-items: center; gap: 15px; }
    .aston-premium-wrapper .btn-action { width: 100%; max-width: 300px; }

    /* スペック表 (縦積み) */
    .aston-premium-wrapper .specs-container { padding: 25px 20px; }
    .aston-premium-wrapper .specs-list { display: block; }
    .aston-premium-wrapper .specs-label {
        display: block; margin-top: 15px; font-size: 0.85rem;
        white-space: normal; color: #888;
    }
    .aston-premium-wrapper .specs-label:first-child { margin-top: 0; }
    .aston-premium-wrapper .specs-value {
        display: block; font-size: 1rem;
        margin-left: 0; padding-left: 0;
        border-bottom: 1px solid #333; padding-bottom: 5px; margin-bottom: 5px;
    }

    /* Overviewなどのテキスト幅と余白の調整 */
    .aston-premium-wrapper .container.narrow {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 30px !important;
        padding-right: 30px !important;
        box-sizing: border-box !important;
    }
}