/**
 * Auto Cards Grid Styles
 */

.autos-grid-container,
.autos-carousel-container {
    width: 100%;
    margin: 2rem 0;
}

/* Filter Styles */
.autos-filter-wrapper {
    width: 100%;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.autos-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.autos-filter-label {
    font-weight: 600;
    color: #0E181C;
    white-space: nowrap;
}

.autos-filter-items {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.autos-filter-item {
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #0E181C;
    border-radius: 4px;
    color: #0E181C;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 14px;
}

.autos-filter-item:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.autos-filter-item.active {
    background: #0070be;
    color: #fff;
    border-color: #0070be;
}

.autos-filter-item.active:hover {
    background: #005a9e;
    border-color: #005a9e;
}

/* Filtered out cards */
.auto-card.filtered-out {
    display: none;
}

/* Filter Responsive */
@media (max-width: 768px) {
    .autos-filter-wrapper {
        justify-content: flex-start;
        margin-bottom: 1rem;
    }
    
    .autos-filter {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .autos-filter-items {
        width: 100%;
        gap: 6px;
    }
    
    .autos-filter-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .autos-filter-item {
        padding: 6px 10px;
        font-size: 12px;
    }
}

.autos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 100%;
    padding: 10px 0;
}

/* Carousel Styles */
.autos-carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 10px 20px;
    overflow: visible;
}

.autos-carousel {
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    margin: 0 -20px;
    padding: 10px 20px;
}

.autos-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 10px;
}

.autos-carousel .auto-card {
    flex: 0 0 calc(33.333% - 7px);
    min-width: 0;
}

.autos-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 2px solid #0E181C;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
}

.autos-carousel-btn:hover {
    background: #0E181C;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.autos-carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.autos-carousel-prev {
    left: -24px;
}

.autos-carousel-next {
    right: -24px;
}

.auto-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center center;
}

.auto-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.auto-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    position: relative;
}

/* Niet-klikbare variant via shortcode: [autos clickable="false"] */
.autos-container[data-clickable="false"] .auto-card-link {
    cursor: default;
}

.autos-container[data-clickable="false"] .auto-card-hover-text {
    display: none;
}

.auto-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.auto-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.auto-card:hover .auto-card-image {
    transform: scale(1.05);
}

.auto-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(135deg, #0171b9 0%, #003d5c 100%);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 0;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    text-align: center;
}

.auto-badge span {
    display: inline-block;
    text-transform: uppercase;
    font-weight: 600;
}

.auto-card-title {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    margin: 0;
    padding: 1.5rem;
    font-size: 1.25rem !important;
    font-weight: 600;
    color: #ffffff !important;
    line-height: 1.4;
    z-index: 5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.auto-card-image-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    z-index: 4;
    pointer-events: none;
}

.auto-card:hover .auto-card-title {
    transform: translateY(-5px);
}

.auto-card-hover-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1.5rem 1.5rem 1.5rem;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s ease;
    z-index: 6;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-card-arrow {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.auto-card:hover .auto-card-arrow {
    transform: translateX(4px);
}

.auto-card:hover .auto-card-hover-text {
    transform: translateY(-5px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .autos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .autos-carousel .auto-card {
        flex: 0 0 calc(50% - 5px);
    }
    
    .autos-carousel-prev {
        left: 10px;
    }
    
    .autos-carousel-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .autos-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Mobiele carrousel: 1 groot kaartje in het midden, links/rechts uit beeld */
    .autos-carousel-wrapper {
        padding: 10px 0;
        overflow: visible;
    }
    
    .autos-carousel {
        overflow-x: visible;
        overflow-y: visible;
        margin: 0;
        padding: 10px 0;
    }
    
    .autos-carousel-track {
        padding: 0 5%;
        gap: 15px;
    }
    
    .autos-carousel .auto-card {
        flex: 0 0 90%;
        min-width: 0;
    }
    
    .autos-carousel-prev {
        left: 10px;
        width: 40px;
        height: 40px;
        z-index: 30;
    }
    
    .autos-carousel-next {
        right: 10px;
        width: 40px;
        height: 40px;
        z-index: 30;
    }
    
    /* Vierkante kaartjes op mobiel */
    .autos-carousel .auto-card-image-wrapper {
        padding-top: 100%; /* Vierkant aspect ratio */
    }
}

/* Auto Popup Modal Styles */
.auto-popup-modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
}

.auto-popup-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auto-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.auto-popup-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    overflow: hidden;
    z-index: 1000001 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auto-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auto-popup-close:hover {
    background: #ffffff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.auto-popup-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.auto-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auto-popup-header {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
}

.auto-popup-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.auto-popup-description {
    margin: 0;
    font-size: 1rem;
    color: #ffffff;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.auto-popup-form {
    padding: 2rem;
}

.auto-popup-form-text {
    margin: 0 0 1.5rem 0;
    padding: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #0E181C;
    font-weight: 500;
    text-align: center;
}

/* Responsive Popup */
@media (max-width: 768px) {
    .auto-popup-image-wrapper {
        height: 180px;
    }
    
    .auto-popup-header {
        padding: 1.5rem;
    }
    
    .auto-popup-title {
        font-size: 1.5rem;
    }
    
    .auto-popup-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .auto-popup-image-wrapper {
        height: 150px;
    }
    
    .auto-popup-header {
        padding: 1rem;
    }
    
    .auto-popup-title {
        font-size: 1.25rem;
    }
    
    .auto-popup-description {
        font-size: 0.85rem;
    }
    
    .auto-popup-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }
}

/* Dark Mode Styles */
.autos-darkmode .auto-card {
    background: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.autos-darkmode .auto-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
    transform: translateY(-5px);
}

.autos-darkmode .auto-card-image-wrapper {
    background: #0a0a0a;
}

.autos-darkmode .auto-card-title {
    color: #ffffff !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
}

.autos-darkmode .autos-carousel-btn {
    background: #1a1a1a;
    border: 2px solid #444;
    color: #fff;
}

.autos-darkmode .autos-carousel-btn:hover {
    background: #2a2a2a;
    border-color: #666;
}

.autos-darkmode .autos-carousel-btn:disabled {
    opacity: 0.3;
    background: #1a1a1a;
}

/* Inruilvoordeel Styles - Aantrekkelijke styling die het voordeel benadrukt */
.autos-inruilvoordeel .auto-card {
    background: #ffffff;
    border: 3px solid #10b981;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15), 0 0 0 1px rgba(16, 185, 129, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.autos-inruilvoordeel .auto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #059669 50%, #10b981 100%);
    z-index: 1;
}

.autos-inruilvoordeel .auto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25), 0 0 0 2px rgba(16, 185, 129, 0.2);
    border-color: #059669;
}

.autos-inruilvoordeel .auto-card-image-wrapper {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    position: relative;
}

.autos-inruilvoordeel .auto-card-image-wrapper::after {
    content: '✓ Inruilvoordeel';
    position: absolute;
    top: 60px;
    left: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.autos-inruilvoordeel .auto-card-title {
    color: #ffffff !important;
    background: linear-gradient(to top, rgba(5, 150, 105, 0.95) 0%, rgba(16, 185, 129, 0.85) 50%, rgba(16, 185, 129, 0.6) 100%);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.autos-inruilvoordeel .auto-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #1f2937 !important;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    border: 2px solid #ffffff;
    font-weight: 800;
    font-size: 15px;
    padding: 12px 16px;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    text-align: center;
    border-radius: 0;
}

.autos-inruilvoordeel .auto-badge span {
    position: relative;
}

.autos-inruilvoordeel .auto-badge::after {
    content: '💰';
    margin-left: 4px;
    font-size: 14px;
}

.autos-inruilvoordeel .autos-carousel-btn {
    background: #10b981;
    border: 2px solid #059669;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.autos-inruilvoordeel .autos-carousel-btn:hover {
    background: #059669;
    border-color: #047857;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.autos-inruilvoordeel .autos-carousel-btn:disabled {
    opacity: 0.4;
    background: #6ee7b7;
    border-color: #6ee7b7;
}

.autos-inruilvoordeel .autos-grid-container,
.autos-inruilvoordeel .autos-carousel-container {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 16px;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .autos-inruilvoordeel .autos-grid-container,
    .autos-inruilvoordeel .autos-carousel-container {
        padding: 1rem;
    }
    
    .autos-inruilvoordeel .auto-card-image-wrapper::after {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Fullwidth Styles - Carousel loopt uit beeld links en rechts */
.autos-fullwidth {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 2rem 0;
}

.autos-fullwidth .autos-carousel-wrapper {
    padding: 10px 0;
    overflow: visible;
}

.autos-fullwidth .autos-carousel {
    overflow: visible;
    width: 100%;
    margin: 0;
    padding: 0;
}

.autos-fullwidth .autos-carousel-track {
    padding: 0 4%;
    gap: 10px;
}

.autos-fullwidth .autos-carousel .auto-card {
    flex: 0 0 calc(33.333% - 7px);
    min-width: 0;
}

.autos-fullwidth .autos-carousel-btn {
    z-index: 30;
}

.autos-fullwidth .autos-carousel-prev {
    left: 20px;
}

.autos-fullwidth .autos-carousel-next {
    right: 20px;
}

/* Large screens - show more cards */
@media (min-width: 1400px) {
    .autos-fullwidth .autos-carousel-track {
        padding: 0 3%;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .autos-fullwidth .autos-carousel .auto-card {
        flex: 0 0 calc(100% - 5px);
    }
    
    .autos-fullwidth .autos-carousel-track {
        padding: 0 2%;
    }
    
    .autos-fullwidth .autos-carousel-prev {
        left: 15px;
    }
    
    .autos-fullwidth .autos-carousel-next {
        right: 15px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .autos-fullwidth {
        padding: 1.5rem 0;
    }
    
    .autos-fullwidth .autos-carousel .auto-card {
        flex: 0 0 calc(100% - 5px);
    }
    
    .autos-fullwidth .autos-carousel-track {
        padding: 0 10%;
    }
    
    .autos-fullwidth .autos-carousel-prev {
        left: 10px;
        width: 40px;
        height: 40px;
    }
    
    .autos-fullwidth .autos-carousel-next {
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .autos-fullwidth .autos-carousel .auto-card {
        flex: 0 0 calc(100% - 5px);
    }
    
    .autos-fullwidth .autos-carousel-track {
        padding: 0 12.5%;
    }
    
    .autos-fullwidth .autos-carousel-prev {
        left: 5px;
        width: 36px;
        height: 36px;
    }
    
    .autos-fullwidth .autos-carousel-next {
        right: 5px;
        width: 36px;
        height: 36px;
    }
}
