/* Magilu — cart page and side cart in the checkout v2 style (visual layer only). */
.mg-cart-v2 {
    --c2-ink:#1d1f1a; --c2-muted:#6b6e66; --c2-line:#e7e7e1; --c2-page:#f4f4ef; --c2-card:#fff;
    --c2-green:#2f5d34; --c2-green-dark:#244a29; --c2-green-soft:#eaf3eb; --c2-gold:#d9a526; --c2-gold-soft:#fbf3dc;
    --c2-radius:20px; --c2-shadow:0 1px 2px rgba(29,31,26,.04), 0 8px 24px rgba(29,31,26,.05);
    --c2-trash:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3'/%3E%3C/svg%3E");
}

/* Shared: chips, trust line, quantity stepper, remove link. */
.mg-cart-v2 .mg-cart-chip { display:inline-flex; align-items:center; margin-left:10px; padding:4px 10px; border-radius:999px; background:var(--c2-gold-soft); color:#8a6510; font-size:13px; font-weight:600; vertical-align:middle; letter-spacing:0; }
.mg-cart-v2 .mg-cart-chip[hidden] { display:none; }
.mg-cart-v2 .mg-cart-trust { margin:10px 0 0; text-align:center; font-size:13px; color:var(--c2-muted); }
.mg-cart-v2 .mg-cart-trust a { color:inherit; font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.mg-cart-v2 .quantity { display:inline-flex; align-items:center; height:42px; border:1.5px solid var(--c2-line); border-radius:999px; background:#fafaf7; }
.mg-cart-v2 .quantity button.decrease, .mg-cart-v2 .quantity button.increase {
    position:static !important; flex:0 0 auto; display:grid; place-items:center; width:42px !important; height:40px; padding:0 !important;
    border:0; background:transparent; color:var(--c2-ink) !important; font-size:22px !important; font-weight:500; line-height:1;
}
.mg-cart-v2 .quantity button.decrease::before, .mg-cart-v2 .quantity button.decrease::after,
.mg-cart-v2 .quantity button.increase::before, .mg-cart-v2 .quantity button.increase::after { display:none !important; }
.mg-cart-v2 .quantity input.qty { flex:0 0 auto; width:36px; height:40px; padding:0 !important; border:0; background:transparent; text-align:center; font-size:16px; font-weight:600; -moz-appearance:textfield; }
.mg-cart-v2 .quantity input.qty::-webkit-outer-spin-button, .mg-cart-v2 .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.mg-cart-v2 a.remove { display:inline-flex; align-items:center; gap:5px; font-size:13px; color:var(--c2-muted) !important; text-decoration:none !important; }
.mg-cart-v2 a.remove::before { content:""; width:15px; height:15px; background:currentColor; -webkit-mask:var(--c2-trash) center/contain no-repeat; mask:var(--c2-trash) center/contain no-repeat; }
.mg-cart-v2 a.remove i, .mg-cart-v2 a.remove svg { display:none; }

/* ---------- Side cart ---------- */
.mg-cart-v2 .popup-fly-cart .inner { background:var(--c2-page); }
.mg-cart-v2 .popup-fly-cart .fly-cart-header { position:relative; z-index:2; margin:0; padding-bottom:12px; background:var(--c2-page); }
.mg-cart-v2 .popup-fly-cart .fly-cart-title { font-size:24px; font-weight:700; letter-spacing:-.4px; color:var(--c2-ink); }
.mg-cart-v2 .popup-fly-cart .btn-close-fly-cart { display:grid; place-items:center; width:40px; height:40px; border-radius:50%; background:#fff; box-shadow:var(--c2-shadow); }
.mg-cart-v2 .popup-fly-cart .woocommerce-mini-cart { display:flex; flex-direction:column; gap:10px; margin:0; padding:2px 0 12px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item {
    display:grid !important; grid-template-columns:72px minmax(0,1fr); gap:12px; margin:0 !important; padding:12px !important;
    border:1px solid var(--c2-line) !important; border-radius:18px; background:var(--c2-card); box-shadow:var(--c2-shadow);
}
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-thumbnail { width:72px !important; margin:0 !important; padding:0 !important; border:0 !important; border-radius:14px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-thumbnail a,
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-thumbnail m-image { display:block; width:72px !important; height:72px; padding:0 !important; border:0 !important; border-radius:14px; overflow:hidden; background:#f1f1ec; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-thumbnail img { display:block; width:100% !important; height:100% !important; object-fit:cover; border:0 !important; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-info { min-width:0; padding:0 !important; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-name { margin:0 0 4px; font-size:15px; line-height:1.35; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation { display:grid; grid-template-columns:auto 1fr; gap:0 8px; margin:0 0 6px; font-size:12px; line-height:1.5; color:var(--c2-muted); }
.mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation dt, .mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation dd, .mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation p { margin:0; padding:0; font-weight:400; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-price { font-size:16px; font-weight:700; color:var(--c2-ink); }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-price small { font-size:11px; font-weight:400; color:var(--c2-muted); }
.mg-cart-v2 .popup-fly-cart .product-quantity-wrap { display:flex; flex-wrap:nowrap; align-items:center; justify-content:space-between; gap:8px; margin-top:8px; }
.mg-cart-v2 .popup-fly-cart .product-quantity-wrap .remove { flex:0 0 auto; white-space:nowrap; }
.mg-cart-v2 .popup-fly-cart .quantity { height:38px; }
.mg-cart-v2 .popup-fly-cart .quantity button.decrease, .mg-cart-v2 .popup-fly-cart .quantity button.increase { width:38px !important; height:36px; font-size:20px !important; }
/* Footer: a white card with totals and the main button. */
.mg-cart-v2 .popup-fly-cart .fly-cart-footer { margin:0 -1px; padding:14px 20px calc(14px + env(safe-area-inset-bottom)) !important; border-top:0 !important; border-radius:22px 22px 0 0; background:#fff !important; box-shadow:0 -8px 24px rgba(29,31,26,.07); }
.mg-cart-v2 .popup-fly-cart .cart-totals-table, .mg-cart-v2 .popup-fly-cart .cart-totals-table tr, .mg-cart-v2 .popup-fly-cart .cart-totals-table td, .mg-cart-v2 .popup-fly-cart .cart-totals-table th { background:transparent !important; }
.mg-cart-v2 .popup-fly-cart .cart-totals-table .order-total strong .amount { font-size:22px; font-weight:700; }
.mg-cart-v2 .popup-fly-cart .cart-totals-table .includes_tax { display:block; font-size:11px; color:var(--c2-muted); }
.mg-cart-v2 .popup-fly-cart .woocommerce-mini-cart__buttons { display:flex; flex-direction:column; gap:8px; margin-top:6px; }
.mg-cart-v2 .popup-fly-cart .woocommerce-mini-cart__buttons .checkout {
    display:flex !important; align-items:center; justify-content:center; width:100%; min-height:56px; margin:0;
    border:0 !important; border-radius:16px !important; background:var(--c2-green) !important; color:#fff !important;
    font-size:16px; font-weight:600; text-transform:none !important; letter-spacing:0 !important; box-shadow:0 10px 24px rgba(47,93,52,.28);
}
.mg-cart-v2 .popup-fly-cart .woocommerce-mini-cart__buttons .checkout:hover { background:var(--c2-green-dark) !important; }
.mg-cart-v2 .popup-fly-cart .woocommerce-mini-cart__buttons .view-cart { align-self:center; text-transform:none !important; letter-spacing:0 !important; font-weight:600; }
.mg-cart-v2 .popup-fly-cart .woocommerce-mini-cart__buttons .view-cart .button-text { text-transform:none; letter-spacing:0; }

/* ---------- Cart page ---------- */
.mg-cart-page.mg-cart-v2 { background:var(--c2-page); }
.mg-cart-page.mg-cart-v2 #page, .mg-cart-page.mg-cart-v2 #page-content, .mg-cart-page.mg-cart-v2 .site-content { background:transparent; }
.mg-cart-page .page-title-bar, .mg-cart-page #page-title-bar { display:none; }

.mg-cart-page .mg-journey { display:flex; align-items:center; gap:8px; margin:8px 0 16px; padding:14px 16px; border:1px solid var(--c2-line); border-radius:var(--c2-radius); background:var(--c2-card); box-shadow:var(--c2-shadow); }
.mg-cart-page .mg-journey__step { display:flex; align-items:center; gap:8px; flex:0 0 auto; font-size:14px; font-weight:600; color:var(--c2-muted); }
.mg-cart-page .mg-journey__icon { display:grid; place-items:center; width:32px; height:32px; border-radius:10px; background:#f1f1ec; font-size:15px; }
.mg-cart-page .mg-journey__step.is-current { color:var(--c2-ink); }
.mg-cart-page .mg-journey__step.is-current .mg-journey__icon { background:var(--c2-gold-soft); box-shadow:inset 0 0 0 1.5px var(--c2-gold); }
.mg-cart-page .mg-journey__line { flex:1 1 auto; height:4px; min-width:12px; border-radius:999px; background:#ecece6; }
.mg-cart-page .mg-cart-head { display:flex; align-items:center; margin:0 0 14px; }
.mg-cart-page .mg-cart-head strong { font-size:28px; font-weight:700; letter-spacing:-.6px; color:var(--c2-ink); }

/* Items: one grid per row (thumbnail, details, quantity, line total). */
.mg-cart-page table.shop_table.cart, .mg-cart-page table.shop_table.cart tbody { display:block; width:100%; margin:0; border:0; border-spacing:0; background:transparent; }
.mg-cart-page table.shop_table.cart thead { display:none; }
.mg-cart-page table.shop_table.cart tr.cart_item {
    display:grid; grid-template-columns:88px minmax(0,1fr) auto; grid-template-areas:"thumb info info" "thumb qty total";
    gap:12px 14px; align-items:center; margin:0 0 12px; padding:14px; border:1px solid var(--c2-line); border-radius:18px;
    background:var(--c2-card); box-shadow:var(--c2-shadow);
}
.mg-cart-page table.shop_table.cart tr.cart_item > td { display:block; width:auto !important; padding:0 !important; margin:0; border:0 !important; border-radius:0 !important; background:none !important; }
.mg-cart-page tr.cart_item td.col-product-info, .mg-cart-page tr.cart_item .product-wrap { display:contents !important; }
.mg-cart-page tr.cart_item .product-thumbnail { grid-area:thumb; align-self:start; position:static !important; width:auto !important; margin:0 !important; padding:0 !important; border:0 !important; }
.mg-cart-page tr.cart_item .product-thumbnail a, .mg-cart-page tr.cart_item .product-thumbnail m-image { display:block; width:88px !important; height:88px; border-radius:14px; overflow:hidden; background:#f1f1ec; }
.mg-cart-page tr.cart_item .product-thumbnail img { display:block; width:100% !important; height:100% !important; max-width:none; object-fit:cover; }
.mg-cart-page tr.cart_item .product-info { grid-area:info; min-width:0; padding:0 !important; margin:0 !important; }
.mg-cart-page tr.cart_item .product-title { margin:0 0 6px; font-size:16px; line-height:1.35; }
.mg-cart-page tr.cart_item dl.variation { display:grid; grid-template-columns:auto 1fr; gap:2px 8px; margin:0 0 6px; font-size:13px; line-height:1.45; color:var(--c2-muted); }
.mg-cart-page tr.cart_item dl.variation dt, .mg-cart-page tr.cart_item dl.variation dd, .mg-cart-page tr.cart_item dl.variation p { margin:0; padding:0; font-weight:400; }
.mg-cart-page tr.cart_item td.product-price { display:none !important; }
.mg-cart-page tr.cart_item td.product-quantity { grid-area:qty; justify-self:start; }
.mg-cart-page tr.cart_item td.product-subtotal { grid-area:total; justify-self:end; text-align:right; line-height:1.2; }
.mg-cart-page tr.cart_item .cart-item-label-mobile { display:none !important; }
.mg-cart-page tr.cart_item td.product-subtotal .amount { font-size:18px; font-weight:700; color:var(--c2-ink); }
.mg-cart-page tr.cart_item td.product-subtotal small { display:block; margin-top:2px; font-size:11px; color:var(--c2-muted); }
.mg-cart-page table.shop_table.cart tr:not(.cart_item) { display:block; }
.mg-cart-page table.shop_table.cart tr:not(.cart_item) > td { display:block; padding:0; border:0; background:none; }

/* Summary card. */
.mg-cart-page .cart-collaterals { margin-top:4px; }
.mg-cart-page .cart-collaterals .cart_totals { width:100% !important; float:none !important; padding:20px; border:1px solid var(--c2-line); border-radius:var(--c2-radius); background:var(--c2-card); box-shadow:var(--c2-shadow); }
.mg-cart-page .cart_totals .cart-footer-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 12px; }
.mg-cart-page .cart_totals .cart-footer-actions a { display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 6px; border:1px solid var(--c2-line); border-radius:14px; background:#fafaf7; font-size:13px; color:var(--c2-ink) !important; text-decoration:none; }
.mg-cart-page .cart_totals .cart-footer-actions a::before, .mg-cart-page .cart_totals .cart-footer-actions a::after { display:none; }
.mg-cart-page .cart_totals .order-total strong .amount { font-size:26px; font-weight:700; letter-spacing:-.5px; }
.mg-cart-page .cart_totals .includes_tax { display:block; font-size:11px; color:var(--c2-muted); }
.mg-cart-page .wc-proceed-to-checkout { padding:12px 0 0; }
.mg-cart-page .wc-proceed-to-checkout .checkout-button {
    display:flex !important; align-items:center; justify-content:center; width:100%; min-height:58px; margin:0 !important;
    border:0 !important; border-radius:16px !important; background:var(--c2-green) !important; color:#fff !important;
    font-size:17px !important; font-weight:600 !important; text-transform:none !important; letter-spacing:0 !important; box-shadow:0 10px 24px rgba(47,93,52,.30);
}
.mg-cart-page .wc-proceed-to-checkout .checkout-button:hover { background:var(--c2-green-dark) !important; }
.mg-cart-page .mg-prepared { border-radius:var(--c2-radius); }
.mg-cart-page .mg-prepared .button { text-transform:none; letter-spacing:0; border-radius:12px; }

@media (min-width:768px) {
    .mg-cart-page table.shop_table.cart tr.cart_item { grid-template-columns:104px minmax(0,1fr) auto 130px; grid-template-areas:"thumb info qty total"; gap:0 20px; padding:18px 22px; }
    .mg-cart-page tr.cart_item .product-thumbnail a, .mg-cart-page tr.cart_item .product-thumbnail m-image { width:104px !important; height:104px; }
}

/* Desktop: products left, summary always right (sticky); staff box under the products. */
@media (min-width:1024px) {
    .mg-cart-page div.woocommerce-cart-form { display:grid; grid-template-columns:minmax(0,1fr) 380px; gap:0 32px; align-items:start; }
    .mg-cart-page div.woocommerce-cart-form > * { grid-column:1; }
    .mg-cart-page div.woocommerce-cart-form > .cart-collaterals { grid-column:2; grid-row:1 / span 4; width:100% !important; max-width:none; margin:0 !important; float:none !important; position:sticky; top:24px; }
}

/* Mobile: total and "Vai al pagamento" fixed at the bottom while scrolling the products. */
.mg-cart-bar { display:none; }
@media (max-width:767px) {
    .mg-cart-page .mg-journey__label { font-size:13px; }
    .mg-cart-page .mg-cart-head strong { font-size:24px; }
    .mg-cart-page .mg-cart-bar {
        position:fixed; left:12px; right:12px; bottom:calc(64px + env(safe-area-inset-bottom)); z-index:9996;
        display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 10px 10px 18px;
        border-radius:20px; background:var(--c2-ink); color:#fff; box-shadow:0 12px 30px rgba(0,0,0,.25);
        transform:translateY(140%); opacity:0; transition:transform .25s ease, opacity .25s ease; pointer-events:none;
    }
    .mg-cart-page .mg-cart-bar.is-visible { transform:none; opacity:1; pointer-events:auto; }
    .mg-cart-bar__info { display:flex; flex-direction:column; line-height:1.2; }
    .mg-cart-bar__info small { font-size:12px; opacity:.75; }
    .mg-cart-bar__info strong { font-size:20px; font-weight:700; }
    .mg-cart-page .mg-cart-bar__go { padding:12px 18px; border-radius:14px; background:var(--c2-green); color:#fff !important; font-size:15px; font-weight:600; text-decoration:none !important; white-space:nowrap; }
    .mg-cart-page:has(.mg-cart-bar.is-visible) .mg-help { opacity:0; pointer-events:none; }
}
@media (prefers-reduced-motion:reduce) { .mg-cart-v2 * { transition:none !important; animation:none !important; } }

/* Side cart: compact item card — details on one line, quantity and price side by side, remove as an icon. */
.mg-cart-v2 .popup-fly-cart .mini_cart_item { position:relative; grid-template-columns:60px minmax(0,1fr); gap:12px; padding:10px 12px !important; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-thumbnail,
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-thumbnail a,
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-thumbnail m-image { width:60px !important; height:60px; border-radius:12px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-info { display:grid; grid-template-columns:auto 1fr; grid-template-areas:"name name" "vars vars" "qty price"; align-items:center; gap:2px 10px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-name { grid-area:name; margin:0; padding-right:28px; font-size:14px; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation { grid-area:vars; display:block; margin:0; font-size:12px; line-height:1.4; color:var(--c2-muted); white-space:normal; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation dt { display:none; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation dd, .mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation dd p { display:inline; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item dl.variation dd:not(:last-of-type)::after { content:"·"; margin:0 5px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-price { grid-area:price; justify-self:end; margin:6px 0 0; font-size:15px; line-height:1.2; text-align:right; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-price small { display:block; font-size:10px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .product-quantity-wrap { grid-area:qty; display:block; margin:6px 0 0; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .quantity { height:34px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .quantity button.decrease, .mg-cart-v2 .popup-fly-cart .mini_cart_item .quantity button.increase { width:34px !important; height:32px; font-size:18px !important; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item .quantity input.qty { width:28px; height:32px; font-size:14px; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item a.remove { position:absolute; top:8px; right:8px; width:28px; height:28px; justify-content:center; gap:0; border-radius:50%; font-size:0 !important; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item a.remove:hover { background:#f4f4ef; color:#b0392b !important; }
.mg-cart-v2 .popup-fly-cart .mini_cart_item a.remove::before { width:16px; height:16px; }
