/* 商品ボックスの修正スタイル */

/* EC-CUBEデフォルトスタイルのリセット */
.ec-shelfRole .ec-shelfGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    padding: 0 !important;
    list-style: none !important;
}

.ec-shelfRole .ec-shelfGrid__item {
    background-color: white !important;
    border: 1px solid #e0e0e0 !important;
    padding: 10px !important;
    text-align: left !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 240px !important;
    max-height: 260px !important;
    width: 100% !important;
    margin: 0 !important;
}

.ec-shelfRole .ec-shelfGrid__item > a {
    text-decoration: none !important;
    color: inherit !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

.ec-shelfRole .ec-shelfGrid__item-image {
    width: 100% !important;
    height: 100px !important;
    overflow: hidden !important;
    margin-bottom: 8px !important;
    background-color: #f5f5f5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ec-shelfRole .ec-shelfGrid__item-image img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.ec-shelfRole .ec-shelfGrid__title {
    font-size: 11px !important;
    line-height: 1.3 !important;
    margin-bottom: 5px !important;
    height: 28px !important;
    overflow: hidden !important;
    font-weight: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.ec-shelfRole .ec-shelfGrid__brand {
    font-size: 10px !important;
    color: #666 !important;
    margin-bottom: 2px !important;
}

.ec-shelfRole .ec-shelfGrid__price {
    color: #ff0000 !important;
    font-size: 13px !important;
    font-weight: bold !important;
    margin-bottom: 5px !important;
    margin-top: auto !important;
}

.ec-shelfRole .ec-shelfGrid__stock {
    font-size: 10px !important;
    margin-bottom: 5px !important;
}

.ec-shelfRole .ec-shelfGrid__item form {
    margin-top: auto !important;
    width: 100% !important;
}

.ec-shelfRole .ec-blockBtn--action {
    background-color: #ff6600 !important;
    color: white !important;
    border: none !important;
    padding: 5px 8px !important;
    font-size: 10px !important;
    cursor: pointer !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    transition: background-color 0.3s ease !important;
    margin: 0 !important;
    border-radius: 2px !important;
}

/* デフォルトのパディングやマージンをリセット */
.ec-shelfRole .ec-shelfGrid__item p {
    margin: 0 !important;
    padding: 0 !important;
}

/* レスポンシブ対応 */
@media (max-width: 1400px) {
    .ec-shelfRole .ec-shelfGrid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (max-width: 1200px) {
    .ec-shelfRole .ec-shelfGrid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .ec-shelfRole .ec-shelfGrid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ec-shelfRole .ec-shelfGrid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .ec-shelfRole .ec-shelfGrid__item {
        min-height: 220px !important;
        max-height: 240px !important;
    }
}

@media (max-width: 480px) {
    .ec-shelfRole .ec-shelfGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .ec-shelfRole .ec-shelfGrid__item {
        padding: 8px !important;
        min-height: 200px !important;
        max-height: 220px !important;
    }
    
    .ec-shelfRole .ec-shelfGrid__item-image {
        height: 80px !important;
    }
}