/* Global Styles */
:root {
    --primary-color: #232f3e;
    --accent-color: #ff9900;
    --danger-color: #b12704;
    --white: #fff;
    --border-color: #ddd;
    --text-main: #0f1111;
    --text-sub: #565959;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Noto Sans JP', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', メイリオ, Meiryo, sans-serif;
    background-color: #eaeded;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
}

.logo span {
    color: var(--accent-color);
}

.header-links a {
    margin-left: 20px;
}

/* Navigation */
.nav-bar {
    background-color: #37475a;
}

.nav-bar ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 10px;
}

.nav-bar li a {
    display: block;
    color: var(--white);
    padding: 10px 15px;
    font-weight: 500;
    font-size: 13px;
}

.nav-bar li a:hover {
    background-color: #485769;
    text-decoration: none;
    color: var(--white);
}

/* Main Content */
main {
    padding: 20px 0;
}

/* Search Box Area */
.search-section {
    background-color: var(--white);
    padding: 20px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.search-header {
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.search-header h1 {
    font-size: 20px;
    color: var(--primary-color);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-input,
.form-select {
    padding: 10px;
    border: 1px solid #888;
    border-radius: 4px;
    font-size: 14px;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #e77600;
    box-shadow: 0 0 3px 2px rgba(228, 121, 17, 0.5);
}

.keyword-input {
    flex: 2;
    min-width: 200px;
}

.category-select {
    flex: 1;
    min-width: 150px;
}

/* Safe Search Toggle */
.safe-search-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #e7f4f9;
    padding: 10px;
    border: 1px solid #bde0ea;
    border-radius: 4px;
    cursor: pointer;
}

.safe-search-toggle input[type="checkbox"] {
    transform: scale(1.5);
    cursor: pointer;
}

.safe-search-label {
    font-weight: 700;
    color: #002f36;
    font-size: 15px;
}

.safe-search-desc {
    font-size: 12px;
    color: #555;
    margin-left: auto;
}

/* Discount Buttons */
.discount-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.discount-btn {
    flex: 1;
    background-color: var(--white);
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
    transition: all 0.2s;
}

.discount-btn:hover {
    background-color: #f7fafa;
    border-color: #d5d9d9;
}

.discount-btn.active {
    background-color: #fef8f2;
    border-color: #e77600;
    border-width: 2px;
    padding: 9px;
    /* Adjust for border width */
}

.discount-val {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--danger-color);
}

.discount-label {
    font-size: 11px;
    color: var(--text-sub);
}

.search-submit {
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    border: 1px solid;
    border-color: #a88734 #9c7e31 #846a29;
    border-radius: 3px;
    color: #111;
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.search-submit:hover {
    background: linear-gradient(to bottom, #f5d78e, #eeb933);
}

/* Bestseller Section */
.bestseller-section {
    margin-top: 30px;
}

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

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    border-left: 5px solid var(--primary-color);
    padding-left: 10px;
}

.update-time {
    font-size: 12px;
    color: var(--text-sub);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.product-card {
    position: relative;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #e77600;
}

.product-rank {
    background-color: #c45500;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    position: absolute;
    margin-top: -5px;
    margin-left: -5px;
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
}

.product-img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-title {
    font-size: 13px;
    line-height: 1.4;
    height: 3.8em;
    /* 2-3 lines */
    overflow: hidden;
    color: #007185;
    margin-bottom: 5px;
}

.product-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--danger-color);
}

.product-price span {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-sub);
    text-decoration: line-through;
    margin-left: 5px;
}

/* Features Text */
.features-text {
    background-color: var(--white);
    padding: 20px;
    margin-top: 30px;
    border: 1px solid var(--border-color);
}

.features-text h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.features-text p {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 10px;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: #ddd;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 12px;
    text-align: center;
}

.footer-links a {
    color: #ddd;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
    color: var(--white);
}

/* Mobile */
@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        flex-direction: column;
    }

    ``` .discount-btn {
        flex: 1;
        background-color: var(--white);
        border: 1px solid #d5d9d9;
        border-radius: 8px;
        padding: 10px;
        text-align: center;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
        transition: all 0.2s;
    }

    .discount-btn:hover {
        background-color: #f7fafa;
        border-color: #d5d9d9;
    }

    .discount-btn.active {
        background-color: #fef8f2;
        border-color: #e77600;
        border-width: 2px;
        padding: 9px;
        /* Adjust for border width */
    }

    .discount-val {
        display: block;
        font-size: 18px;
        font-weight: 700;
        color: var(--danger-color);
    }

    .discount-label {
        font-size: 11px;
        color: var(--text-sub);
    }

    .search-submit {
        background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
        border: 1px solid;
        border-color: #a88734 #9c7e31 #846a29;
        border-radius: 3px;
        color: #111;
        padding: 12px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        width: 100%;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
    }

    .search-submit:hover {
        background: linear-gradient(to bottom, #f5d78e, #eeb933);
    }

    /* Bestseller Section */
    .bestseller-section {
        margin-top: 30px;
    }

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

    .section-title {
        font-size: 18px;
        font-weight: 700;
        color: var(--text-main);
        border-left: 5px solid var(--primary-color);
        padding-left: 10px;
    }

    .update-time {
        font-size: 12px;
        color: var(--text-sub);
    }

    .product-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .product-card {
        position: relative;
        background-color: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 10px;
        display: flex;
        flex-direction: column;
        transition: box-shadow 0.2s;
    }

    .product-card:hover {
        box-shadow: var(--shadow-md);
        border-color: #e77600;
    }

    .product-rank {
        background-color: #c45500;
        color: white;
        font-size: 12px;
        font-weight: 700;
        padding: 2px 6px;
        position: absolute;
        margin-top: -5px;
        margin-left: -5px;
        clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
    }

    .product-img {
        width: 100%;
        height: 160px;
        object-fit: contain;
        margin-bottom: 10px;
    }

    .product-title {
        font-size: 13px;
        line-height: 1.4;
        height: 3.8em;
        /* 2-3 lines */
        overflow: hidden;
        color: #007185;
        margin-bottom: 5px;
    }

    .product-price {
        font-size: 17px;
        font-weight: 700;
        color: var(--danger-color);
    }

    .product-price span {
        font-size: 12px;
        font-weight: 400;
        color: var(--text-sub);
        text-decoration: line-through;
        margin-left: 5px;
    }

    /* Features Text */
    .features-text {
        background-color: var(--white);
        padding: 20px;
        margin-top: 30px;
        border: 1px solid var(--border-color);
    }

    .features-text h3 {
        font-size: 16px;
        margin-bottom: 10px;
        color: var(--primary-color);
    }

    .features-text p {
        font-size: 13px;
        color: var(--text-sub);
        margin-bottom: 10px;
    }

    /* Footer */
    footer {
        background-color: var(--primary-color);
        color: #ddd;
        padding: 30px 0;
        margin-top: 40px;
        font-size: 12px;
        text-align: center;
    }

    .footer-links a {
        color: #ddd;
        margin: 0 10px;
    }

    .footer-links a:hover {
        text-decoration: underline;
        color: var(--white);
    }

    /* Mobile */
    @media (max-width: 600px) {
        .header-inner {
            flex-direction: column;
            align-items: flex-start;
        }

        .form-row {
            flex-direction: column;
        }

        .safe-search-desc {
            display: none;
        }

        .product-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        /* Mobile Discount Buttons */
        .discount-buttons {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }

        .discount-btn {
            width: 100%;
            padding: 8px 4px;
            /* Slightly reduce padding to ensure fit */
        }

        .discount-val {
            font-size: 16px;
            /* Slightly smaller font for mobile */
        }
    }

    ```