/* ===== GugoPro Amazon Smart Finder v4 ===== */

:root {
    --bg: #FDF8F4;
    --card: #FFFFFF;
    --primary: #8B5E3C;
    --primary-hover: #6D4A2F;
    --accent: #E8A87C;
    --accent-light: #FFF0E6;
    --text: #2D2D2D;
    --text-mid: #666666;
    --text-light: #999999;
    --border: #EDE5DC;
    --border-light: #F5EFE8;
    --success: #4CAF50;
    --prime: #0574F7;
    --radius: 20px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 12px rgba(139,94,60,0.07);
    --shadow-md: 0 4px 20px rgba(139,94,60,0.1);
    --font: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    padding-bottom: 90px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ===== Header ===== */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-bar {
    flex: 1;
    display: flex;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,168,124,0.15);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    font-family: var(--font);
    background: transparent;
    color: var(--text);
    min-width: 0;
}

.search-bar button {
    border: none;
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.search-bar button:hover { background: var(--primary-hover); }

/* ===== Suggestions ===== */
.suggestions-dropdown {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
}

.suggestion-item {
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.1s;
}

.suggestion-item:hover { background: var(--accent-light); }
.suggestion-item .sug-icon { color: var(--text-light); font-size: 12px; }

/* ===== Selection Bar ===== */
.selection-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.selection-bar::-webkit-scrollbar { display: none; }

.selection-chips {
    display: flex;
    gap: 5px;
    flex: 1;
    overflow-x: auto;
}

.selection-chips::-webkit-scrollbar { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.chip .chip-x {
    cursor: pointer;
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

.chip .chip-x:hover { opacity: 1; }

.reset-btn {
    border: none;
    background: none;
    color: var(--text-light);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    flex-shrink: 0;
}

.reset-btn:hover { color: var(--primary); background: var(--accent-light); }

/* ===== Sections ===== */
.section {
    padding: 10px 0 6px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-header h2 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 6px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.slide-panel {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    border: none;
    background: var(--bg);
    color: var(--text-light);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.close-btn:hover { background: var(--border); color: var(--text); }

/* ===== Tags ===== */
.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-grid.compact {
    gap: 5px;
}

.tag-grid.small { gap: 4px; }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
}

.tag:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.tag.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.tag-icon { font-size: 13px; }

.tag-grid.small .tag {
    padding: 4px 9px;
    font-size: 11.5px;
    border-radius: 14px;
}

/* ===== Price Presets ===== */
.price-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.price-preset {
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.price-preset:hover { border-color: var(--accent); background: var(--accent-light); }
.price-preset.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ===== Sort Options ===== */
.sort-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sort-opt {
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.sort-opt:hover { border-color: var(--accent); background: var(--accent-light); }
.sort-opt.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ===== Filter Blocks ===== */
.filter-block {
    margin-bottom: 12px;
}

.filter-block:last-child { margin-bottom: 0; }

.filter-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.filter-block-header span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-mid);
    text-transform: uppercase;
}

.price-display {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    text-transform: none !important;
}

/* ===== Price Slider ===== */
.slider-container {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.slider-container input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 2;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    pointer-events: all;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    pointer-events: all;
}

.slider-track {
    position: absolute;
    height: 5px;
    width: 100%;
    border-radius: 3px;
    background: var(--border);
    z-index: 1;
}

.slider-track::after {
    content: '';
    position: absolute;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    left: var(--left, 0%);
    right: var(--right, 0%);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-light);
    margin-top: 1px;
}

/* ===== Rating & Prime ===== */
.filter-row-dual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stars {
    font-size: 14px;
    color: #F5A623;
}

.prime-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--prime);
    padding: 2px 6px;
    border: 1px solid var(--prime);
    border-radius: 4px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-mid);
}

.toggle-label input { display: none; }

.toggle-switch {
    width: 32px;
    height: 18px;
    background: var(--border);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--success);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(14px);
}

/* ===== Action Bar (sticky bottom) ===== */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 90;
}

.action-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-mid);
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.preview-icon { flex-shrink: 0; font-size: 12px; }

.preview-text {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.go-btn {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.go-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.go-btn:active { transform: translateY(0); }

.go-arrow { font-size: 15px; }

/* ===== Popular ===== */
.popular-tag {
    padding: 6px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.popular-tag:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ===== Footer ===== */
.footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 12px 0;
    text-align: center;
    margin-bottom: 70px;
}

.disclosure { font-size: 10px; color: var(--text-light); margin-bottom: 2px; line-height: 1.5; }
.copy { font-size: 10px; color: var(--text-light); }

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .container { padding: 0 8px; }
    .tag { padding: 5px 10px; font-size: 12px; }
    .tag-grid { gap: 5px; }
    .tag-grid.small .tag { padding: 4px 8px; font-size: 11px; }
    .go-btn { padding: 9px 14px; font-size: 12px; }
    .action-inner { gap: 8px; }
    .panel { padding: 10px; }
    .filter-row-dual { flex-wrap: wrap; gap: 8px; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .container { padding: 0 10px; }
}
