/**
 * Estilos para el carrito personalizado
 */

/* Mini carrito */
.mini-cart-container {
    position: relative;
    display: inline-block;
}

/* Estilo del botón del carrito */
.cart-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    height: auto;
    transition: all 0.3s ease;
    outline: none;
}

.cart-toggle:hover {
    transform: scale(1.05);
}

.cart-toggle:focus {
    outline: none;
}

.cart-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(103, 114, 229, 0.4);
    border-radius: 4px;
}

.cart-toggle .toggle-inner {
    display: flex;
    align-items: center;
}

.cart-toggle .toggle-icon {
    font-size: 22px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    color: #333;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Animación de rebote para el icono del carrito */
.cart-toggle .toggle-icon.cart-bounce {
    animation: cartBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cartBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Animación de producto añadido al carrito */
.cart-item-animation {
    color: #6772E5;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.cart-toggle:hover .toggle-icon {
    color: #6772E5;
}

.cart-toggle .toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    transition: color 0.3s ease;
}

.cart-toggle:hover .toggle-text {
    color: #6772E5;
}

.mobile-nav-toggle .toggle-text {
    display: none;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #000;
    color: white;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    transform-origin: center;
    animation: pulse 1.5s infinite;
    border: solid 1px #fff;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
}

.mini-cart {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    z-index: 9999;
    display: none; /* Cerrado por defecto */
    margin-top: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.08);
    max-height: calc(100vh - 120px);
    flex-direction: column;
    pointer-events: auto; /* Asegurar que los eventos del mouse funcionen */
}

.mini-cart.active {
    display: flex;
    animation: fadeIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: all; /* Asegurar que los eventos del mouse funcionen */
}

/* Mejorar interacción con botones */
.mini-cart button,
.mini-cart a {
    position: relative;
    z-index: 10000;
    pointer-events: auto;
}



@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-15px); 
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    }
}

.mini-cart:before {
    content: '';
    position: absolute;
    top: -8px;
    right: 18px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.04);
}

.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.mini-cart-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
}

.mini-cart-title i {
    margin-right: 8px;
    color: #6772E5;
    font-size: 18px;
}

.close-mini-cart {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #777;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    outline: none;
}

.close-mini-cart:hover {
    background-color:#000;
    color: #fff;
    transform: rotate(90deg);
}

.close-mini-cart:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(103, 114, 229, 0.4);
}

.mini-cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 18px;
    scrollbar-width: thin;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mini-cart-content::-webkit-scrollbar {
    width: 6px;
}

.mini-cart-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.mini-cart-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.mini-cart-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    text-align: center;
    color: #777;
    position: relative;
}

.empty-cart i {
    font-size: 52px;
    color: #6772E5;
    opacity: 0.5;
    margin-bottom: 18px;
    animation: float 4s ease-in-out infinite;
    position: relative;
}

.empty-cart i::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    animation: shadow 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes shadow {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0.1;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.3;
    }
}

.empty-cart p {
    font-size: 20px;
    margin: 0 0 8px;
    font-weight: 600;
    color: #333;
}

.empty-cart small {
    font-size: 14px;
    opacity: 0.7;
    max-width: 200px;
    max-width: 80%;
    line-height: 1.4;
}

.cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-items .remove-from-cart .fa-times::before {
    color: #000;
}

.cart-items .remove-from-cart:hover {
    background-color: #000;
    color: #fff;
}

.cart-items .remove-from-cart:hover .fa-times::before {
    color: #fff;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px;
}

.cart-item:hover {
    background-color: rgba(103, 114, 229, 0.05);
    transform: translateX(2px);
}

.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cart-item:not(:last-child) {
    margin-bottom: 5px;
}

.item-info {
    flex-grow: 1;
    padding-right: 15px;
}

.item-info h4 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    transition: color 0.3s ease;
}

.cart-item:hover .item-info h4 {
    color: #000;
}

.item-details {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #777;
}

.item-quantity {
    margin-right: 12px;
    background-color: #f1f1f1;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
}

.cart-item:hover .item-quantity {
    background-color: #e0e0e0;
}

.item-price {
    font-weight: 600;
    color: #000;
    font-size: 14px;
}

.remove-from-cart {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
    outline: none;
    opacity: 0.7;
}

.remove-from-cart:hover {
    background-color: rgba(231, 76, 60, 0.15);
    transform: scale(1.15) rotate(90deg);
    opacity: 1;
}

.remove-from-cart:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
}

.remove-from-cart i {
    font-size: 14px;
}

.mini-cart-footer {
    padding: 15px 18px 18px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-weight: bold;
    margin-bottom: 10px;
}

.cart-total-label {
    font-size: 16px;
    color: #333;
}

.cart-total-amount {
    font-size: 18px;
    color: #000;
    font-weight: 700;
}

/* Estilos para el contenedor de cupón */
.coupon-container {
    margin-bottom: 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coupon-input {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
    font-family: "Neue Haas Grotesk Display Pro", sans-serif;
    background-color: #fff;
    color: #333;
    margin-bottom: 5px;
}

.coupon-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.coupon-input::placeholder {
    color: #999;
    opacity: 0.8;
}

.coupon-input-group .coupon-input {
    width: calc(100% - 84px);
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    border: solid 1px #000;
    padding: 10px;
}


.coupon-button {
    padding: 12px 20px;
    background: #000;
    color: #fff;
    border: solid 1px #000;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "Neue Haas Grotesk Display Pro";
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    text-decoration: none;
}

.coupon-button:hover {
    background: #fff;
    color: #000;
    border: solid 1px #000;
    text-decoration: none;
}

.coupon-button:active {
    transform: translateY(1px);
}

.coupon-message {
    font-size: 12px;
    margin-top: 2px;
    min-height: 18px;
    text-align: center;
    font-weight: 500;
}

.coupon-message.success {
    color: #4CAF50;
}

.coupon-message.error {
    color: #e74c3c;
}

.cart-actions {
    margin-top: 10px;
}

.cart-actions button {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 75px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
     font-family: "Neue Haas Grotesk Display Pro";
    font-size: 14px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid #000;
    outline: none;
    text-decoration: none;

}

.cart-actions button i {
    margin-right: 10px;
    font-size: 16px;
}

.cart-actions button:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.cart-actions button:active {
    transform: translateY(0);
    box-shadow: 0 3px 5px rgba(103, 114, 229, 0.4);
}

.cart-actions button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(103, 114, 229, 0.3), 0 4px 10px rgba(103, 114, 229, 0.3);
}

.cart-actions button:disabled {
    background: #b7b7b7;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.cart-actions button.loading {
    background: #5469d4;
    position: relative;
    overflow: hidden;
}

.cart-actions button.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Notificaciones del carrito */
.cart-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    color: #333;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 350px;
    border-left: 4px solid #6772E5;
    font-size: 14px;
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-notification i {
    margin-right: 10px;
    font-size: 18px;
}

/* Tipos de notificaciones */
.cart-notification.success {
    border-left-color: #4CAF50;
}

.cart-notification.success i {
    color: #4CAF50;
}

.cart-notification.error {
    border-left-color: #e74c3c;
}

.cart-notification.error i {
    color: #e74c3c;
}

.cart-notification.info i {
    color: #6772E5;
}

@media (max-width: 767px) {
    .cart-notification {
        bottom: 15px;
        left: 15px;
        right: 15px;
        max-width: none;
        padding: 14px 16px;
        text-align: center;
        justify-content: center;
    }
}

/* Botón de añadir al carrito */
.add-to-cart {
    background: #6772E5;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 12px;
    width: 100%;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(103, 114, 229, 0.2);
}

.add-to-cart i {
    margin-right: 8px;
}

.add-to-cart:hover {
    background: #5469d4;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(103, 114, 229, 0.3);
}

.add-to-cart:active {
    transform: translateY(0);
    box-shadow: 0 3px 5px rgba(103, 114, 229, 0.3);
}

.add-to-cart:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(103, 114, 229, 0.3), 0 4px 10px rgba(103, 114, 229, 0.2);
}

/* Los estilos de notificación ya están definidos arriba */

/* Carrito siempre visible */
.responsive-cart {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.cart-toggle-wrapper.always-visible {
    display: flex;
    align-items: center;
    margin-left: 15px;
    position: relative;
    z-index: 100;
}

.cart-toggle-wrapper.always-visible .cart-toggle {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.cart-toggle-wrapper.always-visible .cart-toggle .fa-shopping-cart:before {
    color: #fff;
}

.cart-toggle-wrapper.always-visible .cart-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 992px) {
      .cart-toggle-wrapper.always-visible {
        position: absolute;
        top: 46%;
        right: 90px;
        margin: 0;
    }
}

/* Responsive */
@media (max-width: 767px) {
    .cart-toggle .toggle-text {
        display: none;
    }
    
    .cart-toggle .toggle-icon {
        font-size: 24px;
    }
    
    .cart-toggle-wrapper.always-visible {
        position: absolute;
        top: 46%;
        right: 90px;
        margin: 0;
    }
    
    .cart-toggle-wrapper.always-visible .cart-toggle {
        padding: 8px;
        background-color: rgba(255, 255, 255, 0.15);
        border-radius: 50%;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    .cart-count {
        min-width: 20px;
        height: 20px;
        font-size: 12px;
        right: -10px;
        top: -10px;
    }
    
    .mini-cart {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 85vh;
        margin: 0;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
        z-index: 9999;
        display: none;
        border: none;
    }
    
    .mini-cart:before {
        display: none;
    }
    
    .mini-cart.active {
        display: flex;
        flex-direction: column;
        animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0.8; }
        to { transform: translateY(0); opacity: 1; }
    }
    
    .mini-cart-header {
        padding: 16px 20px;
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }
    
    .mini-cart-title {
        font-size: 18px;
    }
    
    .mini-cart-content {
        flex: 1;
        max-height: none;
        padding: 15px 20px;
    }
    
    .empty-cart {
        padding: 50px 0;
    }
    
    .empty-cart i {
        font-size: 56px;
    }
    
    .item-info h4 {
        font-size: 15px;
        max-width: 180px;
    }
    
    .cart-item {
        padding: 15px 10px;
        margin-bottom: 8px;
    }
    
    .item-quantity {
        padding: 4px 10px;
    }
    
    .remove-from-cart {
        width: 36px;
        height: 36px;
    }
    
    .mini-cart-footer {
        padding: 18px 20px 25px;
        border-top: 1px solid rgba(0,0,0,0.08);
    }
    
    .cart-total {
        margin-bottom: 18px;
    }
    
    .cart-total-label,
    .cart-total-amount {
        font-size: 18px;
    }
    
    .cart-actions button {
        padding: 16px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    /* Overlay para cerrar el carrito al hacer clic fuera */
    .mini-cart-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mini-cart-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Las reglas responsivas para notificaciones ya están definidas arriba */
}