/* Estilos para el botón del carrito */
.cart-button {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    margin-left: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para el indicador del carrito (burbuja roja con número) */
.cart-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff3b3b;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid white;
    transition: all 0.3s ease;
}

/* Animación para cuando se añade un producto */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-indicator.animate {
    animation: pulse 0.5s ease;
}

/* Estilos para la notificación de añadir/quitar */
.cart-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

/* Estilos para el modal del carrito */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.cart-modal-content {
    background-color: white;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #f8f8f8;
}

.cart-modal-header h2 {
    margin: 0;
    color: #333;
}

.cart-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.cart-modal-close:hover {
    color: #f44336;
}

.cart-modal-body {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}

.cart-items {
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 5px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #333;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.cart-item-quantity input {
    width: 40px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 0;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

.cart-item-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #ff0000;
    transition: transform 0.3s;
}

.cart-item-remove:hover {
    transform: scale(1.2);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #eee;
}

.cart-modal-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    background-color: #f8f8f8;
}

.cart-checkout-btn, .cart-clear-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cart-checkout-btn {
    background-color: #4caf50;
    color: white;
}

.cart-checkout-btn:hover {
    background-color: #45a049;
}

.cart-clear-btn {
    background-color: #f44336;
    color: white;
}

.cart-clear-btn:hover {
    background-color: #da3930;
}



/* Estilos adicionales para el modo offline */
.offline-mode {
    position: relative;
}

.offline-mode::after {
    content: "Offline";
    position: absolute;
    bottom: -15px;
    right: -10px;
    background-color: #ff9800;
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: bold;
}

.cart-sync-pending {
    margin-top: 15px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    text-align: center;
    color: #856404;
}

.cart-empty-message {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

button:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Modificación para notificaciones en modo offline */
.cart-notification {
    border-left: 4px solid #ff9800;
}