/**
 * Frontend Styles for AutoScout Importer
 */

/* Vehicle Listings Grid */
.asi-vehicle-listings {
    display: grid;
    gap: 30px;
    margin: 30px 0;
}

.asi-layout-grid.asi-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.asi-layout-grid.asi-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.asi-layout-grid.asi-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.asi-layout-list {
    grid-template-columns: 1fr;
}

/* Responsive */
@media (max-width: 1024px) {
    .asi-layout-grid.asi-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .asi-layout-grid,
    .asi-layout-grid.asi-columns-2,
    .asi-layout-grid.asi-columns-3,
    .asi-layout-grid.asi-columns-4 {
        grid-template-columns: 1fr;
    }
}

/* Vehicle Card */
.asi-vehicle-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.asi-vehicle-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* Vehicle Image */
.asi-vehicle-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
    background: #f5f5f5;
}

.asi-vehicle-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asi-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #ccc;
}

.asi-no-image .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
}

/* Vehicle Gallery */
.asi-vehicle-gallery {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.asi-vehicle-gallery img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.asi-vehicle-gallery img.active {
    opacity: 1;
}

.asi-gallery-nav {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.asi-gallery-prev,
.asi-gallery-next {
    background: rgba(0, 0, 0, 0.7) !important;
    color: #fff !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    cursor: pointer;
    font-size: 18px !important;
    line-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    outline: none !important;
}

.asi-gallery-prev:hover,
.asi-gallery-next:hover {
    background: rgba(0, 0, 0, 0.9) !important;
}

.asi-gallery-prev:focus,
.asi-gallery-next:focus {
    outline: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

.asi-gallery-counter {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

/* Vehicle Content */
.asi-vehicle-content {
    padding: 20px;
}

.asi-vehicle-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.asi-vehicle-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.asi-vehicle-title a:hover {
    color: #0073aa;
}

.asi-vehicle-description {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asi-vehicle-price {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
    margin: 0 0 15px;
}

/* Vehicle Specs */
.asi-vehicle-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.asi-spec {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.asi-spec-icon {
    color: #999;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.asi-spec-value {
    font-weight: 500;
}

/* Vehicle Dealer */
.asi-vehicle-dealer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
    font-size: 13px;
    color: #666;
}

.asi-dealer-name {
    font-weight: 600;
    color: #333;
}

.asi-dealer-location::before {
    content: "•";
    margin-right: 8px;
}

/* Vehicle Footer */
.asi-vehicle-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 15px;
}

/* Vehicle Link */
.asi-vehicle-link {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.asi-vehicle-link:hover {
    background: #005a87;
    color: #fff;
}

/* WhatsApp Button - Circular Icon */
.asi-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.asi-whatsapp-btn:hover {
    background: #128C7E;
    color: #fff;
}

.asi-whatsapp-btn svg {
    flex-shrink: 0;
}

/* Vehicle Price in Footer */
.asi-vehicle-footer .asi-vehicle-price {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    text-align: right;
}

/* Detailed View */
.asi-vehicle-detailed {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.asi-vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.asi-vehicle-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.asi-vehicle-price-large {
    font-size: 32px;
    font-weight: 700;
    color: #0073aa;
}

.asi-vehicle-gallery-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.asi-vehicle-gallery-large img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

.asi-vehicle-featured-image {
    margin-bottom: 30px;
}

.asi-vehicle-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.asi-vehicle-details {
    margin-bottom: 30px;
}

.asi-vehicle-details h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.asi-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.asi-specs-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.asi-specs-table th,
.asi-specs-table td {
    padding: 12px;
    text-align: left;
}

.asi-specs-table th {
    font-weight: 600;
    color: #666;
    width: 200px;
}

.asi-specs-table td {
    color: #333;
}

.asi-vehicle-description-full {
    margin-bottom: 30px;
}

.asi-vehicle-description-full h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.asi-vehicle-dealer-info {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.asi-vehicle-dealer-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.asi-vehicle-dealer-info p {
    margin: 8px 0;
    color: #666;
}

.asi-vehicle-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.asi-button {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.asi-button-primary {
    background: #0073aa;
    color: #fff;
}

.asi-button-primary:hover {
    background: #005a87;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* List Layout */
.asi-layout-list .asi-vehicle-card {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
}

.asi-layout-list .asi-vehicle-image {
    padding-top: 0;
    height: 100%;
}

@media (max-width: 768px) {
    .asi-layout-list .asi-vehicle-card {
        grid-template-columns: 1fr;
    }
    
    .asi-layout-list .asi-vehicle-image {
        padding-top: 66.67%;
        height: auto;
    }
    
    .asi-vehicle-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}
