/* Estilos para el carrito de compras */

/* Notificación de producto añadido */
.cart-notification {
    position: fixed !important;
    top: 30px !important;
    right: 30px !important;
    width: 380px !important;
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
    transform: translateY(-30px) !important;
    opacity: 0 !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    overflow: hidden !important;
    border-left: 4px solid #DE208B !important;
}

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

.notification-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 20px !important;
    background-color: #f8f8f8 !important;
    border-bottom: 1px solid #eeeeee !important;
}

.notification-title {
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 15px !important;
}

.notification-close {
    border: none !important;
    color: white !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
    text-align: center !important;
    transition: color 0.2s !important;
}

.notification-close:hover,
.notification-close:active,
.notification-close:focus {
    color: white !important;
    outline: none !important;
    box-shadow: none !important;
}

.notification-content {
    display: flex !important;
    padding: 20px !important;
    align-items: center !important;
}

.notification-image {
    flex: 0 0 90px !important;
    height: 90px !important;
    margin-right: 20px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
    background-color: #f8f8f8 !important;
}

.notification-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 6px !important;
}

.notification-text {
    flex: 1 !important;
}

.notification-text .product-name {
    margin-bottom: 15px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    color: #333 !important;
    position: relative !important;
    padding-left: 28px !important;
}

.notification-text .product-name:before {
    content: '\f058' !important;
    font-family: 'FontAwesome' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    color: #1A71B9 !important;
    font-size: 18px !important;
}

.notification-actions {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 15px !important; /* Aumentado desde 8px */
    gap: 15px !important; /* Añadido para separar los botones */
}

.notification-actions a {
    padding: 12px 18px !important; /* Aumentado desde 10px 16px */
    text-decoration: none !important;
    font-size: 13px !important; /* Reducido ligeramente para mejor ajuste */
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    position: relative !important;
    overflow: hidden !important;
    z-index: 1 !important;
    flex: 1 !important; /* Asegura que ambos botones tengan el mismo ancho */
}

.notification-actions .continue-shopping {
    background-color: #fff !important;
    color: #DE208B !important;
    border: 2px solid #DE208B !important;
    margin-right: 0 !important; /* Eliminado porque ahora usamos gap */
    position: relative !important;
    z-index: 1 !important;
}

.notification-actions .continue-shopping:before {
    content: "" !important;
    width: 0% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background: #DE208B !important;
    z-index: -1 !important;
    -webkit-transition: all 0.3s ease 0s !important;
    -moz-transition: all 0.3s ease 0s !important;
    -ms-transition: all 0.3s ease 0s !important;
    -o-transition: all 0.3s ease 0s !important;
    transition: all 0.3s ease 0s !important;
}

.notification-actions .continue-shopping:hover {
    color: white !important;
}

.notification-actions .continue-shopping:hover:before {
    width: 100% !important;
}

.notification-actions .go-to-cart {
    background-color: #DE208B !important;
    color: white !important;
    border: 2px solid #DE208B !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
}

.notification-actions .go-to-cart:before {
    content: "" !important;
    width: 0% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background: #1A71B9 !important;
    z-index: -1 !important;
    -webkit-transition: all 0.3s ease 0s !important;
    -moz-transition: all 0.3s ease 0s !important;
    -ms-transition: all 0.3s ease 0s !important;
    -o-transition: all 0.3s ease 0s !important;
    transition: all 0.3s ease 0s !important;
}

.notification-actions .go-to-cart:hover:before {
    width: 100% !important;
}

.notification-actions .go-to-cart:hover {
    border-color: #1A71B9 !important;
}

.cart-notification-progress-bar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #DE208B 0%, #1A71B9 100%) !important;
    width: 100% !important;
    transform: scaleX(1);
    transform-origin: left;
    transition: none;
    z-index: 10000 !important;
    pointer-events: none;
}

@media (max-width: 480px) {
    .cart-notification {
        width: calc(100% - 40px) !important;
        right: 20px !important;
        left: 20px !important;
    }

    .notification-image {
        flex: 0 0 70px !important;
        height: 70px !important;
        margin-right: 15px !important;
    }

    .notification-text .product-name {
        font-size: 14px !important;
    }

    .notification-actions a {
        padding: 7px 12px !important;
        font-size: 13px !important;
    }
}

/* Estilos para la página del carrito */
.flat-cart-table table {
    width: 100% !important;
}

.flat-cart-table th {
    background-color: #f5f5f5 !important;
    padding: 15px !important;
    text-align: center !important;
    color: #333 !important;
    font-weight: 600 !important;
}

.flat-cart-table td {
    padding: 15px !important;
    vertical-align: middle !important;
    text-align: center !important;
    border-bottom: 1px solid #e9e9e9 !important;
}

.flat-cart-table .img-product {
    display: inline-block !important;
    width: 80px !important;
    vertical-align: middle !important;
}

.flat-cart-table .img-product img {
    max-width: 100% !important;
}

.flat-cart-table .name-product {
    display: inline-block !important;
    max-width: 200px !important;
    text-align: left !important;
    padding-left: 15px !important;
    vertical-align: middle !important;
}

.flat-cart-table .quantity input {
    width: 70px !important;
    text-align: center !important;
    padding: 10px !important;
    border: 1px solid #e9e9e9 !important;
}

.flat-cart-table .remove-item {
    color: #DE208B !important;
    font-size: 18px !important;
}

.flat-cart-table .remove-item:hover {
    color: #1A71B9 !important;
}

.cart-buttons {
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 20px !important;
}

.cart-buttons a {
    display: inline-block !important;
    padding: 10px 20px !important;
    border: 2px solid #DE208B !important;
    color: #DE208B !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
}

.cart-buttons a:before {
    content: "" !important;
    width: 0% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background: #DE208B !important;
    z-index: -1 !important;
    -webkit-transition: all 0.3s ease 0s !important;
    -moz-transition: all 0.3s ease 0s !important;
    -ms-transition: all 0.3s ease 0s !important;
    -o-transition: all 0.3s ease 0s !important;
    transition: all 0.3s ease 0s !important;
}

.cart-buttons a:hover {
    color: white !important;
    text-decoration: none !important;
}

.cart-buttons a:hover:before {
    width: 100% !important;
}

.cart-totals {
    background-color: #f5f5f5 !important;
    padding: 30px !important;
}

.cart-totals h3 {
    margin-bottom: 20px !important;
    color: #333 !important;
    font-size: 20px !important;
}

.cart-totals table {
    width: 100% !important;
    margin-bottom: 20px !important;
}

.cart-totals td {
    padding: 10px 0 !important;
    border-bottom: 1px solid #e9e9e9 !important;
}

.cart-totals tr:last-child td {
    font-weight: bold !important;
    font-size: 18px !important;
    border-bottom: none !important;
    padding-top: 20px !important;
}

.cart-totals td:last-child {
    text-align: right !important;
}

.btn-cart-totals {
    text-align: center !important;
}

.btn-cart-totals a {
    display: block !important;
    padding: 12px 20px !important;
    background-color: #DE208B !important;
    color: white !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
}

.btn-cart-totals a:before {
    content: "" !important;
    width: 0% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background: #1A71B9 !important;
    z-index: -1 !important;
    -webkit-transition: all 0.3s ease 0s !important;
    -moz-transition: all 0.3s ease 0s !important;
    -ms-transition: all 0.3s ease 0s !important;
    -o-transition: all 0.3s ease 0s !important;
    transition: all 0.3s ease 0s !important;
}

.btn-cart-totals a:hover:before {
    width: 100% !important;
}

.btn-cart-totals a.disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.5 !important;
}

.btn-cart-totals a.disabled:before {
    display: none !important;
}

.btn-cart-totals a.disabled:hover {
    background-color: #ccc !important;
    color: #666 !important;
}

/* Estilos adicionales para botones deshabilitados usando data-disabled */
.btn-cart-totals a[data-disabled="true"] {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.5 !important;
}

.btn-cart-totals a[data-disabled="true"]:before {
    display: none !important;
}

.btn-cart-totals a[data-disabled="true"]:hover {
    background-color: #ccc !important;
    color: #666 !important;
}

/* Estilos para botones deshabilitados en el carrito */
.cart-btn-update a.disabled,
.cart-btn-update a:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #cccccc !important;
    color: #666666 !important;
}

.cart-btn-update a.disabled:hover,
.cart-btn-update a:disabled:hover {
    background-color: #cccccc !important;
    color: #666666 !important;
    transform: none !important;
}

/* Mejorar la visualización del botón de checkout deshabilitado */
.btn-cart-totals a.disabled,
.btn-cart-totals a:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #cccccc !important;
    color: #666666 !important;
}

.btn-cart-totals a.disabled:hover,
.btn-cart-totals a:disabled:hover {
    background-color: #cccccc !important;
    color: #666666 !important;
    transform: none !important;
}

/* Badge del carrito en el menú */
.mini-cart-count {
    position: absolute !important;
    top: -10px !important;
    right: -10px !important;
    background-color: #DE208B !important;
    color: white !important;
    font-size: 12px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    text-align: center !important;
    border-radius: 50% !important;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .flat-cart-table thead {
        display: none !important;
    }

    .flat-cart-table tbody tr {
        display: block !important;
        margin-bottom: 20px !important;
        border: 1px solid #e9e9e9 !important;
    }

    .flat-cart-table tbody td {
        display: block !important;
        text-align: right !important;
        border: none !important;
        border-bottom: 1px solid #e9e9e9 !important;
        padding: 10px 15px !important;
    }

    .flat-cart-table tbody td:before {
        content: attr(data-title) !important;
        float: left !important;
        font-weight: 600 !important;
    }

    .flat-cart-table .img-product,
    .flat-cart-table .name-product {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        text-align: center !important;
        padding: 0 !important;
        margin-bottom: 10px !important;
    }

    .cart-buttons {
        flex-direction: column !important;
    }

    .cart-buttons div {
        margin-bottom: 10px !important;
    }

    .cart-buttons a {
        display: block !important;
        text-align: center !important;
    }
}

/* Estilos para precios con descuento y etiquetas en el mini-carrito */
.original-price {
    text-decoration: line-through !important;
    color: #999 !important;
    margin-right: 5px !important;
    font-size: 0.9em !important;
}

.discounted-price {
    color: #e53935 !important;
    font-weight: bold !important;
}

/* Estilos actualizados para el badge de categoría tipo */
.category-type-badge {
    display: block !important;
    padding: 3px 6px !important;
    border-radius: 3px !important;
    font-size: 0.5em !important;
    margin-top: 5px !important;
    text-align: center !important;
    width: 100% !important;
}

/* Badge dentro del contenedor de imagen */
.img-product .category-type-badge {
    position: static !important;
    display: block !important;
    margin-left: 0 !important;
    margin-top: 8px !important;
    width: 100% !important;
    text-align: center !important;
    /* NUEVO: Asegura que esté debajo de la imagen y centrado */
    order: 2 !important;
}

/* Asegurar que el contenedor de imagen sea columnar para apilar elementos */
.img-product {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 80px !important;
    vertical-align: middle !important;
    /* NUEVO: Asegura que los hijos se apilen correctamente */
}

/* Ajustes para mini-carrito */
.mini-cart-item-image .category-type-badge {
    margin-top: 3px !important;
    font-size: 0.7em !important;
}

/* Mantener colores específicos */
.category-type-badge.liso {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
}

.category-type-badge.personalizado {
    background-color: #fff8e1 !important;
    color: #ff8f00 !important;
}

.cart-event-label {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    font-size: 0.8em !important;
    z-index: 1 !important;
}

/* Ajuste para que el badge de evento en el carrito no sea tan grande cuando no es imagen */
.flat-cart-table .cart-event-label:not(.image-only) {
    font-size: 0.7em !important;
    padding: 1px 4px !important;
    line-height: 1.2 !important;
    max-width: 80px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.cart-event-label.image-only {
    background: transparent !important;
    padding: 0 !important;
}

.cart-event-label.image-only img {
    max-height: 40px !important;
    max-width: 40px !important;
}

/* Asegurar que los contenedores de imágenes en el mini-carrito tengan posición relativa */
.mini-cart-item .mini-cart-item-image {
    position: relative !important;
}

/* Mejoras para la visualización de opciones en el carrito */
.flat-cart-table .name-product small {
    color: #666 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.flat-cart-table .name-product small.text-muted {
    font-style: italic !important;
    opacity: 0.7 !important;
}

.flat-cart-table .name-product small strong {
    color: #333 !important;
    font-weight: 600 !important;
}

/* Estilos para las opciones en el mini-carrito */
.mini-cart-item-options {
    font-size: 11px !important;
    color: #666 !important;
    margin-top: 2px !important;
    line-height: 1.2 !important;
}

.mini-cart-item-options.text-muted {
    font-style: italic !important;
    opacity: 0.7 !important;
}

/* Badges de tipo de categoría mejorados */
.category-type-badge {
    display: inline-block !important;
    padding: 2px 4px !important;
    border-radius: 10px !important;
    font-size: 0.6em !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    margin-top: 3px !important;
}

.category-type-badge.liso {
    background-color: #E3F2FD !important;
    color: #1976D2 !important;
}

.category-type-badge.personalizado {
    background-color: #FFF3E0 !important;
    color: #F57C00 !important;
}

/* NUEVO: Estilos para controles de cantidad con botones en el carrito */
.cart-item-quantity-control {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    position: relative;
}

.cart-item-quantity-control input[type="number"].item-quantity {
    width: 55px !important;
    text-align: center !important;
    padding: 7px 0 !important;
    font-size: 15px !important;
    border: 1px solid #e9e9e9 !important;
    border-radius: 4px !important;
    margin: 0 2px !important;
}

.cart-item-quantity-control button {
    width: 28px !important;
    height: 28px !important;
    border: 1px solid #DE208B !important;
    background: #fff !important;
    color: #DE208B !important;
    font-size: 18px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-quantity-control button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: #f5f5f5 !important;
    color: #aaa !important;
}

.cart-item-quantity-control button:hover:not(:disabled) {
    background: #DE208B !important;
    color: #fff !important;
}
