/**
 * ESTILOS PARA EL CARRITO DINÁMICO DEL HEADER
 * Proyecto: Dro Santa María
 * Fecha: 2025-09-13
 */

/* Dropdown del carrito */
.ps-cart--mini {
    position: absolute;
    top: 100%;
    right: 0;
    width: 420px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    max-height: 500px;
    overflow-y: auto;
    margin-top: 5px;
}

/* Crear puente invisible entre el ícono y el dropdown */
.ps-cart--mini::before {
    content: '';
    position: absolute;
    top: -10px;
    right: 0;
    width: 60px;
    height: 15px;
    background: transparent;
    z-index: 9998;
}

/* Estados del carrito */
#cart-loading,
#cart-empty {
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

#cart-loading i {
    font-size: 24px;
    color: #EC008C;
    margin-bottom: 10px;
}

#cart-empty p {
    margin-bottom: 15px;
    font-size: 16px;
}

/* Contenido del carrito */
#cart-content {
    padding: 0;
}

/* Lista de productos - SOLO para el carrito del header */
.ps-cart--mini .ps-cart__items {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Producto individual - SOLO para el carrito del header */
.ps-cart--mini .ps-cart__item {
    border-bottom: 1px solid #f0f0f0;
    padding: 15px;
    transition: background-color 0.2s ease;
}

.ps-cart--mini .ps-cart__item:hover {
    background-color: #f9f9f9;
}

.ps-cart--mini .ps-cart__item:last-child {
    border-bottom: none;
}

/* Producto mini-cart - SOLO para el carrito del header */
.ps-cart--mini .ps-product--mini-cart {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.ps-cart--mini .ps-product__thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 0;
    overflow: hidden;
    border: none;
}

.ps-cart--mini .ps-product__thumbnail img {
    width: 80px !important;
    height: 80px !important;
    object-fit: contain;
    object-position: left center;
    transition: transform 0.2s ease;
    display: block;
    margin: -20px;
}

.ps-cart--mini .ps-product__thumbnail:hover img {
    transform: scale(1.05);
}

/* Contenido del producto - SOLO para el carrito del header */
.ps-cart--mini .ps-product__content {
    flex: 1;
    min-width: 0;
}

.ps-cart--mini .ps-product__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

.ps-cart--mini .ps-product__name:hover {
    color: #EC008C;
    text-decoration: none;
}

.ps-cart--mini .ps-product__meta {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.ps-cart--mini .ps-product__quantity {
    display: inline-block;
    margin-right: 10px;
    color: #888;
}

.ps-cart--mini .ps-product__price {
    font-weight: 600;
    color: #EC008C;
}

.ps-cart--mini .ps-product__presentation {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* Botón eliminar - SOLO para el carrito del header */
.ps-cart--mini .ps-product__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: auto;
    height: auto;
    background: transparent;
    color: #888;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.7;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    box-shadow: none;
    padding: 2px;
}

.ps-cart--mini .ps-product__remove:hover {
    opacity: 1;
    background: transparent;
    color: #ff0404;
    text-decoration: none;
    transform: none;
    box-shadow: none;
}

/* Icono X simple */
.ps-cart--mini .ps-product__remove::before {
    content: '×';
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.ps-cart--mini .ps-product__remove i {
    display: none;
}

/* Total del carrito - SOLO para el carrito del header */
.ps-cart--mini .ps-cart__total {
    padding: 15px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    background: #f8f9fa;
}

.ps-cart--mini .ps-cart__total span:last-child {
    color: #EC008C;
    font-size: 18px;
}

/* Footer del carrito - SOLO para el carrito del header */
.ps-cart--mini .ps-cart__footer {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.ps-cart--mini .ps-cart__footer .ps-btn {
    width: 100%;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.ps-cart--mini .ps-cart__footer .ps-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.ps-cart--mini .ps-cart__footer .ps-btn:hover::before {
    left: 100%;
}

.ps-cart--mini .ps-cart__footer .ps-btn--outline {
    background: transparent;
    border: 2px solid #EC008C;
    color: #EC008C;
    box-shadow: 0 2px 8px rgba(236, 0, 140, 0.15);
}

.ps-cart--mini .ps-cart__footer .ps-btn--outline:hover {
    background: #EC008C;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(236, 0, 140, 0.3);
}

.ps-cart--mini .ps-cart__footer .ps-btn--warning {
    background: linear-gradient(135deg, #EC008C 0%, #d1007a 100%);
    border: 2px solid #EC008C;
    color: white;
    box-shadow: 0 4px 15px rgba(236, 0, 140, 0.3);
}

.ps-cart--mini .ps-cart__footer .ps-btn--warning:hover {
    background: white;
    border-color: #EC008C;
    color: #EC008C;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 0, 140, 0.4);
}

/* Badge del contador */
#cart-count-header {
    position: absolute;
    right: -8px;
    background: #EC008C;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* Animación para el badge */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.badge.updated {
    animation: bounce 0.6s;
}

/* Responsive */
@media (max-width: 768px) {
    .ps-cart--mini {
        width: 380px;
        right: -50px;
    }
    
    .ps-cart--mini .ps-product__thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .ps-cart--mini .ps-product__thumbnail img {
        width: 70px !important;
        height: 70px !important;
    }
    
    .ps-product__name {
        font-size: 13px;
    }
    
    .ps-cart--mini .ps-cart__footer {
        padding: 15px 10px;
        gap: 10px;
    }
    
    .ps-cart--mini .ps-cart__footer .ps-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ps-cart--mini {
        width: 320px;
        right: -80px;
    }
}

/* Scrollbar personalizada - SOLO para el carrito del header */
.ps-cart--mini .ps-cart__items::-webkit-scrollbar {
    width: 6px;
}

.ps-cart--mini .ps-cart__items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ps-cart--mini .ps-cart__items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ps-cart--mini .ps-cart__items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
