/**
 * QTD ACF Slider Widget Styles
 */

/* Slider Wrapper */
.qtd-acf-slider-wrapper {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

.qtd-acf-slider {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    overflow: visible;
}

/* Prevent vertical stacking before Slick initializes */
.qtd-acf-slider:not(.slick-initialized) {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}

.qtd-acf-slider:not(.slick-initialized) .qtd-slider-item {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 0;
}

/* Handle 1-2 items display - Let Slick handle width naturally */
.qtd-acf-slider.slick-initialized[data-slide-count="1"] .slick-track,
.qtd-acf-slider.slick-initialized[data-slide-count="2"] .slick-track {
    display: flex;
    align-items: stretch;
}

.qtd-acf-slider.slick-initialized[data-slide-count="1"] .slick-slide,
.qtd-acf-slider.slick-initialized[data-slide-count="2"] .slick-slide {
    display: flex;
    height: auto;
}

/* Fixed width of 412px for desktop only (when less than 3 items) */
@media (min-width: 1025px) {
    .qtd-acf-slider.slick-initialized[data-slide-count="1"] .qtd-slider-card,
    .qtd-acf-slider.slick-initialized[data-slide-count="2"] .qtd-slider-card {
        width: 412px !important;
        max-width: 412px !important;
        min-width: 412px !important;
    }

    /* For single item, center it */
    .qtd-acf-slider.slick-initialized[data-slide-count="1"] .slick-slide .qtd-slider-item {
        width: 412px;
        margin: 0 auto;
    }

    /* For 2 items, ensure they're evenly distributed with fixed width */
    .qtd-acf-slider.slick-initialized[data-slide-count="2"] .slick-slide {
        width: auto !important;
        flex: 0 0 auto;
    }

    .qtd-acf-slider.slick-initialized[data-slide-count="2"] .slick-slide .qtd-slider-item {
        width: 412px;
    }

    /* Add spacing between 2 items */
    .qtd-acf-slider.slick-initialized[data-slide-count="2"] .slick-slide:not(:last-child) {
        margin-right: 20px;
    }
}

/* Hide arrows when not enough items to scroll */
.qtd-acf-slider.slick-initialized[data-slide-count="1"] .slick-arrow,
.qtd-acf-slider.slick-initialized[data-slide-count="2"] .slick-arrow {
    display: none !important;
}

/* Slider Item */
.qtd-slider-item {
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    height: auto;
}

/* Ensure Slick slides have equal heights */
.qtd-acf-slider.slick-initialized .slick-slide {
    display: flex;
    height: auto;
}

.qtd-acf-slider.slick-initialized .slick-track {
    display: flex;
    align-items: stretch;
}

/* Card Link Wrapper */
.qtd-slider-card-link {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qtd-slider-card-link:hover {
    transform: translateY(-4px);
}

.qtd-slider-card-link:hover .qtd-slider-card {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Card Container */
.qtd-slider-card {
    background: #ffffff;
    border-radius: 0;
    overflow: visible;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

/* Image Wrapper */
.qtd-card-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: visible !important;
    background: #f0f0f0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Offset Border Effect */
.qtd-card-image-wrapper {
    position: relative;
}

.qtd-card-image-wrapper::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 100%;
    height: 100%;
    border: 2px solid #000000;
    border-radius: 0;
    z-index: 99;
    pointer-events: none;
    display: none; /* Hidden by default */

    /* Add smooth transition */
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* Hover effect - border returns to center and expands */
.qtd-slider-card-link:hover .qtd-card-image-wrapper::before {
    top: 10px !important;
    left: 10px !important;
    width: calc(100% + -20px);
    height: calc(100% + -20px);
}

.qtd-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    color: #999;
    font-size: 14px;
}

/* Price Badge */
.qtd-price-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #fff;
    color: #333333;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
}

.qtd-price-value {
    font-weight: 700;
    color: #333333;
}

.qtd-price-text {
    font-weight: 400;
    color: #333333;
}

/* Card Content */
.qtd-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Label (Category/Type) */
.qtd-card-label {
    margin: 0 0 8px 0;
    font-size: 11px;
    color: #C4A77D;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Title */
.qtd-card-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 400;
    color: #333333;
    line-height: 1.2;
}

/* Subtitle */
.qtd-card-subtitle {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    font-weight: 400;
}

/* Counts Section */
.qtd-card-counts {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 0;
}

.qtd-count-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666666;
}

.qtd-count-item i,
.qtd-count-item svg {
    font-size: 16px;
    color: #666666;
}

.qtd-count-value {
    font-weight: 500;
}

.qtd-count-suffix {
    margin-left: 3px;
    font-weight: 400;
    opacity: 0.8;
}

/* Button */
.qtd-details-button {
    display: inline-flex;
    align-items: center;
    margin-top: auto;
    padding: 8px 0;
    color: #000000;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: none;
    text-align: left;
    transition: color 0.3s ease;
    align-self: flex-start;
    position: relative;
    pointer-events: none;
}

.qtd-details-button-text {
    text-decoration: underline !important;
    text-underline-offset: 4px;
}

.qtd-details-button-chevron {
    margin-left: 4px;
    font-size: 16px;
    transition: margin-left 0.3s ease;
    text-decoration: none;
}

.qtd-slider-card-link:hover .qtd-details-button {
    color: #A08656;
}

.qtd-slider-card-link:hover .qtd-details-button-chevron {
    margin-left: 8px;
}

/* Slick Slider Customization - Circular Arrows */
.qtd-acf-slider .slick-arrow {
    width: 56px;
    height: 56px;
    z-index: 10;
    background: #F8F5F0;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-grid;
    place-items: center;
}

.qtd-acf-slider .slick-arrow:hover {
    background: #F8F5F0;
}

.qtd-acf-slider .slick-arrow:active {
    background: #F8F5F0;
}

.qtd-acf-slider .slick-arrow:focus {
    background: #F8F5F0;
}

.qtd-acf-slider .slick-arrow:before {
    display: none;
}

/* Custom SVG Chevron Arrows */
.qtd-acf-slider .slick-prev,
.qtd-acf-slider .slick-next {
    position: absolute;
}

.qtd-acf-slider .slick-prev:after,
.qtd-acf-slider .slick-next:after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.qtd-acf-slider .slick-prev:after {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 6l-6 6 6 6' fill='none' stroke='%2366666a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.qtd-acf-slider .slick-next:after {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='%2366666a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.qtd-acf-slider .slick-prev {
    left: -25px;
    z-index: 100;
    top: 233px;
}

.qtd-acf-slider .slick-next {
    right: -25px;
    z-index: 100;
    top: 233px;
}

.qtd-acf-slider .slick-dots {
    bottom: -40px;
}

.qtd-acf-slider .slick-dots li button:before {
    font-size: 12px;
    color: #007bff;
    opacity: 0.4;
}

.qtd-acf-slider .slick-dots li.slick-active button:before {
    opacity: 1;
}

/* Notice Styles */
.qtd-acf-notice,
.qtd-no-posts {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .qtd-card-title {
        font-size: 18px;
    }
    
    .qtd-card-counts {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .qtd-slider-item {
        padding: 5px;
    }
    
    .qtd-card-image-wrapper {
        height: 180px;
    }
    
    .qtd-card-content {
        padding: 15px;
    }
    
    .qtd-card-title {
        font-size: 16px;
    }
    
    .qtd-card-subtitle {
        font-size: 13px;
    }
    
    .qtd-card-counts {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .qtd-count-item {
        font-size: 13px;
    }
    
    .qtd-acf-slider .slick-prev {
        left: 5px;
    }
    
    .qtd-acf-slider .slick-next {
        right: 5px;
    }
    
    .qtd-acf-slider .slick-arrow {
        width: 56px;
        height: 56px;
        top: 150px;
    }
    
    .qtd-acf-slider .slick-prev:after,
    .qtd-acf-slider .slick-next:after {
        width: 24px;
        height: 24px;
    }
    
    .qtd-details-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .qtd-card-image-wrapper {
        height: 160px;
    }
    
    .qtd-price-badge {
        font-size: 11px;
        padding: 5px 10px;
    }
}

