/* Estilos para la notificación de producto añadido al carrito */
:root{
    --custom-cart-color: var(--color-primary);
}
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translate(-50%, -250px); 
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0); 
  }
}

.woocommerce a.added_to_cart{ display: none; }
.woocommerce a.remove:hover{
    background-color: white;
    svg{
        fill: var(--custom-cart-color);
    }
}

.custom-add-to-cart-notification {
    position: fixed;
    top: 40px;
    left: 50%;
    color: #747474;
    background-color: white;
    padding: 25px 20px 20px;
    z-index: 9998;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 5px;
    border: 1px solid #ddd;

	transform: translate(-50%, -250px);    
    animation: slideInFromTop .3s ease-out forwards; 
    
    .notification-content {
        display: flex;
        flex-direction: column;
        align-items: self-start;
        gap: 10px;
        width: 100vw;
        max-width: 300px;
    }
    
    .product-info {
        display: flex;
        align-items: center;
        line-height: 1.3;
    }
    
    .product-info img {
        width: 50px;
        height: 50px;
        margin-right: 10px;
        border-radius: 5px;
    }
    
    .close-btn {
        cursor: pointer;
        font-size: 24px;
        line-height: 1;
        position: absolute;
        z-index: 1;
        right: 0px;
        top: 0px;
        background: white;
        color: black;
        border-radius: 50%;
        width: 24px;
        text-align: center;
        aspect-ratio: 1 / 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .view-cart-link {
        color: white;
        background-color: var(--custom-cart-color);
        padding: 3px 15px;
        border-radius: 5px;
        text-decoration: none;
        align-self: center;
        font-size: .825rem;
        transition: all .2s;
        &:hover{
            background-color: oklch(from var(--custom-cart-color) 60% c h);
        }
    }
    .checkout-link-container{
        align-self: center;
        font-size: .9rem;
    }
}

/* Estilos para el ícono flotante */
.custom-floating-cart {
    position: fixed;
    z-index: 99;
    bottom: 20px;
    right: 20px;
    background-color: white;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all .2s;
    &:hover{
        background-color: oklch(0.9 0 0);
    }

    &.hidden{
        visibility: hidden;
    }

    & > .cart-icon{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        svg{
            width: 100%;
            height: auto;
            fill: black;
        }
    }
    & > .cart-count {
        position: absolute;
        top: -12px;
        right: -8px;
        background-color: #f10808;
        color: white;
        font-size: 12px;
        line-height: 1;
        border-radius: 50%;
        width: 22px;
        aspect-ratio: 1 / 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Estilos para el ícono fijo si existe (agregar en html un div.custom-fixed-cart) */
.custom-fixed-cart {
    position: relative;
    & > .cart-count{
        position: absolute;
        top: -10px;
        right: -10px;

    }
    & > .cart-count:not(:empty){
        background-color: #f10808;
        color: white;
        font-size: 10px;
        line-height: 1;
        border-radius: 50%;
        width: 18px;
        aspect-ratio: 1 / 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}


/* para personalizar la página del carrito */
.woocommerce a.remove{
    display: inline-block;
    height: auto;
    width: auto;
    font-size: 1.5rem;
    line-height: .7;
    svg{
        max-width: 26px;
        margin: auto;
    }
    span{
        font-size: 0.75rem;
        white-space: nowrap;
        color: black
        
    }
}
.woocommerce a.remove:hover span{
    color: var(--custom-cart-color);
}

.carrito-producto-link {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.carrito-producto-link:hover .carrito-titulo {
  color: var(--custom-cart-color);
}

img.carrito-imagen  {
  width: 80px;
  height: auto;
  margin-left: 5px;
  display: inline-block;
}
@media (max-width: 768px){
    .carrito-producto-link{
        flex-direction: column;
        align-items: flex-end;
        padding-left: 10px;
    }
    .woocommerce table.shop_table_responsive tr td, 
    .woocommerce-page table.shop_table_responsive tr td{
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}