/* Responsive carousel wrapper */
.ncd-carousel-wrapper {
    margin: 10px 0;
    padding: 10px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Category title */
.ncd-category-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid currentColor;
}

/* Carousel container with arrows */
.ncd-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* Navigation arrows - hidden by default on mobile */
.ncd-carousel-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    flex-shrink: 0;
}

.ncd-carousel-arrow:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.1);
}

.ncd-carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.ncd-carousel-arrow-left {
    left: 2px;
}

.ncd-carousel-arrow-right {
    right: 2px;
}

.ncd-carousel-arrow svg {
    display: block;
    margin: auto;
}

/* Carousel container */
.ncd-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 10px;
    scroll-snap-type: x mandatory;
    padding: 10px;
    border-radius: 6px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ncd-carousel::-webkit-scrollbar {
    height: 6px;
}

.ncd-carousel::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.ncd-carousel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.ncd-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Individual slide - Mobile First */
.ncd-slide {
    min-width: 180px;
    max-width: 180px;
    background: rgba(0,0,0,0.2);
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    scroll-snap-align: start;
    transition: transform 0.3s ease;
}

.ncd-slide:hover {
    transform: translateY(-3px);
}

.ncd-thumb img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    display: block;
}

.ncd-slide h3 {
    font-size: 12px;
    padding: 6px;
    margin: 0;
    line-height: 1.3;
}

.ncd-author {
    display: block;
    font-size: 10px;
    font-style: italic;
    opacity: 0.85;
    padding: 0 6px 4px;
}

.ncd-date {
    display: block;
    font-size: 9px;
    opacity: .7;
    padding: 0 6px 6px;
}

/* Responsive adjustments */
@media (min-width: 480px) {
    .ncd-slide {
        min-width: 220px;
        max-width: 220px;
    }
    .ncd-thumb img {
        height: 100px;
    }
    .ncd-slide h3 {
        font-size: 13px;
        padding: 8px;
    }
    .ncd-author {
        font-size: 11px;
        padding: 0 8px 4px;
    }
    .ncd-date {
        font-size: 10px;
        padding: 0 8px 8px;
    }
}

@media (min-width: 768px) {
    .ncd-carousel-wrapper {
        margin: 20px 0;
        padding: 20px;
    }
    .ncd-carousel {
        gap: 15px;
        padding: 15px;
        border-radius: 8px;
    }
    .ncd-slide {
        min-width: 320px;
        max-width: 320px;
        border-radius: 12px;
    }
    .ncd-slide:hover {
        transform: translateY(-5px);
    }
    .ncd-thumb img {
        height: 180px;
    }
    .ncd-slide h3 {
        font-size: 16px;
        padding: 10px;
        line-height: 1.4;
    }
    .ncd-author {
        font-size: 13px;
        padding: 0 10px 5px;
    }
    .ncd-date {
        font-size: 12px;
        padding: 0 10px 10px;
    }
    .ncd-category-title {
        font-size: 28px;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 3px solid currentColor;
    }
    
    /* Show arrows on desktop */
    .ncd-carousel-arrow {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .ncd-slide {
        min-width: 400px;
        max-width: 400px;
    }
    .ncd-carousel-wrapper {
        padding: 30px;
    }
}

/* Variation-specific styles */
/* Variation 1 uses default styles */
.ncd-variation-2 .ncd-slide { border-radius: 20px; }
.ncd-variation-3 .ncd-slide { border-radius: 0; }
.ncd-variation-4 .ncd-carousel { gap: 25px; }
.ncd-variation-5 .ncd-slide { box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.ncd-variation-6 .ncd-thumb img { height: 220px; }
.ncd-variation-7 .ncd-slide h3 { font-size: 18px; }
.ncd-variation-8 .ncd-carousel { padding: 25px; }
.ncd-variation-9 .ncd-slide { min-width: 300px; max-width: 300px; }
.ncd-variation-10 .ncd-category-title { text-align: center; border-bottom: none; }

/* Mobile overrides for variation 6 */
@media (max-width: 767px) {
    .ncd-variation-6 .ncd-thumb img { height: 60px; }
}

/* WooCommerce carousel styles - Remove top margin */
.ncd-woo-carousel {
    margin-top: 0;
}

/* WooCommerce slide layout: 75% media / 25% details */
.ncd-woo-slide {
    display: flex;
    flex-direction: column;
    aspect-ratio: 4 / 5;
}

.ncd-woo-media {
    flex: 0 0 75%;
    min-height: 0;
    overflow: hidden;
}

.ncd-woo-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.ncd-woo-slide .ncd-thumb {
    height: 100%;
}

.ncd-woo-slide .ncd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ncd-woo-details {
    flex: 0 0 25%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px 10px;
}

.ncd-woo-content-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.ncd-woo-content h3 {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ncd-woo-cart-btn {
    padding: 0;
}

.ncd-add-to-cart-btn {
    width: 100%;
}

@media (max-width: 767px) {
    .ncd-woo-slide {
        display: grid;
        grid-template-rows: 80% 20%;
        height: 240px;
    }
    .ncd-woo-media {
        flex: none;
        min-height: 0;
        overflow: hidden;
    }
    .ncd-woo-slide .ncd-thumb,
    .ncd-woo-slide .ncd-thumb img,
    .ncd-woo-image-link {
        width: 100%;
        height: 100%;
    }
    .ncd-woo-details {
        flex: none;
        min-height: 0;
        padding: 4px 8px;
        gap: 1px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        text-align: center;
        overflow: hidden;
    }
    .ncd-woo-content-link,
    .ncd-woo-content {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .ncd-woo-content h3 {
        font-size: 10px !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
    .ncd-woo-price {
        font-size: 10px !important;
        margin: 0 !important;
        line-height: 1.1;
        text-align: center;
    }
    .ncd-woo-rating {
        text-align: center;
    }
    .ncd-woo-cart-btn {
        display: none;
    }
}

@media (min-width: 768px) {
    .ncd-woo-carousel {
        margin-top: 0;
    }
    
    /* WooCommerce arrow positioning */
    .ncd-woo-carousel .ncd-carousel-arrow-left {
        left: 2px;
    }
    
    .ncd-woo-carousel .ncd-carousel-arrow-right {
        right: 2px;
    }
}

/* ========================================
   OVERLAY CAROUSEL STYLES
   ======================================== */

/* Overlay carousel wrapper */
.overlay-carousel-wrapper {
    margin: 20px 0;
    padding: 20px;
}

.overlay-category-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid currentColor;
}

/* Overlay carousel container */
.overlay-carousel-container {
    position: relative;
}

.overlay-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 15px;
    scroll-snap-type: x mandatory;
    padding: 15px 10px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.overlay-carousel::-webkit-scrollbar {
    height: 8px;
}

.overlay-carousel::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.overlay-carousel::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.overlay-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}

/* Individual overlay slide - Square aspect ratio */
.overlay-slide {
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    scroll-snap-align: start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.overlay-slide:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.overlay-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: inherit;
}

/* Image container - fills entire card */
.overlay-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.overlay-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.overlay-slide:hover .overlay-img {
    transform: scale(1.05);
}

.overlay-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-no-image::after {
    content: 'No Image';
    color: #fff;
    font-size: 18px;
    opacity: 0.5;
}

/* Overlay content area - 30% at bottom */
.overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    box-sizing: border-box;
}

.overlay-title {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    font-weight: 600;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .overlay-carousel-wrapper {
        margin: 10px 0;
        padding: 10px;
    }
    
    .overlay-category-title {
        font-size: 20px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 2px solid currentColor;
    }
    
    .overlay-carousel {
        gap: 10px;
        padding: 10px 5px;
    }
    
    .overlay-slide {
        /* Mobile sizes set via inline styles from shortcode */
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .overlay-slide:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    
    .overlay-content {
        padding: 5px 6px;
    }
    
    .overlay-title {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        font-size: 14px !important;
    }
}

/* Desktop - show arrows */
@media (min-width: 768px) {
    .overlay-carousel-container .ncd-carousel-arrow {
        display: flex;
    }
    
    .overlay-carousel-container .ncd-carousel-arrow-left {
        left: 2px;
    }
    
    .overlay-carousel-container .ncd-carousel-arrow-right {
        right: 2px;
    }
}

/* Overlay WooCommerce specific styles */
.overlay-woo-info {
    text-align: center;
    width: 100%;
}

.overlay-price {
    margin-top: 3px;
    font-weight: bold;
}

.overlay-woo-carousel .overlay-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.overlay-woo-carousel .overlay-title {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin-bottom: 2px;
}

@media (max-width: 767px) {
    .overlay-woo-carousel .overlay-price {
        font-size: 12px !important;
    }
}
