/**
 * RecoWise Plugin - Common Styles
 * 共通のレコメンデーション表示スタイル
 */

/* Section Styles */
.ec-productRole__recommendationSection,
.ec-productListRole__recommendationSection,
.ec-cartRole__recommendationSection,
.ec-mypageRole__recommendationSection,
.ec-topRole__recommendationSection,
.ec-cartCompleteRole__recommendationSection {
    margin: 40px 0;
}

/* Title Styles */
.ec-productRole__recommendationTitle,
.ec-productListRole__recommendationTitle,
.ec-cartRole__recommendationTitle,
.ec-mypageRole__recommendationTitle,
.ec-topRole__recommendationTitle,
.ec-cartCompleteRole__recommendationTitle {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.ec-productRole__recommendationTitle h3,
.ec-productListRole__recommendationTitle h3,
.ec-cartRole__recommendationTitle h3,
.ec-mypageRole__recommendationTitle h3,
.ec-topRole__recommendationTitle h3,
.ec-cartCompleteRole__recommendationTitle h3 {
    font-size: 22px;
    margin: 0;
    display: flex;
    align-items: center;
}

.ec-productRole__recommendationTitle h3 i,
.ec-productListRole__recommendationTitle h3 i,
.ec-cartRole__recommendationTitle h3 i,
.ec-mypageRole__recommendationTitle h3 i,
.ec-topRole__recommendationTitle h3 i,
.ec-cartCompleteRole__recommendationTitle h3 i {
    margin-right: 10px;
}

/* Items Container */
.ec-productRole__recommendationItems,
.ec-productListRole__recommendationItems,
.ec-cartRole__recommendationItems,
.ec-mypageRole__recommendationItems,
.ec-topRole__recommendationItems,
.ec-cartCompleteRole__recommendationItems {
    position: relative;
}

/* Recommendation Item Styles */
.ec-recommendationRole {
    padding: 10px;
    margin-bottom: 15px;
    transition: all 0.3s;
    height: 100%; /* Ensure consistent height */
    display: flex;
    flex-direction: column;
}

.ec-recommendationRole:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.ec-recommendationRole a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #525263;
    text-decoration: none;
}

.ec-recommendationRole__image {
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    aspect-ratio: 1; /* Maintain square aspect ratio */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
}

.ec-recommendationRole__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ec-recommendationRole__detail {
    padding: 0 5px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.ec-recommendationRole__name {
    font-size: 14px;
    margin-bottom: 5px;
    color: #525263;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ec-recommendationRole__price {
    font-size: 15px;
    font-weight: bold;
    color: #DE5D50;
    margin-top: auto;
}

/* Badge Styles */
.ec-recommendationRole__badge {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    z-index: 1;
}

.ec-recommendationRole__badge--new {
    background-color: #ff6b6b;
    color: white;
}


/* Carousel Wrapper */
.ec-recommendationCarouselWrapper {
    position: relative;
}

/* Carousel Controls */
.ec-recommendationControl {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #525263;
    border: 1px solid #ccc;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ec-recommendationControl:hover {
    background: #f7f7f7;
}

.ec-recommendationControl--prev {
    left: -20px;
}

.ec-recommendationControl--next {
    right: -20px;
}

/* Carousel Container */
.ec-recommendationCarousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    margin-left: -15px; /* Match Bootstrap .row margin */
    margin-right: -15px; /* Match Bootstrap .row margin */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.ec-recommendationCarousel:active {
    cursor: grabbing;
}

.ec-recommendationCarousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.ec-recommendationCarousel__item {
    flex: 0 0 auto;
    width: 25%; /* 4 columns on desktop (col-md-3) */
    padding-left: 15px; /* Match Bootstrap column padding */
    padding-right: 15px; /* Match Bootstrap column padding */
}

/* Responsive Design - Match Bootstrap grid breakpoints */
@media screen and (min-width: 768px) {
    .ec-recommendationCarousel__item {
        width: 25%; /* 4 columns on desktop (col-md-3) */
    }
}

@media screen and (max-width: 767px) and (min-width: 576px) {
    .ec-recommendationCarousel__item {
        width: 25%; /* Keep 4 columns on tablet */
    }
}

@media screen and (max-width: 575px) {
    .ec-recommendationCarousel__item {
        width: 50%; /* 2 columns on mobile (col-6) */
    }
}

/* Shopping Complete Specific Styles */
.ec-shoppingComplete__recommendation {
    margin: 40px 0;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

/* Hide navigation controls on mobile */
@media screen and (max-width: 575px) {
    .ec-recommendationControl {
        display: none;
    }
}