/* ============================================
   Night Suits Product Carousel Widget - CSS
   IMPORTANT: All rules scoped to #nspg_v1_carousel_wrapper
   to prevent conflicts with Elementor and other plugins
   ============================================ */

/* Carousel Container */
#nspg_v1_carousel_wrapper {
    --nspg-primary: #000;
    --nspg-secondary: #fff;
    --nspg-border: #ddd;
    --nspg-text: #333;
    --nspg-light: #999;
    --nspg-btn-bg: #8b3a3a;
    --nspg-btn-hover: #6d2f2f;
    --nspg-transition: all 0.3s ease;
    /* Ensure this wrapper doesn't affect other elements */
    box-sizing: border-box;
}

/* Animations */
@keyframes nspg_v1_carousel_spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes nspg_v1_carousel_slide_down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#nspg_v1_carousel_wrapper .nspg-carousel-wrapper {
    width: 100%;
    position: relative;
    padding-bottom: 20px;
}

#nspg_v1_carousel_wrapper .nspg-carousel {
    width: 100%;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* Pagination enabled - handled in pagination section below */

#nspg_v1_carousel_wrapper .swiper-wrapper {
    display: flex;
    /* DO NOT set width - let Swiper calculate it */
    box-sizing: border-box;
}

#nspg_v1_carousel_wrapper .swiper-slide {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    /* Width is controlled by Swiper.js based on slidesPerView - DO NOT set width here */
    height: auto;
    box-sizing: border-box;
}

/* Equal Height Mode */
#nspg_v1_carousel_wrapper .nspg-carousel-wrapper[data-equal-height="yes"] .swiper-slide {
    height: 100%;
}

/* Product Card in Carousel */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-card {
    position: relative;
    background: var(--nspg-secondary);
    transition: var(--nspg-transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    height: 100%;
    width: 100%;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Product Image */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 800/1050;
    background: #f5f5f5;
    width: 100%;
    flex-shrink: 0;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image-wrapper.loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    z-index: 50;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top-color: var(--nspg-primary);
    border-radius: 50%;
    animation: nspg_v1_carousel_spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 51;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image.main-image {
    z-index: 2;
    opacity: 1;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image.hover-image {
    z-index: 1;
    opacity: 0;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image-wrapper:hover .nspg-product-image.main-image {
    opacity: 0;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-image-wrapper:hover .nspg-product-image.hover-image {
    opacity: 1;
}

/* Product Info */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.4;
    flex: 0 0 auto;
    word-break: break-word;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-title a {
    color: var(--nspg-text);
    text-decoration: none;
    transition: var(--nspg-transition);
    display: block;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-title a:hover {
    color: var(--nspg-primary);
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--nspg-primary);
    margin: 8px 0;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-price del {
    opacity: 0.6;
    font-weight: 400;
    font-size: 14px;
    margin-right: 8px;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-price ins {
    text-decoration: none;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-rating {
    margin: 8px 0;
    font-size: 13px;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-product-rating .star-rating {
    font-size: 12px;
}

/* Color Swatches */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-color-swatches {
    display: flex;
    gap: 8px;
    margin: 10px 0 12px 0;
    flex-wrap: wrap;
    align-items: center;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--nspg-transition);
    padding: 0;
    position: relative;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    background-clip: padding-box;
    flex-shrink: 0;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15);
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-color-swatch.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px var(--nspg-secondary), 0 0 0 4px var(--nspg-primary);
}

/* Size Selector */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-selector {
    margin: 12px 0;
    display: none;
    animation: nspg_v1_carousel_slide_down 0.3s ease;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-selector.active {
    display: block;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-selector label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--nspg-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-option {
    padding: 10px 16px;
    border: 1px solid var(--nspg-border);
    background: var(--nspg-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--nspg-transition);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 50px;
    text-align: center;
    color: var(--nspg-text);
    display: inline-block;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-option:hover:not(.out-of-stock) {
    border-color: var(--nspg-primary);
    background: #f9f9f9;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-option.active {
    border-color: var(--nspg-primary);
    background: var(--nspg-primary);
    color: var(--nspg-secondary);
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-option.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-size-option.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 3px;
    right: 3px;
    height: 1px;
    background: #999;
    transform: translateY(-50%);
}

/* Add to Cart Button */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--nspg-btn-bg);
    color: var(--nspg-secondary);
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--nspg-transition);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: auto;
    display: block !important;
    visibility: visible !important;
    position: relative;
    z-index: 5;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn:hover {
    background: var(--nspg-btn-hover);
    transform: translateY(-2px);
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn:active {
    transform: scale(0.98);
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn:disabled,
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #cccccc;
    color: #666666;
    transform: none;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn:disabled:hover,
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn.disabled:hover {
    transform: none;
    background: #cccccc;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid var(--nspg-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: nspg_v1_carousel_spin 0.6s linear infinite;
    vertical-align: middle;
}

/* Messages */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-message {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 3px;
    font-size: 13px;
    text-align: center;
    animation: nspg_v1_carousel_slide_down 0.3s ease;
    min-height: 0;
    overflow: hidden;
    display: none;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Swiper Navigation Buttons */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-prev,
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-next {
    position: absolute;
    z-index: 10;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 10px;
    margin: 0;
    background: transparent;
}

/* Remove default Swiper arrow pseudo-elements */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-prev::after,
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-next::after {
    display: none !important;
    content: none !important;
}

/* Style custom icon elements */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-prev svg,
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-next svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    display: inline-block;
}

#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-prev i,
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-next i {
    font-size: inherit;
    display: inline-block;
    line-height: 1;
}

/* Ensure icon wrapper can be styled */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-prev .elementor-icon,
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-next .elementor-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-prev [class*="icon-"],
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-button-next [class*="icon-"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation - Show on Hover Only */
#nspg_v1_carousel_wrapper[data-nav-hover="yes"] .nspg-carousel .swiper-button-prev,
#nspg_v1_carousel_wrapper[data-nav-hover="yes"] .nspg-carousel .swiper-button-next {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#nspg_v1_carousel_wrapper[data-nav-hover="yes"]:hover .nspg-carousel .swiper-button-prev,
#nspg_v1_carousel_wrapper[data-nav-hover="yes"]:hover .nspg-carousel .swiper-button-next {
    opacity: 1;
    visibility: visible;
}

/* Pagination - Base Styles */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination {
    position: absolute;
    width: auto;
    left: 50%;
    right: auto;
    bottom: -50px;
    top: auto;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 10;
    flex-wrap: wrap;
}

/* Default space for pagination */
#nspg_v1_carousel_wrapper[data-pagination="yes"] {
    padding-bottom: 60px;
    position: relative;
    overflow: visible;
}

#nspg_v1_carousel_wrapper[data-pagination="yes"] .nspg-carousel {
    overflow: visible;
}

/* Pagination - Dots (Bullets) */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    opacity: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin: 0 2.5px !important;
}

#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination .swiper-pagination-bullet:hover {
    transform: scale(1.1);
}

#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination .swiper-pagination-bullet-active {
    background-color: #000;
}

/* Pagination - Fraction */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination-fraction {
    width: auto;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination-fraction .swiper-pagination-current,
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination-fraction .swiper-pagination-total {
    font-weight: 600;
}

/* Pagination - Progress Bar */
#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination-progressbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -30px;
    top: auto;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
}

#nspg_v1_carousel_wrapper .nspg-carousel .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
    background-color: #000;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transform-origin: left top;
}

/* Space from slides support */
#nspg_v1_carousel_wrapper[data-pagination-space="top"] {
    padding-top: 20px;
}

#nspg_v1_carousel_wrapper[data-pagination-space="bottom"] {
    padding-bottom: 20px;
}

/* ============================================
   Load More Button
   ============================================ */

#nspg_v1_carousel_wrapper .nspg-load-more-container {
    display: flex;
    width: 100%;
    margin-top: 30px;
}

#nspg_v1_carousel_wrapper .nspg-load-more-btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--nspg-transition);
    background-color: var(--nspg-primary);
    color: var(--nspg-secondary);
    border: none;
    border-radius: 0;
}

#nspg_v1_carousel_wrapper .nspg-load-more-btn:hover {
    opacity: 0.85;
}

/* View Cart Button */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-view-cart-btn {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: var(--nspg-btn-bg);
    border: 2px solid var(--nspg-btn-bg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--nspg-transition);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
    display: none;
    text-align: center;
    text-decoration: none;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-view-cart-btn:hover {
    background: var(--nspg-btn-bg);
    color: var(--nspg-secondary);
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-view-cart-btn.show {
    display: block;
}

/* Hover Underline Effect for Buttons */
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn.nspg-underline-effect,
#nspg_v1_carousel_wrapper .nspg-load-more-btn.nspg-underline-effect,
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-view-cart-btn.nspg-underline-effect {
    position: relative;
    overflow: visible;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn.nspg-underline-effect::after,
#nspg_v1_carousel_wrapper .nspg-load-more-btn.nspg-underline-effect::after,
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-view-cart-btn.nspg-underline-effect::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    width: auto;
    height: 2px;
    background-color: #ffffff;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
    pointer-events: none;
}

#nspg_v1_carousel_wrapper .nspg-carousel .nspg-add-to-cart-btn.nspg-underline-effect:hover::after,
#nspg_v1_carousel_wrapper .nspg-load-more-btn.nspg-underline-effect:hover::after,
#nspg_v1_carousel_wrapper .nspg-carousel .nspg-view-cart-btn.nspg-underline-effect:hover::after {
    transform: scaleX(1);
}