/**
 * Productos en Descuento WooCommerce - Estilos
 * Diseño responsive con estilo moderno tipo card
 */

/* Contenedor principal */
.pdw-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #c9a87c 0%, #b89968 100%);
    border-radius: 8px;
}

/* Grid de productos */
.pdw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Card del producto */
.pdw-product-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.pdw-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Badge de descuento */
.pdw-discount-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Contenedor de imagen */
.pdw-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.pdw-image-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
}

.pdw-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.pdw-product-card:hover .pdw-product-image {
    transform: scale(1.05);
}

/* Información del producto */
.pdw-product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    background: #ffffff;
}

/* Título del producto */
.pdw-product-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #2c3e50;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pdw-product-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pdw-product-title a:hover {
    color: #c9a87c;
}

/* Precios */
.pdw-price-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.pdw-regular-price {
    font-size: 16px;
    color: #95a5a6;
    text-decoration: line-through;
    font-weight: 400;
}

.pdw-sale-price {
    font-size: 24px;
    font-weight: 700;
    color: #27ae60;
}

/* Botón agregar al carrito */
.pdw-add-to-cart {
    width: 100%;
    padding: 14px 20px;
    background: #c9a87c;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
    text-transform: none;
}

.pdw-add-to-cart:hover {
    background: #b89968;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 168, 124, 0.3);
}

.pdw-add-to-cart:active {
    transform: translateY(0);
}

/* Mensaje sin productos */
.pdw-no-products {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 16px;
    background: #ecf0f1;
    border-radius: 8px;
}

/* Responsive Design */

/* Tablets grandes */
@media (max-width: 1200px) {
    .pdw-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .pdw-container {
        padding: 15px;
    }
    
    .pdw-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 20px;
    }
    
    .pdw-image-wrapper {
        height: 220px;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .pdw-container {
        padding: 15px;
        border-radius: 8px;
    }
    
    .pdw-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        padding: 15px 0;
    }
    
    .pdw-product-card {
        border-radius: 12px;
    }
    
    .pdw-image-wrapper {
        height: 200px;
        padding: 12px;
    }
    
    .pdw-product-info {
        padding: 16px;
        gap: 10px;
    }
    
    .pdw-product-title {
        font-size: 14px;
        min-height: 42px;
    }
    
    .pdw-regular-price {
        font-size: 14px;
    }
    
    .pdw-sale-price {
        font-size: 20px;
    }
    
    .pdw-add-to-cart {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .pdw-discount-badge {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Móviles medianos - transición a una columna */
@media (max-width: 600px) {
    .pdw-container {
        padding: 12px;
    }
    
    .pdw-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .pdw-image-wrapper {
        height: 180px;
    }
    
    .pdw-product-info {
        padding: 14px;
    }
    
    .pdw-product-title {
        font-size: 13px;
        min-height: 40px;
    }
    
    .pdw-sale-price {
        font-size: 18px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .pdw-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pdw-product-card {
        display: flex;
        flex-direction: column;
        max-width: 100%;
    }
    
    .pdw-image-wrapper {
        width: 100%;
        height: 220px;
        padding: 15px;
    }
    
    .pdw-product-info {
        flex: 1;
        padding: 18px;
    }
    
    .pdw-product-title {
        font-size: 15px;
        min-height: 42px;
        -webkit-line-clamp: 2;
    }
    
    .pdw-price-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin: 10px 0;
    }
    
    .pdw-regular-price {
        font-size: 15px;
    }
    
    .pdw-sale-price {
        font-size: 22px;
    }
    
    .pdw-add-to-cart {
        padding: 14px 18px;
        font-size: 15px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .pdw-image-wrapper {
        height: 200px;
        padding: 12px;
    }
    
    .pdw-product-info {
        padding: 15px;
    }
    
    .pdw-product-title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .pdw-sale-price {
        font-size: 20px;
    }
    
    .pdw-add-to-cart {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Mejoras de accesibilidad */
.pdw-add-to-cart:focus {
    outline: 3px solid #c9a87c;
    outline-offset: 2px;
}

.pdw-product-title a:focus {
    outline: 2px solid #c9a87c;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Animación de carga */
@keyframes pdw-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pdw-product-card {
    animation: pdw-fade-in 0.5s ease forwards;
}

/* Añadir delay escalonado a las cards */
.pdw-product-card:nth-child(1) { animation-delay: 0.05s; }
.pdw-product-card:nth-child(2) { animation-delay: 0.1s; }
.pdw-product-card:nth-child(3) { animation-delay: 0.15s; }
.pdw-product-card:nth-child(4) { animation-delay: 0.2s; }
.pdw-product-card:nth-child(5) { animation-delay: 0.25s; }
.pdw-product-card:nth-child(6) { animation-delay: 0.3s; }
