/**
 * Dynamic Sections Carousels - Frontend Styles
 */

/* Section Container */
.dsc-sections-container {
    margin: 2rem 0;
}

/* Section Styles */
.dsc-section {
    margin-bottom: 3rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
}

.dsc-section:last-child {
    border-bottom: none;
}

.dsc-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dsc-section-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.dsc-section-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dsc-section-link:hover {
    color: #0073aa;
}

.dsc-products-count {
    font-weight: 400;
    color: #666;
    font-size: 0.9em;
}

.dsc-section-description {
    margin: 0.5rem 0 0 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.4;
}

.dsc-section-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dsc-view-all-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s ease;
}

.dsc-view-all-link:hover {
    color: #005177;
}

.dsc-arrow {
    transition: transform 0.3s ease;
}

.dsc-view-all-link:hover .dsc-arrow {
    transform: translateX(3px);
}

/* Products Carousel */
.dsc-products-carousel {
    position: relative;
    overflow: hidden;
    background: transparent !important; /* Ensure transparent background */
    padding: 0 50px; /* Add padding for navigation buttons */
}

.dsc-products-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
    background: transparent !important; /* Ensure transparent background */
}

.dsc-products-carousel .swiper-slide {
    width: auto;
    height: auto;
    flex-shrink: 0;
    background: transparent !important; /* Ensure transparent background */
}

/* Product Card */
.dsc-product-card {
    width: 280px;
    height: 100%;
    background: transparent !important; /* Ensure transparent background */
}

.dsc-product-card-inner {
    background: transparent; /* Use theme background instead of white */
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dsc-product-card-inner:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.dsc-product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 460/215; /* Match actual photo dimensions (2.14:1) */
}

.dsc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show full image without cropping */
    transition: transform 0.3s ease;
}

.dsc-product-card-inner:hover .dsc-product-image img {
    transform: scale(1.05);
}

.dsc-product-image-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

.dsc-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}

.dsc-out-of-stock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 2;
}

.dsc-product-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.dsc-product-card-inner:hover .dsc-product-actions {
    opacity: 1;
    transform: translateY(0);
}

.dsc-add-to-cart {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.dsc-add-to-cart:hover {
    background: #005177;
    color: white;
}

.dsc-wishlist {
    display: flex;
    justify-content: center;
}

.dsc-product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dsc-product-category {
    margin-bottom: 0.5rem;
}

.dsc-product-category span {
    background: transparent; /* Use theme background */
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dsc-product-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
}

.dsc-product-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.dsc-product-link:hover {
    color: #0073aa;
}

.dsc-product-description {
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

.dsc-product-description p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
    line-height: 1.4;
}

.dsc-product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dsc-product-rating .star-rating {
    font-size: 0.875rem;
}

.dsc-rating-count {
    color: #666;
    font-size: 0.75rem;
}

.dsc-product-price {
    margin-top: auto;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.dsc-product-price del {
    color: #999;
    font-weight: 400;
    margin-right: 0.5rem;
}

.dsc-product-price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* Navigation Buttons */
.dsc-swiper-button-next,
.dsc-swiper-button-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20; /* Higher z-index to ensure buttons are on top */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dsc-swiper-button-next {
    right: 5px; /* Move inside container to prevent cutting off */
}

.dsc-swiper-button-prev {
    left: 5px; /* Move inside container to prevent cutting off */
}

.dsc-swiper-button-next:hover,
.dsc-swiper-button-prev:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.dsc-swiper-button-next:after,
.dsc-swiper-button-prev:after {
    font-size: 16px;
    font-weight: 600;
}

.dsc-swiper-button-next.swiper-button-disabled,
.dsc-swiper-button-prev.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Pagination */
.dsc-swiper-pagination {
    text-align: center;
    margin-top: 1rem;
}

.dsc-swiper-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #ccc;
    opacity: 1;
    margin: 0 4px;
    transition: background 0.3s ease;
}

.dsc-swiper-pagination .swiper-pagination-bullet-active {
    background: #0073aa;
}

/* Loading States */
.dsc-section-placeholder {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* Use theme background instead of light gray */
    border-radius: 8px;
    margin: 2rem 0;
}

.dsc-loading {
    text-align: center;
    color: #666;
}

.dsc-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: dsc-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes dsc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.dsc-error {
    text-align: center;
    color: #e74c3c;
    padding: 2rem;
}

.dsc-retry-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s ease;
}

.dsc-retry-btn:hover {
    background: #005177;
}

.dsc-no-products {
    text-align: center;
    padding: 3rem;
    color: #666;
    background: transparent; /* Use theme background */
    border-radius: 8px;
}

/* Notices */
.dsc-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dsc-notice-success {
    border-left: 4px solid #28a745;
}

.dsc-notice-error {
    border-left: 4px solid #dc3545;
}

.dsc-notice-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dsc-notice-close:hover {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dsc-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dsc-section-title {
        font-size: 1.25rem;
    }
    
    .dsc-product-card {
        width: 240px;
    }
    
    .dsc-swiper-button-next,
    .dsc-swiper-button-prev {
        display: none;
    }
    
    .dsc-product-actions {
        opacity: 1;
        transform: translateY(0);
        position: static;
        flex-direction: row;
        justify-content: center;
        margin-top: 1rem;
        padding: 0 1rem;
    }
    
    .dsc-notice {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .dsc-product-card {
        width: 200px;
    }
    
    .dsc-product-info {
        padding: 0.75rem;
    }
    
    .dsc-section {
        margin-bottom: 2rem;
        padding: 1rem 0;
    }
}

/* Print Styles */
@media print {
    .dsc-swiper-button-next,
    .dsc-swiper-button-prev,
    .dsc-swiper-pagination,
    .dsc-product-actions,
    .dsc-notice {
        display: none !important;
    }
    
    .dsc-product-card {
        width: auto;
        break-inside: avoid;
    }
    
    .dsc-products-carousel .swiper-wrapper {
        flex-wrap: wrap;
    }
    
    .dsc-products-carousel .swiper-slide {
        width: 50%;
        margin-bottom: 1rem;
    }
}
