/**
 * g-page-v2 DMM Service ページ用 CSS
 *
 * 旧 g-page の _page-dmm-service.scss を CSS化。
 * - flipbook position:fixed の .page-dmm-service ラッパーは削除（v2ではdoc flow）
 * - Floor Browser のスライドUI（#floorBrowser）はそのまま
 */

.dmm-service-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    color: #f5f5f7;
    background: #0e0e11;
    min-height: 600px;
}

.dmm-service-page .page-header {
    margin: 0 0 16px;
}

.dmm-service-page .page-title {
    font-size: 1.6rem;
    margin: 0 0 8px;
    color: #fff;
}

.dmm-service-page .page-lead {
    font-size: 0.95rem;
    color: #b5b5c0;
    margin: 0;
}

/* ========================================
 *  API Credit Bar
 * ======================================== */
.api-credit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 12px;
    background: #0f0f0f;
    border-radius: 6px;
    margin-bottom: 12px;
}

.api-credit-bar .api-credit {
    display: flex;
    align-items: center;
}

.api-credit-bar .api-credit img {
    display: block;
    height: 35px;
    width: auto;
}

.api-credit-bar .search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 14px;
    background: #1a1a1f;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.api-credit-bar .search-button:hover {
    background: #222228;
}

.api-credit-bar .search-button:active {
    background: #141417;
}

/* ========================================
 *  Floor Browser（上からスライド）
 * ======================================== */
#floorBrowser {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0f0f11;
    color: #fff;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
    visibility: hidden;
}

#floorBrowser.open {
    transform: translateY(0);
    visibility: visible;
}

#floorBrowser #fb-inner {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px 80px;
}

#floorBrowser .fb-site h2 {
    margin-top: 24px;
    color: #fff;
    font-size: 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

#floorBrowser .fb-site h3 {
    color: #eaeaea;
}

#floorBrowser .fb-group {
    margin-top: 20px;
}

#floorBrowser .fb-group button {
    margin: 2px 4px 2px 0;
}

.fb-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.fb-group-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cfcfcf;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.fb-keyword {
    flex: 0 0 140px;
    max-width: 160px;
    padding: 6px 10px;
    font-size: 0.8rem;
    line-height: 1.2;
    color: #eaeaea;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.fb-keyword::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.fb-keyword:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.fb-site:nth-of-type(2) .fb-keyword:focus {
    border-color: #ff5a5f;
    box-shadow: 0 0 0 2px rgba(255, 90, 95, 0.3);
}

.fb-floor {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 14px;
    background: #1f1f25;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.fb-floor:hover {
    background: #2a2a32;
    border-color: rgba(255, 255, 255, 0.28);
}

.fb-floor:active {
    transform: translateY(1px);
}

/* ========================================
 *  Age Gate (FANZA)
 * ======================================== */
.age-gate {
    padding: 32px 16px;
    border: 1px solid #444;
    background: #111;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    margin: 24px auto;
    max-width: 480px;
}

.age-gate p {
    margin-bottom: 20px;
    font-size: 16px;
    letter-spacing: 0.05em;
    line-height: 1.6;
    color: #ffecec;
}

.age-gate button {
    appearance: none;
    border: none;
    outline: none;
    cursor: pointer;
    min-width: 220px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #fff;
    background: linear-gradient(180deg, #c62828, #8e0000);
    border-radius: 6px;
    box-shadow: 0 4px 0 #5c0000, 0 8px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.age-gate button:hover {
    background: linear-gradient(180deg, #d32f2f, #9a0000);
}

.age-gate button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #5c0000, 0 4px 8px rgba(0, 0, 0, 0.35);
}

/* ========================================
 *  商品カードグリッド
 * ======================================== */
.dmm-affiliate-main-frame {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

@media (max-width: 640px) {
    .dmm-affiliate-main-frame {
        gap: 14px;
        padding: 12px 0;
    }
}

.af-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px;
    color: #b5b5c0;
}

.af-card {
    background: #15151b;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.af-card h3 {
    font-size: 1rem;
    margin: 1.5rem 4px 0;
    color: #e4dfdf;
}

.af-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.af-card:hover .af-thumb img {
    transform: scale(1.06);
}

.af-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #000;
    overflow: hidden;
    display: block;
}

.af-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.af-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 16px;
}

.af-title {
    font-size: 14px;
    line-height: 1.5;
    color: #f5f5f7;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 640px) {
    .af-title { font-size: 13px; }
}

.af-actress {
    font-size: 12px;
    color: #b5b5c0;
}

.af-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 8px;
}

.af-price {
    font-size: 16px;
    font-weight: 700;
    color: #ff4d4f;
    margin-left: 8px;
}

.af-rating {
    font-size: 12px;
    color: #b5b5c0;
}

.af-rating.muted {
    opacity: 0.7;
}

.af-genres {
    font-size: 11px;
    color: #ffd166;
}

.af-genres span {
    display: inline-block;
    background: rgba(255, 209, 102, 0.1);
    padding: 4px 8px;
    border-radius: 999px;
    margin: 2px 4px 2px 0;
}

.af-genres:empty {
    display: none;
}

@media (hover: none) {
    .af-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    }

    .af-card:hover .af-thumb img {
        transform: none;
    }
}
