/* ============================================================
   iPretty Wholesale - Frontend Stylesheet
   Design System: Rose/Pink primary, warm neutrals
   ============================================================ */

:root {
    --primary: #C4506A;
    --primary-light: #F8E8EC;
    --primary-dark: #A03D55;
    --accent: #E8B4B8;
    --gold: #C5A55A;
    --text: #1A1A1A;
    --text-light: #666;
    --text-muted: #999;
    --bg: #FFFFFF;
    --bg-gray: #F8F8F8;
    --bg-pink: #FFF5F7;
    --border: #E8E8E8;
    --success: #2ECC71;
    --warning: #F39C12;
    --danger: #E74C3C;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --transition: all 0.2s ease;
    --font: 'Inter', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; border-radius: var(--radius); font-weight: 500; font-size: 14px; cursor: pointer; border: none; transition: var(--transition); text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.5; }
.btn-icon:hover { opacity: 1; }

/* --- Top Bar --- */
.top-bar { background: var(--bg-pink); text-align: center; padding: 8px; font-size: 13px; color: var(--text-light); }

/* --- Header --- */
.header { border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 20px; padding: 12px 20px; }
.logo { display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.logo-text { font-size: 24px; font-weight: 700; letter-spacing: 3px; color: var(--text); }
.logo-sub { font-size: 10px; letter-spacing: 4px; color: var(--primary); }
.header-search { flex: 1; }
.search-form { display: flex; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.search-category { border: none; padding: 10px 12px; background: var(--bg-gray); font-size: 13px; border-right: 1px solid var(--border); }
.search-input { flex: 1; border: none; padding: 10px 16px; font-size: 14px; outline: none; }
.search-btn { background: var(--primary); border: none; color: #fff; padding: 10px 16px; cursor: pointer; font-size: 16px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-btn { background: none; border: none; font-size: 13px; cursor: pointer; color: var(--text); padding: 6px 10px; white-space: nowrap; }
.cart-btn { position: relative; }
.cart-badge { position: absolute; top: -4px; right: -4px; background: var(--primary); color: #fff; font-size: 10px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* --- Dropdowns --- */
.header-dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 150px; z-index: 200; padding: 4px 0; }
.dropdown-menu a { display: block; padding: 8px 16px; font-size: 13px; color: var(--text); }
.dropdown-menu a:hover { background: var(--bg-gray); }
.header-dropdown:hover .dropdown-menu { display: block; }

/* --- Category Nav --- */
.category-nav { border-bottom: 1px solid var(--border); }
.nav-links { display: flex; gap: 4px; overflow-x: auto; }
.nav-link { padding: 12px 16px; font-size: 14px; white-space: nowrap; color: var(--text); font-weight: 500; }
.nav-link:hover { color: var(--primary); border-bottom: 2px solid var(--primary); }
.nav-highlight { color: var(--primary) !important; font-weight: 600; }

/* --- Alerts --- */
.alert { padding: 12px 0; font-size: 14px; }
.alert-success { background: #E8F5E9; color: #2E7D32; }
.alert-error { background: #FFEBEE; color: #C62828; }

/* --- Hero --- */
.hero { background: linear-gradient(135deg, var(--bg-pink) 0%, #FFF0F3 100%); padding: 60px 0; }
.hero-inner { display: flex; align-items: center; gap: 40px; }
.hero-text { flex: 1; }
.hero-text h1 { font-size: 36px; font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
.hero-text p { font-size: 16px; color: var(--text-light); margin-bottom: 24px; }
.hero-features { display: flex; gap: 20px; margin-bottom: 32px; font-size: 13px; color: var(--text-light); }
.hero-buttons { display: flex; gap: 12px; }
.hero-image { flex: 1; text-align: right; }

/* --- Sections --- */
.section { padding: 48px 0; }
.section-gray { background: var(--bg-gray); }
.section-pink { background: var(--bg-pink); }
.section-title { font-size: 24px; font-weight: 600; text-align: center; margin-bottom: 32px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.view-all { font-size: 14px; color: var(--primary); font-weight: 500; }

/* --- Product Grid --- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.product-card-image { position: relative; padding: 16px; background: var(--bg-gray); text-align: center; min-height: 180px; display: flex; align-items: center; justify-content: center; }
.product-card-image img { max-height: 160px; object-fit: contain; }
.product-placeholder { font-size: 60px; opacity: 0.3; }
.btn-wishlist { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.9); border: none; cursor: pointer; font-size: 18px; padding: 4px 8px; border-radius: 50%; }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-bestseller { background: var(--primary); color: #fff; }
.badge-new { background: var(--success); color: #fff; }
.badge-stock { background: #E8F5E9; color: #2E7D32; }
.product-card-info { padding: 16px; }
.product-card-name { font-size: 14px; font-weight: 500; color: var(--text); display: block; margin-bottom: 8px; line-height: 1.4; }
.product-card-price { font-size: 16px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.product-card-moq { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.btn-add-quote { width: 100%; justify-content: center; border: 1.5px solid var(--primary); background: transparent; color: var(--primary); }
.btn-add-quote:hover { background: var(--primary); color: #fff; }

/* --- Category Grid --- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; text-align: center; }
.category-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); transition: var(--transition); color: var(--text); }
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.category-card img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 8px; }

/* --- Brand Strip --- */
.brand-strip { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.brand-logo-card { padding: 16px 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.brand-logo-card img { height: 30px; object-fit: contain; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.brand-card { text-align: center; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); transition: var(--transition); color: var(--text); }
.brand-card:hover { border-color: var(--primary); }
.brand-new { position: relative; }

/* --- Steps --- */
.steps-grid { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.step { text-align: center; padding: 24px; max-width: 200px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; margin-bottom: 12px; }
.step-arrow { font-size: 24px; color: var(--accent); }

/* --- Page Layout (Sidebar + Main) --- */
.page-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 32px 0; }
.sidebar { font-size: 14px; }
.filter-group { margin-bottom: 24px; }
.filter-group h4 { margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.filter-group label { display: block; padding: 4px 0; cursor: pointer; }
.filter-search { width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 8px; font-size: 13px; }
.filter-list { max-height: 200px; overflow-y: auto; }
.price-range { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.price-range input { width: 80px; padding: 6px; border: 1px solid var(--border); border-radius: 4px; }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 14px; color: var(--text-light); }
.sort-select { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; }
.pagination-wrap { margin-top: 32px; text-align: center; }

/* --- Product Detail --- */
.breadcrumb { padding: 16px 0; font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-light); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 24px 0 48px; }
.product-detail-image { background: var(--bg-gray); border-radius: var(--radius); padding: 24px; text-align: center; }
.product-detail-image img { max-height: 400px; object-fit: contain; }
.product-placeholder-lg { font-size: 120px; opacity: 0.2; }
.product-detail-info h1 { font-size: 24px; margin-bottom: 8px; }
.product-brand { font-size: 14px; color: var(--text-light); margin-bottom: 16px; }
.product-desc { font-size: 14px; color: var(--text-light); margin-bottom: 24px; line-height: 1.7; }
.price-block { background: var(--bg-gray); padding: 20px; border-radius: var(--radius); margin-bottom: 24px; }
.price-label { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.price-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.price-unit { font-size: 14px; color: var(--text-light); }
.product-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; font-size: 13px; }
.product-specs strong { display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 2px; }
.stock-in_stock { color: var(--success); }
.stock-low_stock { color: var(--warning); }
.stock-out_of_stock { color: var(--danger); }
.volume-pricing { margin-bottom: 24px; }
.volume-pricing h3 { font-size: 14px; margin-bottom: 8px; }
.table-sm { width: 100%; font-size: 13px; border-collapse: collapse; }
.table-sm th, .table-sm td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.add-to-quote-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.qty-input label { display: block; font-size: 13px; margin-bottom: 4px; }
.qty-input input { width: 100px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 16px; text-align: center; }
.trust-badges { display: flex; gap: 20px; font-size: 13px; color: var(--text-light); }

/* --- Product Tabs --- */
.product-tabs { margin: 40px 0; }
.tab-headers { display: flex; border-bottom: 2px solid var(--border); gap: 4px; }
.tab-btn { padding: 12px 24px; border: none; background: none; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; padding: 24px 0; font-size: 14px; line-height: 1.8; }
.tab-content.active { display: block; }

/* --- RFQ Cart --- */
.rfq-layout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; padding: 24px 0 48px; }
.rfq-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rfq-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rfq-table th { text-align: left; padding: 10px; border-bottom: 2px solid var(--border); font-weight: 500; }
.rfq-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.product-cell { display: flex; align-items: center; gap: 12px; }
.thumb { width: 48px; height: 48px; object-fit: contain; border-radius: 4px; }
.qty-sm { width: 70px; padding: 6px; border: 1px solid var(--border); border-radius: 4px; text-align: center; }
.notes-input { width: 100%; padding: 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.price-cell { font-weight: 600; color: var(--primary); white-space: nowrap; }
.empty-state { text-align: center; padding: 60px; color: var(--text-muted); }
.summary-card { background: var(--bg-gray); padding: 24px; border-radius: var(--radius); margin-bottom: 24px; }
.summary-card h3 { margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.summary-row.total { border-top: 2px solid var(--border); font-weight: 700; font-size: 16px; margin-top: 8px; padding-top: 12px; }
.summary-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.rfq-form { display: flex; flex-direction: column; gap: 12px; }
.rfq-form input, .rfq-form select, .rfq-form textarea { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: var(--font); }
.rfq-form h3 { margin-top: 12px; }

/* --- Page Hero --- */
.page-hero { padding: 40px 0; }
.page-hero h1 { font-size: 32px; margin-bottom: 8px; }
.page-hero p { color: var(--text-light); }
.alpha-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 32px; }
.alpha-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--text); }
.alpha-btn.active, .alpha-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Customer Portal --- */
.portal-layout { display: grid; grid-template-columns: 250px 1fr; gap: 32px; padding: 32px 0; min-height: 600px; }
.portal-sidebar { border-right: 1px solid var(--border); padding-right: 24px; }
.portal-user { text-align: center; margin-bottom: 24px; }
.user-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; margin-bottom: 12px; }
.tier-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tier-badge.vip { background: #FFF3E0; color: #E65100; }
.tier-badge.gold { background: #FFF8E1; color: #FF8F00; }
.tier-badge.silver { background: #F5F5F5; color: #616161; }
.portal-nav a { display: block; padding: 10px 16px; font-size: 14px; color: var(--text); border-radius: var(--radius); margin-bottom: 2px; }
.portal-nav a.active, .portal-nav a:hover { background: var(--primary-light); color: var(--primary); }
.portal-main h1 { font-size: 24px; margin-bottom: 8px; }

/* --- Stats Grid --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-num { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.stat-card a { font-size: 13px; color: var(--primary); }

/* --- Dashboard Grid --- */
.dashboard-grid { display: grid; gap: 24px; margin-bottom: 24px; }
.dashboard-grid.two-col { grid-template-columns: 1fr 1fr; }
.dash-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h3 { font-size: 16px; }
.card-header a { font-size: 13px; color: var(--primary); }

/* --- Tables --- */
.table-compact { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-compact th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border); font-weight: 500; color: var(--text-muted); }
.table-compact td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-draft { background: #F5F5F5; color: #757575; }
.status-sent { background: #E3F2FD; color: #1565C0; }
.status-negotiating { background: #FFF3E0; color: #E65100; }
.status-confirmed { background: #E8F5E9; color: #2E7D32; }
.status-pending { background: #FFF3E0; color: #E65100; }
.status-paid { background: #E8F5E9; color: #2E7D32; }
.status-packed { background: #E3F2FD; color: #1565C0; }
.status-shipped { background: #EDE7F6; color: #4527A0; }
.status-delivered { background: #E8F5E9; color: #2E7D32; }
.status-expired { background: #FFEBEE; color: #C62828; }
.status-cancelled { background: #FFEBEE; color: #C62828; }
.status-new { background: var(--primary-light); color: var(--primary); }
.status-replied { background: #E8F5E9; color: #2E7D32; }
.status-active { background: #E8F5E9; color: #2E7D32; }
.status-inactive { background: #F5F5F5; color: #757575; }

/* --- Auth --- */
.auth-container { display: flex; justify-content: center; padding: 60px 0; }
.auth-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 440px; }
.auth-card h1 { margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.checkbox-label { font-size: 13px; cursor: pointer; margin-bottom: 16px; display: block; }
.auth-link { text-align: center; font-size: 14px; margin-top: 20px; }

/* --- Timeline --- */
.timeline-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.catalog-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

/* --- Footer --- */
.footer-features { background: var(--bg-gray); padding: 24px 0; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; font-size: 13px; }
.feature-icon { font-size: 24px; display: block; margin-bottom: 8px; }
.footer-main { padding: 40px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer-col h4 { font-size: 14px; margin-bottom: 12px; }
.footer-col a, .footer-col p { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0; text-align: center; font-size: 12px; color: var(--text-muted); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .header-search { order: 3; flex-basis: 100%; }
    .hero-inner { flex-direction: column; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .page-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .product-detail { grid-template-columns: 1fr; }
    .rfq-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-layout { grid-template-columns: 1fr; }
    .features-grid, .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); }
}

/* ============================================================
   Category Nav — 点击展开式 mega menu（横スクロール廃止）
   既存の .nav-links / .dropdown-menu:hover を上書きする想定で末尾に追記
   ============================================================ */

/* 横スクロールをやめ、折り返し可能に */
.category-nav .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    overflow: visible;            /* 旧 overflow-x:auto を打ち消す */
    align-items: center;
}

.category-nav .nav-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.header-dropdown { position: relative; }

/* 旧来の hover 展開を無効化（点击式に統一） */
.header-dropdown:hover .dropdown-menu { display: none; }

/* 点击で開くパネル共通 */
.dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    padding: 20px 24px;
}
.header-dropdown.open .dropdown-panel { display: block; }

.nav-toggle .caret { font-size: 11px; transition: transform .15s; display: inline-block; }
.header-dropdown.open .nav-toggle .caret { transform: rotate(180deg); }
.header-dropdown.open .nav-toggle { color: var(--primary); }

/* --- All Products: 多列グリッド --- */
.mega-menu { width: min(960px, 92vw); }
.mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 28px;
}
.mega-col-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.mega-col-title:hover { color: var(--primary); }
.mega-sublist { list-style: none; margin: 0; padding: 0; }
.mega-sublist li { margin: 0; }
.mega-sublist a {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-light, #555);
}
.mega-sublist a:hover { color: var(--primary); }

/* --- All Brands: 名前リストを複数列に --- */
.brand-menu { width: min(720px, 92vw); }
.brand-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.brand-grid a {
    display: block;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-grid a:hover { color: var(--primary); }
.brand-menu-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.brand-menu-footer a { font-size: 13px; font-weight: 600; color: var(--primary); }

/* ============================================================
   モバイル対応（〜768px）：パネルを全幅・1列に
   ============================================================ */
@media (max-width: 768px) {
    .category-nav .nav-links { gap: 0; }
    .header-dropdown { position: static; }       /* パネルを画面幅基準に */

    .dropdown-panel {
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 14px 16px;
    }
    .mega-menu, .brand-menu { width: 100%; }

    .mega-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .brand-grid { grid-template-columns: 1fr 1fr; max-height: 50vh; }

    .category-nav .nav-link { padding: 11px 12px; }
}

@media (max-width: 480px) {
    .mega-grid { grid-template-columns: 1fr; }
    .brand-grid { grid-template-columns: 1fr; }
}

/* header 的语言/货币下拉也改为点击展开（与导航统一） */
.header-dropdown.open .dropdown-menu { display: block; }
.header-dropdown .header-btn { cursor: pointer; }
/* All Products 面板 - 下段の平置きカテゴリ */
.mega-flat {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.mega-flat-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    padding: 4px 0;
    white-space: nowrap;
}

.mega-flat-link:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .mega-flat {
        gap: 6px 14px;
    }
}

/* 下段平置きカテゴリ — 上段の mega-col-title と見た目を揃える */
.mega-flat {
    gap: 14px 24px;
}

.mega-flat-link {
    font-size: 14px;
    /* 上段タイトルと同じ */
    font-weight: 600;
    color: var(--text);
    /* 赤ではなく上段と同じ濃色 */
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    /* 下線 */
}

.mega-flat-link:hover {
    color: var(--primary);
}

/* 分页箭头 SVG 尺寸约束（Laravel 默认分页修复） */
.pagination-wrap svg {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
}