/* ===== 商品一覧ページ専用スタイル ===== */

/* ベース */
.productlistWrap {
    padding: 80px 0 80px;
}

/* 検索エリア */
.productlist-search {
    width: 1200px;
    max-width: 92%;
    margin: 0 auto;
    padding: 50px 0 30px;
    background-color: #f0f0f0;
}

.productlist-search > .search-container {
    max-width: 600px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
}

.productlist-search .search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    font-size: 0.9rem;
    color: #4d4d4d;
    outline: none;
}

.productlist-search .search-input::placeholder {
    color: #999;
}

.productlist-search .search-button {
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.productlist-search .search-icon {
    width: 20px;
    height: 20px;
    stroke: #4d4d4d;
    stroke-width: 2;
    fill: none;
}

/* タグエリア */
.productlist-search > .tagArea {
    width: 600px;
    max-width: 90%;
    margin: 0 auto 20px;
    padding: 0;
    text-align: center;
}

.productlist-search > .tagArea > a {
    display: inline-block;
    margin: 0 5px 10px;
    padding: 10px 15px;
    text-align: center;
    font-size: 0.8rem;
    color: #4d4d4d;
    line-height: 1.0;
    letter-spacing: 0.05em;
    background-color: #ffffff;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.productlist-search > .tagArea > a:hover,
.productlist-search > .tagArea > a.active {
    color: #ffffff;
    background-color: #4d4d4d;
}

/* 商品一覧エリア（カテゴリなしバージョン） */
.productlistWrap .productlistWrap-inner--nocategory {
    max-width: 1200px;
    margin: 80px auto 0;
    display: block;
}

.productlistWrap .product-area {
    width: 100%;
    margin: 0 auto;
}

.productlistWrap .category-title {
    font-size: 18px;
    font-weight: 700;
    color: #4d4d4d;
    margin-bottom: 40px;
    letter-spacing: 0.05em;
}

/* 商品グリッド */
.productlistWrap .product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.productlistWrap .product-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    height: 100%;
}

.productlistWrap .product-card-link {
    text-decoration: none;
    color: #4d4d4d;
    transition: opacity 0.3s ease;
    display: block;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.productlistWrap .product-card-link:hover {
    opacity: 0.8;
}

.productlistWrap .product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #f5f5f5;
    margin-bottom: 15px;
}

.productlistWrap .product-name {
    margin: 0 0 10px;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.05em;
    text-align: left;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.productlistWrap .product-price {
    margin: 0;
    padding: 0;
    font-family: "Montserrat", "Noto Sans JP", sans-serif;
    font-size: 1.0rem;
    font-weight: 700;
    line-height: 1.0;
    letter-spacing: 0.05em;
    text-align: left;
    margin-top: auto;
}

.productlistWrap .product-price > span {
    font-size: 0.8rem;
    font-weight: 400;
}

.productlistWrap .product-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid #000;
    border-radius: 0;
    background-color: #000;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    margin-top: auto;
}

.productlistWrap .product-cart-button,
.productlistWrap .product-qty-controls {
    width: 100%;
}

.productlistWrap .product-qty-controls {
    justify-content: space-between;
    gap: 12px;
    height: 40px;
    margin-top: auto;
}

.productlistWrap .product-qty-value {
    flex: 1;
    min-width: 56px;
    height: 40px;
    margin: 0;
    max-width: none;
    border-radius: 0;
}

.productlistWrap .product-qty-btn {
    width: 40px;
    height: 40px;
    line-height: 38px;
}

.productlistWrap .product-cart-button {
    height: 40px;
}

.productlistWrap .product-cart-button:hover {
    background-color: #000;
    color: #fff;
}

.productlistWrap .product-cart-button:disabled {
    cursor: not-allowed;
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #999;
}

.productlistWrap .product-cart-button.is-hidden {
    display: none;
}

.productlistWrap .product-qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.productlistWrap .product-qty-controls.is-hidden {
    display: none;
}

.productlistWrap .product-qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #4d4d4d;
    background: #fff;
    color: #4d4d4d;
    font-size: 16px;
    line-height: 26px;
    cursor: pointer;
}

.productlistWrap .product-qty-value {
    min-width: 32px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #d0d0d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.product-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.product-modal.is-open {
    display: block;
}

.product-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.product-modal__content {
    position: relative;
    width: min(1100px, 92vw);
    height: min(80vh, 900px);
    background: #fff;
    margin: 6vh auto 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.product-modal__body {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 32px;
    height: 100%;
    padding: 40px;
    box-sizing: border-box;
}

.product-modal__media {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-modal__main {
    background: #f7f7f7;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.product-modal__thumb {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

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

.product-modal__thumb.is-active {
    border-color: #4d4d4d;
}

.product-modal__info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: #4d4d4d;
}

.product-modal__name {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
}

.product-modal__price {
    margin: 0;
    font-family: "Montserrat", "Noto Sans JP", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.product-modal__desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
}

.product-modal__controls {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 40px;
    margin-top: 12px;
}

.product-modal__controls.is-hidden {
    display: none;
}
.product-modal__controls.is-hidden {
    display: none;
}

.product-modal__qty {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: 50%;
    height: 40px;
}

.product-modal__qty.is-hidden {
    display: none;
}

.product-modal__qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #4d4d4d;
    background: #fff;
    color: #4d4d4d;
    font-size: 18px;
    line-height: 36px;
    cursor: pointer;
}

.product-modal__qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.product-modal__qty-btn.is-hidden {
    display: none;
}

.product-modal__qty-value {
    flex: 1;
    min-width: 56px;
    height: 40px;
    border-radius: 0;
    border: 1px solid #d0d0d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.product-modal__qty-value.is-hidden {
    display: none;
}


.product-modal__cart {
    align-self: flex-start;
    margin: 0;
    width: 50%;
    height: 40px;
    padding: 0 22px;
    border: 1px solid #000;
    border-radius: 0;
    background: #000;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease;
    line-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
}

.product-modal__cart:hover {
    opacity: 0.85;
}

.product-modal__cart.is-hidden {
    display: none;
}

.product-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    color: #4d4d4d;
    border-radius: 50%;
    font-size: 20px;
    line-height: 36px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

body.is-modal-open {
    overflow: hidden;
}

@media screen and (max-width: 900px) {
    .product-modal__content {
        height: 88vh;
    }
    .product-modal__body {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    .product-modal__main {
        min-height: 240px;
    }
}

/* ローディング表示 */
.productlistWrap .product-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 0.9rem;
}

/* 商品なし表示 */
.productlistWrap .product-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 0.95rem;
}

/* ログイン警告表示 */
.productlistWrap .product-warning {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.productlistWrap .product-warning-message {
    margin: 0 0 20px;
    font-size: 0.95rem;
    color: #666;
}

.productlistWrap .product-warning-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: #4d4d4d;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.productlistWrap .product-warning-button:hover {
    background-color: #333;
}

/* ===== ページネーション ===== */
#product-pagination {
    margin-top: 60px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #4d4d4d;
    font-size: 14px;
    font-family: "Montserrat", "Noto Sans JP", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #f5f5f5;
    border-color: #ccc;
}

.pagination-btn.active {
    background: #4d4d4d;
    border-color: #4d4d4d;
    color: #fff;
}

.pagination-btn.disabled {
    color: #ccc;
    border-color: #eee;
    cursor: not-allowed;
}

.pagination-prev,
.pagination-next {
    font-weight: 700;
}

.pagination-dots {
    color: #999;
    font-size: 14px;
    padding: 0 4px;
}

/* ===== レスポンシブ ===== */
@media screen and (max-width: 1200px) {
    .productlistWrap .productlistWrap-inner--nocategory {
        max-width: 92%;
    }
}

@media screen and (max-width: 1000px) {
    .productlistWrap {
        padding: 60px 0;
    }

    .productlistWrap .productlistWrap-inner--nocategory {
        margin: 60px auto 0;
    }

    .productlistWrap .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .productlistWrap .category-title {
        font-size: 16px;
        margin-bottom: 30px;
    }
}

@media screen and (max-width: 768px) {
    .productlistWrap {
        padding: 40px 0;
    }

    .productlist-search {
        padding: 30px 0 20px;
    }

    .productlistWrap .productlistWrap-inner--nocategory {
        margin: 40px auto 0;
    }

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

    .productlistWrap .product-name {
        font-size: 0.85rem;
    }

    .productlistWrap .product-price {
        font-size: 0.9rem;
    }

    .productlistWrap .product-price > span {
        font-size: 0.75rem;
    }

    /* ページネーション */
    #product-pagination {
        margin-top: 40px;
    }

    .pagination {
        gap: 6px;
    }

    .pagination-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}
