/* Boton ver carrito */
    .carrito-btn {
        position: relative;
        background: transparent;
        border: 1px solid rgba(203,168,106,.25);
        color: var(--gold-primary);
        width: 60px;
        height: 60px;
        border-radius: 10px;

        display:flex;
        align-items:center;
        justify-content:center;

        transition: all .25s ease;
    }

    .carrito-btn:hover {
        background: rgba(203,168,106,.08);
        border-color: var(--gold-primary);
        transform: translateY(-2px);
    }

    .badge {
        position: absolute;
        top: -9px;
        right: -8px;
        background: #e53935;
        color: white;
        font-size: 0.7rem;
        font-weight: bold;
        padding: 2px 5px;
        border-radius: 10px;
        min-width: 16px;
        text-align: center;
        line-height: 1;
        box-shadow: 0 0 4px rgba(0,0,0,0.3);
    }

    .sidebar-carrito {
        position: fixed;
        top: 0;
        right: -420px;
        width: 420px;
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
        background: #0f0f10;
        color: #fff;
        border-left: 1px solid rgba(203,168,106,.15);
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        transition: right 0.3s ease;
        font-family: Arial, sans-serif;
    }

    @media (max-width: 480px) {
        .sidebar-carrito {
            width: 350px;
        }
    }

    .sidebar-carrito.show {
        right: 0;
    }

    /* header */
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #151515;
        border-bottom: 1px solid rgba(203,168,106,.15);
    }

    .sidebar-header h2 {
        margin: 10px;
        font-size: 16px;
        font-weight: bold;
    }

    /* Body */
    .sidebar-body {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        color: #d1d5db;
    }

    /* Footer */
    .sidebar-footer {
        background: #151515;
        border-top: 1px solid rgba(203,168,106,.15);
        flex-shrink: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .resumen-line,
    .resumen-total {
        display: flex;
        justify-content: space-between;
        margin-bottom: 6px;
        margin-top: 10px;
    }

    .resumen-total {
        font-size: 18px;
        font-weight: bold;
        margin: 10px;
    }

    /* Boton guardar pedido*/
    .btn-guardar {
        width: 100%;
        padding: 14px;
        background: var(--gold-primary);
        color: #111;
        border: none;
        /*border-radius: 8px;*/
        margin-top: 12px;
        cursor: pointer;
        font-weight: bold;
    }

    .btn-guardar:hover {
        background: #d9b875;
    }

    .btn-guardar:active {
        transform: scale(0.97);
    }

    /* Boton cancelar pedido*/
    .btn-vaciar {
        width: 10%;
        padding: 14px;
        background: #ef0000cf;
        color: #fff;
        border: none;
        /*border-radius: 8px;*/
        margin-top: 12px;
        cursor: pointer;
        font-weight: bold;
    }

    .btn-vaciar:active {
        transform: scale(0.97);
    }

    @media (max-width: 900px) {
        .form-row-aligned {
            flex-direction: column;
            align-items: stretch;
        }

        .btn-guardar {
            width: 80%;
        }

        .btn-vaciar {
            width: 20%;
        }
    }

    /* Rows del carrito */
    .cart-row {
        display: flex;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,.06);
        padding: 10px;
        gap: 10px;
    }

    .cart-row-img img {
        width: 50px;
        height: 50px;
        object-fit: contain;
        border: 1px solid #eee;
        border-radius: 6px;
    }

    .noimg {
        width: 50px;
        height: 50px;
        background: #f3f3f3;
        border-radius: 6px;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #777;
    }

    .cart-row-info {
        flex: 1;
    }

    .cart-row-title {
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 2px;
        color: #fff;
    }

    .cart-row-desc p{
        font-size: 12px !important;
        color: #c9c4c4 !important;
    }

    .cart-row-total {
        text-align: right;
        font-weight: bold;
        font-size: 13px;
        min-width: 85px;
        color:#fff;
    }

    .del-item {
        display: block;
        font-size: 11px;
        color: #d63031;
        cursor: pointer;
        margin-top: 2px;
    }


    .select2-container--open {
        z-index: 110 !important;
    }


    #usocfdi option{
        white-space: normal;
    }

    .modal-close:hover {
        transform: rotate(90deg) scale(1.05);
    }

    .modal-close i {
        color: red !important;
    }

    /* Overlay (fondo borroso) */
    #overlayCarrito{
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        backdrop-filter: blur(5px); /* Aquí está la magia */
        -webkit-backdrop-filter: blur(5px);
        z-index: 100;
        display: none;
    }

    #modalCarrito2{
        z-index: 110;
    }

    .cart-header {
        padding: 25px 30px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        background: linear-gradient(to bottom, rgba(18,19,22,1), rgba(10,10,12,1));
    }
    .cart-title {
        font-family: 'Cinzel', serif;
        color: var(--gold-primary);
        font-size: 1.3rem;
        margin: 0;
        letter-spacing: 2px;
        text-transform: uppercase;
    }

    /* Estado Vacío */
    .cart-empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 40px;
        text-align: center;
        opacity: 0.5;
    }
    .cart-empty-state i {
        font-size: 4rem;
        color: var(--gold-primary);
        margin-bottom: 20px;
        opacity: 0.5;
    }

/* Alert cuando se modifica un producto ya agregado*/
    .alert-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 50;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .alert {
        min-width: 220px;
        padding: 12px 18px;
        border-radius: 8px;
        color: #fff;
        font-size: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.25);
        opacity: 0;
        transform: translateX(100%);
        transition: all 0.4s ease;
    }
    .alert.show {
        opacity: 1;
        transform: translateX(0);
    }
    .alert.success { background-color: #2ecc71; }
    .alert.error   { background-color: #e74c3c; }
    .alert.warning { background-color: #f39c12; }
    .alert.info    { background-color: #3498db; }
