/* Contenedor Principal */
.cp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cp-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid #0073aa;
    display: inline-block;
    padding-bottom: 10px;
}

/* Grid Layout */
.cp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Tarjeta de Coche */
.cp-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.cp-card.sold {
    opacity: 0.8;
}

/* Imagen */
.cp-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* Cuadrado perfecto */
    overflow: hidden;
}

.cp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cp-card:hover .cp-card-image img {
    transform: scale(1.05);
}

.cp-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Contenido */
.cp-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cp-card-title {
    font-size: 1.25rem;
    margin: 0 0 10px;
    color: #2c3e50;
    line-height: 1.4;
}

.cp-card-price {
    font-size: 1.5rem;
    color: #27ae60;
    font-weight: 700;
    margin-bottom: 15px;
}

.cp-card-features {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Botón */
.cp-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #0073aa;
    color: #fff;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.cp-btn:hover {
    background: #005177;
    color: #fff;
}

.cp-btn.sold-btn {
    background: #95a5a6;
    cursor: default;
}

/* Separador Vendidos */
.cp-separator {
    text-align: center;
    margin: 60px 0 40px;
    position: relative;
}

.cp-separator h2 {
    background: #f1f1f1; /* Ajustar según fondo de la web */
    display: inline-block;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    color: #7f8c8d;
}

.cp-separator::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ccc;
    z-index: 0;
}

/* Estilos Formulario (Nuevo) */
.cp-form-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-top: 50px;
    margin-bottom: 50px;
    border: 1px solid #f0f0f0;
}

.cp-form-container h2 {
    margin-bottom: 25px;
    color: #222;
    font-size: 1.8rem;
    text-align: center;
    font-weight: 700;
}

.cp-form-container form p {
    margin: 0 0 15px 0 !important; /* Forzar sin margen de tema */
    padding: 0;
}

.cp-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #fdfdfd;
}

.cp-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    outline: none;
    background: #fff;
}

.cp-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.cp-submit-btn {
    display: block;
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(39, 174, 96, 0.2);
}

.cp-submit-btn:hover {
    background: #219150;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(39, 174, 96, 0.3);
}

.cp-submit-btn:active {
    transform: translateY(0);
}


/* Resumen Ficha Coche (Iconos) */
.cp-single-summary {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fdfdfd;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

.cp-summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #eaf6fc;
    color: #0073aa;
    border-radius: 50%;
}

.cp-summary-icon svg {
    width: 24px;
    height: 24px;
}

.cp-summary-text {
    display: flex;
    flex-direction: column;
}

.cp-summary-text strong {
    font-size: 1.1rem;
    color: #333;
    font-weight: 700;
}

.cp-summary-text span {
    font-size: 0.85rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 600px) {
    .cp-single-summary {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cp-summary-item {
        width: 100%;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f0f0;
    }

    .cp-summary-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
}

/* Lightbox para galería de fotos */
.coches-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s;
}

.coches-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    transition: background 0.3s;
    user-select: none;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Cursor pointer para imágenes de galería */
.galeria-coches img {
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
}

.galeria-coches img:hover {
    transform: scale(1.05);
    opacity: 0.9;
}
