/* --- Fflipp Catalog Plus: Core Theme --- */
/* --- Fflipp Catalog Plus: Rakuten-Style Theme --- */
:root {
    --rakuten-red: #bf1932;
    --nav-gray: #f6f6f6;
    --border-gray: #e0e0e0;
    --text-dark: #333333;
    --text-light: #666666;
}

body.catalog-theme {
    /* 1. Force the removal of any inherited background images */
    background-image: none !important; 
    
    /* 2. Set the clean, bright white background */
    background-color: #ffffff !important; 
    
    /* 3. Ensure no other background properties interfere */
    background-attachment: scroll !important;
    background-size: auto !important;

    color: var(--text-dark);
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* 1. Header */
.c-header {
    background: #fff;
    padding: 10px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.c-logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.c-logo-img {
    height: 28px; /* Slightly more compact for professional look */
    width: auto;
}

.c-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #003e67;
    white-space: nowrap;
}

.c-logo-plus { color: var(--rakuten-red); font-style: italic; }

/* =========================================
   PROFESSIONAL FLUID GRID (Rakuten Standard)
   ========================================= */

/* 1. Base Grid (Desktop): 6 Cards */
.scroller-container, 
.c-catalog-grid-full {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 20px;
    width: 100%;
    margin-top: 15px;
}

/* 2. Tablets (iPad / 1024px): 3 Cards */
@media (max-width: 1024px) {
    .scroller-container, 
    .c-catalog-grid-full {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 15px;
    }
}

/* 3. Mobile Phones (600px): 2 Cards */
@media (max-width: 600px) {
    .scroller-container, 
    .c-catalog-grid-full {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px;
    }
}

/* --- CARD POLISH (Fixing "Various Sizes" issue) --- */
.zine-card {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    width: 100%;
    min-width: 0; /* Prevents overflow */
}

.zine-cover-wrapper {
    width: 100%;
    /* ENFORCE UNIFORM SIZE: This forces all covers to be the same height */
    aspect-ratio: 3 / 4 !important; 
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
}

.zine-cover-img {
    width: 100%;
    height: 100%;
    /* This ensures images fill the 3:4 box without stretching */
    object-fit: cover !important; 
}

.zine-info {
    padding: 10px 0;
}

.zine-info h3 {
    font-size: 0.9rem;
    line-height: 1.3;
    margin: 0;
    color: #1e3a8a;
    font-weight: 700;
    /* Truncate long titles to 1 line */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Merchant Tag styling for consistency */
.merchant-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.merchant-name {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* --- FULL LIST DROPDOWN STYLING --- */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    z-index: 9999 !important; /* MUST BE HIGHEST to overlap search bar */
    padding: 10px 0;
}

.dropdown-wrapper:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.85rem;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: #bf1932;
}

/* --- AVATAR & LOGIN STYLING --- */
.c-avatar-trigger {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Clips the image into a circle */
    background: #f8fafc;
    text-decoration: none;
    transition: border-color 0.2s;
}

.c-avatar-trigger:hover {
    border-color: var(--rakuten-red);
}

.c-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c-avatar-emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.c-login-link {
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.c-login-link:hover {
    transform: scale(1.1);
}

/* 2. Gray Navigation Bar */
.c-quick-nav {
    background-color: var(--nav-gray);
    border-bottom: 1px solid var(--border-gray);
    padding: 0 15px;
    height: 50px;
    display: flex;
    align-items: center;
    overflow-x: auto; /* Enable horizontal swipe */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.nav-links {
    display: flex;
    gap: 20px;
    margin: 0 auto; /* Centers on desktop, allows pull-left on mobile */
}

.nav-links a { 
    text-decoration: none; 
    color: #555; 
    font-size: 0.8rem; 
    font-weight: 700; 
    white-space: nowrap; 
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--rakuten-red); border-bottom: 2px solid var(--rakuten-red); }

/* Hide scrollbar but keep functionality */
.c-quick-nav::-webkit-scrollbar { display: none; }
.c-quick-nav { -ms-overflow-style: none; scrollbar-width: none; }

/* 3. Search Bar Area */
.c-search-section { padding: 20px 40px; background: #fff; position: relative;
    z-index: 500; /* Lower than the navigation dropdown */ }
.c-search-container {
    max-width: 850px; 
    margin: 0 auto; 
    display: flex;
    align-items: center;
    border: 1px solid #ccc; /* Changed to grey */
    border-radius: 4px; 
    overflow: hidden;
    background: #fff;
}

.c-search-logo {
    padding: 0 15px;
    height: 24px;
    border-right: 1px solid #eee;
}

.c-search-container input { 
    flex: 1; 
    border: none; 
    padding: 12px 15px; 
    outline: none; 
    font-size: 1rem; 
}

.c-search-container button { 
    background: var(--rakuten-red); 
    color: white; 
    border: none; 
    width: 60px; /* Square button for SVG */
    height: 50px;
    cursor: pointer; 
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. Promo Carousel */
/* --- RAKUTEN-STYLE SLIDER --- */
.c-slider-container {
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden; /* Hide the extra banners */
    position: relative;
    aspect-ratio: 3 / 1; /* Matches 1200x400 */
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.c-slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth slide */
}

.c-slide {
    min-width: 100%;
    height: 100%;
}

.c-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dots Navigation */
.c-slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.dot.active {
    background: var(--rakuten-red);
    width: 25px; /* Pill shape for the active slide */
    border-radius: 10px;
}

@media (max-width: 768px) {
    .c-slider-container { aspect-ratio: 2 / 1; width: calc(100% - 20px); }
}

/* 5. 2-Column Layout */
.catalog-layout {
    display: flex;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
    gap: 30px;
    background-color: #ffffff;
}

/* Sidebar */
.c-sidebar { width: 260px; flex-shrink: 0; }
/* --- SIDEBAR REFINEMENT --- */
.c-side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px solid var(--nav-gray);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.c-side-link:hover, 
.c-side-link.active {
    background: #fff5f5; /* Light crimson tint */
    color: var(--rakuten-red);
}

/* (NEW) FORCED CRIMSON SVG STYLE */
.c-side-link svg {
    width: 20px;
    height: 20px;
    fill: var(--rakuten-red) !important; /* Force Rakuten Crimson */
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.c-side-link:hover svg {
    transform: scale(1.15);
}

.c-side-link.active svg {
    filter: drop-shadow(0 0 5px rgba(191, 25, 50, 0.3));
}

/* Main rows */
/* Optional: If you want that subtle light-grey contrast in the main area 
      like Rakuten, apply it to the main content wrapper instead of the whole body */
.c-main-content {
    background-color: #ffffff; /* Keep main content pure white */
    flex: 1;
    min-width: 0;
}
.c-row-section { margin-bottom: 40px; }
.c-row-title { font-size: 1.2rem; font-weight: 800; border-bottom: 2px solid var(--rakuten-red); padding-bottom: 8px; margin-bottom: 20px; }

/* Responsive */
@media (max-width: 1024px) {
    .c-sidebar { display: none; }
    .c-header, .c-quick-nav { padding: 10px 20px; }
}

/* --- GRID FOR FILTERED RESULTS --- */
.c-catalog-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    width: 100%;
}

/* Card Improvements */
.zine-card { transition: transform 0.3s ease; }
.zine-card:hover { transform: translateY(-5px); }
.merchant-tag { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.merchant-name { font-size: 0.75rem; color: #64748b; font-weight: 600; }


/* --- CATEGORY TITLE ICONS --- */
.c-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.c-title-icon svg {
    width: 28px; /* Slightly larger for headings */
    height: 28px;
    fill: var(--rakuten-red) !important; /* Enforce Crimson color */
    vertical-align: middle;
}

/* Ensure the title text and icon are perfectly level */
.c-row-title {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9; /* Subtle separator */
}

/* Mobile Tweak for Heading Icons */
@media (max-width: 600px) {
    .c-title-icon svg {
        width: 22px;
        height: 22px;
    }
    .c-row-title {
        font-size: 1.1rem;
    }
}


/* 6. MERCHANT SECTION (White Theme) */
.c-merchant-section {
    background: #ffffff;
    border-top: 1px solid var(--border-gray);
    padding: 60px 20px;
    text-align: center;
}

.c-merchant-section h2 {
    color: var(--text-dark);
    font-size: 2rem;
    margin: 0 0 10px 0;
    font-weight: 800;
}

.c-merchant-btn {
    background: var(--rakuten-red);
    color: #ffffff;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    display: inline-block;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(191, 25, 50, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.c-merchant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 25, 50, 0.3);
}

/* 7. HEADER AVATAR */
.c-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-gray);
    display: block;
}

/* --- MERCHANT DROPDOWN (Light Theme) --- */

#c-profile-dropdown {
    z-index: 10000 !important;
}

.c-profile-wrapper { position: relative; }
.c-profile-btn { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1px solid #ddd; cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 0; }
.c-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.c-avatar-emoji { font-size: 1.4rem; }

.c-dropdown-content {
    display: none; position: absolute; right: 0; top: 45px;
    background-color: #ffffff; min-width: 200px;
    border-radius: 8px; border: 1px solid #ddd;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 5000;
    padding: 10px 0;
}
.c-dropdown-content.show { display: block; }
.c-dropdown-content a {
    color: #333; padding: 10px 20px; text-decoration: none;
    display: flex; align-items: center; gap: 12px; font-size: 0.9rem; font-weight: 600;
}
.c-dropdown-content a:hover { background-color: #f8fafc; color: #bf1932; }
.c-dropdown-header { padding: 10px 20px; border-bottom: 1px solid #eee; margin-bottom: 5px; font-size: 0.8rem; color: #999; }

/* --- ICON SCALING FIX --- */
.menu-icon {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
    fill: #666;
}

.c-dropdown-content a:hover .menu-icon {
    fill: var(--rakuten-red);
}

.c-page-link {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: 700;
    transition: all 0.2s;
}

.c-page-link.active {
    background-color: var(--rakuten-red);
    color: white;
    border-color: var(--rakuten-red);
}

.c-page-link:hover:not(.active) {
    border-color: var(--rakuten-red);
    color: var(--rakuten-red);
}

/* --------------------------- 
MERCHANT SHOWCASE (HUB BOTTOM)
--------------------------- */
.c-merchant-showcase {
    background-color: #f8fafc; /* Light Grey background for section contrast */
    padding: 80px 20px;
    border-top: 1px solid #e2e8f0;
}

.cms-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* Content slightly wider than image */
    align-items: center;
    gap: 50px;
}

.cms-badge {
    background: rgba(191, 25, 50, 0.1);
    color: var(--rakuten-red);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 15px;
}

.cms-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #003e67;
    line-height: 1.2;
    margin: 0 0 20px 0;
}

.cms-highlight { color: var(--rakuten-red); }

.cms-lead {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 30px;
}

.cms-feature-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.cms-feature-item {
    display: flex;
    gap: 15px;
    text-align: left;
}

.cms-feature-item svg {
    width: 24px;
    height: 24px;
    fill: var(--rakuten-red);
    flex-shrink: 0;
}

.cms-feature-item strong {
    display: block;
    font-size: 0.95rem;
    color: #1e293b;
}

.cms-feature-item span {
    font-size: 0.85rem;
    color: #64748b;
}

.btn-cms-primary {
    background: var(--rakuten-red);
    color: white;
    padding: 18px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    display: inline-block;
    transition: 0.3s;
    box-shadow: 0 10px 20px rgba(191, 25, 50, 0.2);
}

.btn-cms-primary:hover {
    background: #a0152a;
    transform: translateY(-2px);
}

/* Visual Column Tweak */
.cms-mockup-platform {
    position: relative;
    padding: 20px;
}

.cms-main-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.1));
    transition: transform 0.4s ease;
}

.cms-visual:hover .cms-main-img {
    transform: scale(1.03);
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .cms-container { grid-template-columns: 1fr; text-align: center; }
    .cms-feature-item { justify-content: center; }
    .cms-title { font-size: 1.8rem; }
    .cms-visual { order: -1; } /* Image on top for mobile */
}

