/* ============================================
   Affiliate Blog — Design System & Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #ec4899);
    --accent-purple: #7c3aed;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-teal: #14b8a6;
    --accent-orange: #f97316;
    --accent-yellow: #eab308;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);
    --font-main: 'Inter', 'Noto Sans JP', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Utility --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border-radius: 50px;
    background: var(--accent-gradient);
    color: #fff;
    margin-bottom: 12px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 30%, var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 36px;
}

/* --- Header / Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 0 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-search {
    display: flex;
    align-items: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    padding: 6px 14px;
    gap: 8px;
    transition: all var(--transition);
}

.nav-search:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.nav-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 160px;
    font-family: var(--font-main);
}

.nav-search input::placeholder {
    color: var(--text-muted);
}

.nav-search button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    display: flex;
}

.nav-search button:hover {
    color: var(--accent-purple);
}

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    padding: 80px 0 60px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.hero .container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 20px;
}

.hero-text h1 .gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    font-family: var(--font-main);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
    color: #fff;
}

.hero-image {
    flex: 1;
    max-width: 480px;
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* --- Category Nav Pills --- */
.category-nav {
    padding: 20px 0 40px;
}

.category-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 50px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.category-pill:hover,
.category-pill.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.category-pill .pill-icon {
    font-size: 1.1rem;
}

/* --- Featured Section --- */
.featured-section {
    padding: 40px 0 60px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.featured-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(124, 58, 237, 0.3);
    background: var(--bg-card-hover);
}

.featured-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.featured-card-body {
    padding: 20px 24px 24px;
}

.featured-card-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 10px;
}

.featured-card-category.gadget { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.featured-card-category.beauty { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.featured-card-category.fashion { background: rgba(124, 58, 237, 0.2); color: #a78bfa; }
.featured-card-category.food { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.featured-card-category.health { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; }
.featured-card-category.interior { background: rgba(234, 179, 8, 0.2); color: #facc15; }

.featured-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.featured-card-title a:hover {
    color: var(--accent-purple);
}

.featured-card-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.featured-card-price {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.featured-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all var(--transition);
}

.featured-card-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    color: #fff;
}

.featured-card .badge-hot {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.featured-card .badge-new {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, var(--accent-teal), #34d399);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.4);
}

/* Star rating */
.stars {
    color: #facc15;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* --- Content Layout (Main + Sidebar) --- */
.content-layout {
    padding: 40px 0 80px;
}

.content-layout .container {
    display: flex;
    gap: 40px;
}

.main-area {
    flex: 3;
    min-width: 0;
}

.sidebar-area {
    flex: 1;
    min-width: 280px;
}

/* --- Product Grid --- */
.product-section {
    margin-bottom: 60px;
}

.product-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.product-section-title {
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-section-title .icon {
    font-size: 1.4rem;
}

.product-section-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-section-more:hover {
    color: var(--accent-pink);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.product-card-img-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.product-card:hover .product-card-img {
    transform: scale(1.05);
}

.product-card-body {
    padding: 16px;
}

.product-card-cat {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 8px;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

.product-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
}

.product-card-title a:hover {
    color: var(--accent-purple);
}

.product-card-excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-pink);
}

.product-card-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-card-link:hover {
    color: var(--accent-pink);
}

/* --- Sidebar Widgets --- */
.sidebar-widget {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sidebar-widget-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-widget-title .icon {
    font-size: 1.1rem;
}

/* Ranking Widget */
.ranking-list {
    counter-reset: ranking;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    transform: translateX(4px);
}

.ranking-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.ranking-item:nth-child(1) .ranking-number {
    background: linear-gradient(135deg, #ffd700, #f59e0b);
    color: #1a1a2e;
}

.ranking-item:nth-child(2) .ranking-number {
    background: linear-gradient(135deg, #c0c0c0, #94a3b8);
    color: #1a1a2e;
}

.ranking-item:nth-child(3) .ranking-number {
    background: linear-gradient(135deg, #cd7f32, #d97706);
    color: #1a1a2e;
}

.ranking-item:nth-child(n+4) .ranking-number {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.ranking-item-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.ranking-item-info {
    flex: 1;
    min-width: 0;
}

.ranking-item-title {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-item-title a:hover {
    color: var(--accent-purple);
}

.ranking-item-price {
    font-size: 0.75rem;
    color: var(--accent-pink);
    font-weight: 700;
}

/* Category Widget */
.cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.cat-list a:last-child {
    border-bottom: none;
}

.cat-list a:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.cat-list .cat-icon {
    margin-right: 8px;
}

.cat-list .cat-count {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 50px;
    color: var(--text-muted);
}

/* Profile Widget */
.profile-widget {
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 14px;
    border: 3px solid transparent;
    background: var(--accent-gradient) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-name {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 6px;
}

.profile-bio {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.profile-socials {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.profile-socials a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.profile-socials a:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
}

/* --- Footer --- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-glass);
    padding: 48px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .nav-logo {
    margin-bottom: 14px;
    font-size: 1.15rem;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-col a {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 5px 0;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--accent-purple);
}

.footer-bottom {
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.fade-in-up:nth-child(4) { animation-delay: 0.2s; }
.fade-in-up:nth-child(5) { animation-delay: 0.25s; }
.fade-in-up:nth-child(6) { animation-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-image {
        max-width: 400px;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .content-layout .container {
        flex-direction: column;
    }

    .sidebar-area {
        min-width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: block;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-area {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .section-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 1.6rem;
    }

    .category-pills {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 8px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .category-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }
}
