
/* Almargen Mini Cart v1.3.0 - estable, sin blur ni overlay */

.amc-mini-cart{
    position:relative;
    display:inline-block;
    font-family:inherit;
    z-index:99999;
}


/* TEMA OSCURO (por defecto): pensado para navbar negra */
.amc-mini-cart.amc-theme-dark .amc-trigger{
    color:#fff;
}

.amc-mini-cart.amc-theme-dark .amc-trigger:hover{
    background:rgba(255,255,255,.14);
}

.amc-mini-cart.amc-theme-dark .amc-count{
    background:#fff;
    color:#111;
    box-shadow:0 2px 8px rgba(0,0,0,.30);
}

.amc-mini-cart.amc-theme-dark .amc-label,
.amc-mini-cart.amc-theme-dark .amc-header-total{
    color:#fff;
}

/* TEMA CLARO opcional */
.amc-mini-cart.amc-theme-light .amc-trigger{
    color:#111;
}

.amc-mini-cart.amc-theme-light .amc-trigger:hover{
    background:rgba(0,0,0,.08);
}

.amc-mini-cart.amc-theme-light .amc-count{
    background:#111;
    color:#fff;
}

.amc-trigger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-width:44px;
    min-height:44px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:inherit;
    padding:8px 10px;
    cursor:pointer;
    font:inherit;
    transition:background-color .2s ease, transform .2s ease;
    -webkit-tap-highlight-color:transparent;
}

.amc-trigger:hover{
    background:rgba(0,0,0,.08);
    transform:translateY(-1px);
}

.amc-mini-cart.amc-theme-dark .amc-trigger:hover{
    background:rgba(255,255,255,.14);
}

.amc-trigger:focus-visible{
    outline:2px solid currentColor;
    outline-offset:2px;
}

.amc-icon-wrap{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.amc-cart-icon{
    width:27px;
    height:27px;
    display:block;
}

.amc-count{
    position:absolute;
    top:-7px;
    right:-9px;
    min-width:19px;
    height:19px;
    line-height:19px;
    padding:0 5px;
    border-radius:999px;
    background:#111;
    color:#fff;
    font-size:11px;
    font-weight:800;
    text-align:center;
    box-sizing:border-box;
    box-shadow:0 2px 7px rgba(0,0,0,.18);
}

.amc-label,
.amc-header-total{
    font-size:14px;
}

/* PANEL */
.amc-panel{
    position:absolute;
    top:calc(100% + 10px);
    right:0;
    width:min(400px,calc(100vw - 24px));
    background:#fff;
    color:#222;
    border:1px solid rgba(0,0,0,.10);
    border-radius:12px;
    box-shadow:0 16px 40px rgba(0,0,0,.20);
    overflow:hidden;
    text-align:left;
    z-index:100000;
}

.amc-panel[hidden]{
    display:none !important;
}

.amc-panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:15px 16px;
    border-bottom:1px solid #eee;
    background:#fff;
    font-size:17px;
}

.amc-close{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    border:0;
    border-radius:50%;
    background:#f2f2f2;
    color:#222;
    font-size:25px;
    line-height:1;
    cursor:pointer;
    transition:background-color .2s ease, color .2s ease;
}

.amc-close:hover{
    background:#111;
    color:#fff;
}

.amc-panel-body{
    max-height:min(68vh,580px);
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
}

.amc-items{
    padding:2px 15px;
}

.amc-item{
    display:grid;
    grid-template-columns:66px minmax(0,1fr) 38px;
    gap:11px;
    align-items:center;
    padding:13px 0;
    border-bottom:1px solid #eee;
}

.amc-thumb img{
    width:66px;
    height:66px;
    object-fit:cover;
    border-radius:7px;
    display:block;
}

.amc-item-title{
    font-size:14px;
    line-height:1.35;
    font-weight:700;
}

.amc-item-title a{
    color:inherit;
    text-decoration:none;
}

.amc-item-title a:hover{
    text-decoration:underline;
}

.amc-item-meta{
    margin-top:5px;
    font-size:13px;
    opacity:.72;
}

.amc-remove{
    display:flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:38px;
    border-radius:50%;
    background:#f3f3f3;
    color:#777;
    text-decoration:none;
    font-size:22px;
    transition:all .18s ease;
}

.amc-remove:hover{
    background:#111;
    color:#fff;
    transform:scale(1.05);
}

.amc-summary{
    padding:15px 15px 17px;
    background:#fff;
}

.amc-subtotal-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    margin-bottom:14px;
    font-size:16px;
}

.amc-subtotal-row strong{
    font-size:17px;
}

/* BOTONES MÁS NOTORIOS */
.amc-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px;
}

.amc-button{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:46px;
    padding:10px 12px;
    border:2px solid #111;
    border-radius:8px;
    background:#fff;
    color:#111 !important;
    text-decoration:none !important;
    text-align:center;
    font-size:13px;
    font-weight:800;
    transition:all .18s ease;
}

.amc-button:hover{
    background:#111;
    color:#fff !important;
    transform:translateY(-2px);
    box-shadow:0 7px 18px rgba(0,0,0,.18);
}

.amc-button-primary{
    background:#111;
    border-color:#111;
    color:#fff !important;
}

.amc-button-primary:hover{
    background:#333;
    border-color:#333;
    color:#fff !important;
}

.amc-empty{
    padding:30px 18px;
    text-align:center;
}

.amc-empty .amc-button{
    margin-top:12px;
}

/* TABLET */
@media (max-width:1024px){
    .amc-panel{
        width:min(390px,calc(100vw - 20px));
    }
}

/* MÓVIL: drawer inferior SIN overlay ni blur */
@media (max-width:767px){
    .amc-mini-cart{
        position:static;
    }

    .amc-label,
    .amc-header-total{
        display:none;
    }

    .amc-trigger{
        min-width:46px;
        min-height:46px;
        padding:8px;
    }

    .amc-cart-icon{
        width:28px;
        height:28px;
    }

    .amc-panel{
        position:fixed;
        left:8px;
        right:8px;
        top:auto;
        bottom:8px;
        width:auto;
        max-width:none;
        max-height:82vh;
        border-radius:14px;
        box-shadow:0 10px 35px rgba(0,0,0,.24);
        z-index:999999;
        padding-bottom:env(safe-area-inset-bottom);
    }

    .amc-panel-head{
        position:sticky;
        top:0;
        z-index:2;
        padding:13px 14px;
        font-size:16px;
    }

    .amc-close{
        width:42px;
        height:42px;
    }

    .amc-panel-body{
        max-height:calc(82vh - 65px - env(safe-area-inset-bottom));
    }

    .amc-items{
        padding:0 13px;
    }

    .amc-item{
        grid-template-columns:60px minmax(0,1fr) 40px;
        gap:10px;
        padding:12px 0;
    }

    .amc-thumb img{
        width:60px;
        height:60px;
    }

    .amc-summary{
        position:sticky;
        bottom:0;
        z-index:2;
        padding:13px 13px calc(13px + env(safe-area-inset-bottom));
        border-top:1px solid #eee;
        box-shadow:0 -5px 16px rgba(0,0,0,.05);
    }

    .amc-actions{
        grid-template-columns:1fr;
        gap:8px;
    }

    .amc-button{
        min-height:50px;
        font-size:14px;
    }
}

@media (max-width:380px){
    .amc-panel{
        left:5px;
        right:5px;
        bottom:5px;
    }

    .amc-item{
        grid-template-columns:54px minmax(0,1fr) 38px;
    }

    .amc-thumb img{
        width:54px;
        height:54px;
    }

    .amc-item-title{
        font-size:13px;
    }
}
