:root {
    --bg-color: #000;
    --text-color: #fff;
    --accent-color: #ff0055;
    --overlay-gradient: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0) 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Vertical Scroll Snap Container */
.scroll-container {
    height: 100%;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* Individual Video Page - Centering Logic */
.video-page {
    height: 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    justify-content: center;
    /* Center Horizontal */
    align-items: center;
    /* Center Vertical */
    background-color: #000;
    overflow: hidden;
}

/* Video Wrapper - Full Width */
.video-wrapper {
    width: 100vw;
    /* Full Viewport Width */
    aspect-ratio: 16 / 9;
    /* Maintain Aspect Ratio */
    background: #000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.iframe-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    color: #444;
}

/* Info Overlay at Bottom */
.video-overlay {
    position: absolute;
    /* Dynamic bottom based on JS calculation of Nav Height */
    bottom: var(--nav-height, 80px);
    left: 0;
    width: 100%;
    background: var(--overlay-gradient);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    /* Internal padding only */
    z-index: 10;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    width: 100%;
}

.jacket-link {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    display: block;
    background: #333;
}

.jacket-link:active {
    transform: scale(0.95);
}

.jacket-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    min-width: 0;
    /* Critical for truncation */
}

.product-title-link {
    text-decoration: none;
    color: #fff;
    display: block;
    cursor: pointer;
    min-width: 0;
}

.product-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

.product-meta {
    display: block;
    font-size: 12px;
    color: #ddd;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.actress-name {
    color: #fff;
    font-weight: bold;
    /* Ensure span also respects usage if needed, but block container handles it */
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-between;
    /* Separate Brand and Title */
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 50;
    pointer-events: none;
    padding: 0 20px;
    /* Side padding */
}

/* Brand Styles */
.brand-container {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    /* Allow brand interaction if needed */
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* Optional: make round */
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(45deg, #ff00cc, #3333ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#header-title {
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    /* Safe Area for iPhone Home Indicator */
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 11px;
    gap: 6px;
    transition: color 0.2s;
}

.nav-item.active {
    color: #fff;
}

.nav-item svg {
    width: 26px;
    height: 26px;
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    /* Reduced top padding to fit suggestions */
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: auto;
    overflow-y: auto;
    /* Allow scrolling if many suggestions */
}

.search-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.search-container {
    width: 85%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-box {
    width: 100%;
    display: flex;
    gap: 8px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #222;
    color: #fff;
    font-size: 16px;
}

.search-box button {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

/* Suggestions Styles */
.search-suggestions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
    /* Spacing for scrolling */
}

.suggestion-group h3 {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
    font-weight: 600;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    padding: 8px 16px;
    background: #333;
    border-radius: 20px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}

.suggestion-chip:active {
    transform: scale(0.95);
    background: #444;
}

.suggestion-chip:hover {
    background: #444;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
}

/* Loading Spinner */
.loading-spinner {
    padding: 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Mobile / Vertical Layout Adjustments --- */
@media (max-width: 768px) {

    /* Use block/absolute layout for strict control */
    .video-page {
        display: block;
        position: relative;
    }

    /* Video wrapper: Absolutely centered */
    .video-wrapper {
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        background: #000;
        margin: 0;
    }

    /* Info Overlay: Positioned relative to center, pushed down by half video height */
    /* Video Height = 100vw * (9/16) = 56.25vw. Half = 28.125vw */
    .video-overlay {
        position: absolute;
        top: 50%;
        left: 0;
        bottom: auto;
        /* Reset */
        width: 100%;
        height: auto;
        background: none;

        display: flex;
        flex-direction: column;
        justify-content: flex-start;

        /* Push down by half video height + padding */
        margin-top: 28.2vw;
        padding: 10px 15px calc(80px + env(safe-area-inset-bottom)) 15px;
        pointer-events: auto;
    }

    .text-info {
        text-shadow: none;
    }

    .product-title-link,
    .actress-name,
    .product-meta {
        /* Keep truncation logic */
    }
}