/* 全体のリセットとポップなフォント設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Hiragino Maru Gothic ProN', 'Rounded Mplus 1c', 'Meiryo', sans-serif;
}

body {
    background-color: #f7f9fa;
    color: #333333;
    overflow-x: hidden;
}

/* ヘッダーとメニューバー */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 26px;
    font-weight: 900;
    color: #ff4a4a;
    cursor: pointer;
    text-shadow: 1px 1px 0px #ffccd2;
}

.search-bar {
    display: flex;
    flex-grow: 1;
    max-width: 420px;
}

.search-bar input {
    width: 100%;
    padding: 8px 14px;
    border: 2px solid #e5e8ea;
    border-right: none;
    border-radius: 25px 0 0 25px;
    outline: none;
    font-size: 13px;
    background-color: #f1f3f5;
}

.search-bar input:focus {
    background-color: #ffffff;
    border-color: #ff4a4a;
}

.search-bar button {
    padding: 8px 20px;
    background-color: #ff4a4a;
    color: #ffffff;
    border: 2px solid #ff4a4a;
    border-radius: 0 25px 25px 0;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}

.header-menu {
    display: flex;
    gap: 15px;
}

.menu-item {
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    color: #555555;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: color 0.2s;
}

.menu-item:hover {
    color: #ff4a4a;
}

.menu-item span {
    font-size: 10px;
    margin-top: 2px;
}

/* メインレイアウト */
.main-container {
    max-width: 1100px;
    margin: 25px auto;
    padding: 0 15px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.text-orange {
    color: #ff7a00;
}

.text-blue {
    color: #209cee;
}

section {
    margin-bottom: 35px;
}

/* 横揺れ自動スライドショー */
.slider-container {
    width: 100%;
    overflow: hidden;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    padding: 15px;
}

.slider-wrapper {
    display: flex;
    gap: 15px;
    width: max-content;
    animation: autoScroll 40s linear infinite;
}

.slider-wrapper:hover {
    animation-play-state: paused;
    /* マウスをのせると一時停止 */
}

@keyframes autoScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* 無限にループさせるための移動設定 */
}

.slide-item {
    width: 280px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 12px;
    cursor: pointer;
}

.slide-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f1f3f5;
}

.slide-info {
    flex-grow: 1;
    overflow: hidden;
}

.slide-title {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 34px;
}

.slide-price {
    font-size: 15px;
    color: #ff4a4a;
    font-weight: 900;
    margin-top: 5px;
}

/* タイムライングリッド */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 15px;
}

.product-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s;
    cursor: pointer;
    border: 1px solid #e5e8ea;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
}

/* あなたの商品だとひと目でわかる特別枠 */
.my-product-border {
    border: 2px dashed #ff7a00 !important;
    background-color: #fffaf5;
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background-color: #f1f3f5;
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.price-badge {
    position: absolute;
    bottom: 8px;
    left: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 2px 10px;
    font-weight: bold;
    font-size: 12px;
    border-radius: 0 12px 12px 0;
}

.product-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 12px;
    color: #333333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 34px;
}

.manual-badge {
    background-color: #ff7a00;
    color: white;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 4px;
    display: inline-block;
}

.infinite-loader {
    text-align: center;
    padding: 30px;
    font-weight: bold;
    color: #888;
    font-size: 14px;
}

/* ポップアップ（モーダルウィンドウ） */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.popup-content {
    background-color: #ffffff;
    width: 90%;
    max-width: 650px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.show .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    z-index: 10;
}

.popup-close:hover {
    color: #333;
}

.popup-body {
    display: flex;
}

.popup-img-container {
    width: 45%;
    background-color: #f8f9fa;
}

.popup-img {
    width: 100%;
    height: 100%;
    max-height: 380px;
    object-fit: cover;
}

.popup-info-container {
    width: 55%;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

#popup-title {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 10px;
}

.popup-price {
    font-size: 24px;
    color: #ff4a4a;
    font-weight: 900;
    margin-bottom: 15px;
}

.popup-description {
    background: #f1f3f5;
    padding: 12px;
    border-radius: 10px;
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    height: 120px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.popup-description h4 {
    font-size: 12px;
    color: #333;
    margin-bottom: 4px;
}

.buy-button {
    background-color: #ff4a4a;
    color: #ffffff;
    border: none;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 74, 74, 0.3);
    margin-top: auto;
    transition: background 0.2s;
}

.buy-button:hover {
    background-color: #e03e3e;
}

/* スマホ対応 */
@media (max-width: 650px) {
    .header-container {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .header-menu span {
        display: none;
    }

    /* スマホではアイコンのみにスッキリ化 */
    .popup-body {
        flex-direction: column;
    }

    .popup-img-container,
    .popup-info-container {
        width: 100%;
    }

    .popup-img {
        height: 200px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}