/* =====================================================================
   CARRELLO E CHECKOUT: layout desktop (28/09/2026)
   Attivo solo da 992px. Mobile invariato.
   1) finestre "Aggiunto al carrello" (#addcart-modal) e "Carrello" (#cart-modal):
      incluse in tutte le pagine da inc/modali.php
   2) pagine sotto order/ con body.ord-d (a partire da order/cart.php)
   Stesso linguaggio dell'area cliente (assets/css/account-desktop.css).
   ===================================================================== */
@media (min-width: 992px) {
  :root {
    --ord-navy: #102d45;
    --ord-navy-2: #0b2033;   /* hover pulsante principale */
    --ord-ink: #1f2a33;
    --ord-muted: #5b6770;
    --ord-line: #e6e8eb;
    --ord-soft: #f6f7f8;
    --ord-sale: #d0271d;
    --ord-badge: #a38c49;
    --ord-ease: cubic-bezier(.22, 1, .36, 1);
  }

  /* ---------- scheda articolo (finestre e pagina carrello) ---------- */
  #addcart-modal .box-cart .product, #cart-modal .box-cart .product, .ord-d .box-cart .product {
    display: grid; grid-template-columns: 104px 1fr; column-gap: 20px; align-items: start;
    margin: 0 !important; padding: 20px 0; position: relative;
  }
  #addcart-modal .box-cart .product > [class*="col-"], #cart-modal .box-cart .product > [class*="col-"], .ord-d .box-cart .product > [class*="col-"] {
    width: auto; max-width: none; flex: none; padding: 0; position: relative;
  }
  #addcart-modal .box-cart .product .thumbnail, #cart-modal .box-cart .product .thumbnail, .ord-d .box-cart .product .thumbnail {
    display: block; width: 104px; height: 104px; object-fit: contain; background: var(--ord-soft); border-radius: 4px;
  }
  #addcart-modal .box-cart .product .line, #cart-modal .box-cart .product .line, .ord-d .box-cart .product .line {
    font-size: 11.5px; letter-spacing: .06em; color: var(--ord-muted); line-height: 1.5;
  }
  #addcart-modal .box-cart .product .title, #cart-modal .box-cart .product .title, .ord-d .box-cart .product .title {
    font-size: 15px; font-weight: 500; color: var(--ord-ink); line-height: 1.35; margin: 4px 0 2px !important; padding-right: 32px; width: auto !important;
  }
  #addcart-modal .box-cart .product .price, #cart-modal .box-cart .product .price, .ord-d .box-cart .product .price {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; position: static; height: auto; padding: 10px 0 0; margin: 0; font-size: 17px; font-weight: 600; color: var(--ord-ink);
  }
  #addcart-modal .box-cart .product .price .del, #cart-modal .box-cart .product .price .del, .ord-d .box-cart .product .price .del {
    order: 2; display: inline; font-size: 13px; font-weight: 400; color: var(--ord-muted);
  }
  #addcart-modal .box-cart .product .price .current, #cart-modal .box-cart .product .price .current, .ord-d .box-cart .product .price .current {
    order: 1; color: var(--ord-sale);
  }
  #addcart-modal .box-cart .product .price .current spam, #cart-modal .box-cart .product .price .current spam { color: var(--ord-ink) !important; font-weight: 400; }
  #addcart-modal .box-cart .product .price .sale, #cart-modal .box-cart .product .price .sale, .ord-d .box-cart .product .price .sale {
    order: 3; position: static; margin: 0; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; line-height: 1.5;
    background: var(--ord-badge); color: #fff;
  }
  /* eliminare un articolo */
  #cart-modal .box-cart .product .delete, .ord-d .box-cart .product .delete {
    position: absolute; top: -6px; right: -8px; padding: 8px; border-radius: 4px; line-height: 0;
    transition: background-color .15s var(--ord-ease);
  }
  #cart-modal .box-cart .product .delete:hover, .ord-d .box-cart .product .delete:hover { background: var(--ord-soft); }
  #cart-modal .box-cart .product .delete:focus-visible, .ord-d .box-cart .product .delete:focus-visible { outline: 2px solid var(--ord-navy); outline-offset: 1px; }
  /* separatori: linea sottile e chiara (prima blu scuro e spessa) */
  #addcart-modal .box-cart hr, #cart-modal .box-cart hr, .ord-d .box-cart hr, .ord-d .checkout hr {
    margin: 0; height: 1px; border: 0; background-color: var(--ord-line); color: var(--ord-line); opacity: 1;
  }
  #cart-modal .box-cart > hr:last-child, .ord-d .box-cart > hr:last-child { display: none; }

  /* ---------- pulsanti ---------- */
  #addcart-modal .modal-footer .btn, #cart-modal .modal-footer .btn, .ord-d #procedi {
    height: 48px; padding: 0 24px; border-radius: 4px; font-size: 14px; font-weight: 500; letter-spacing: .08em;
    transition: background-color .15s var(--ord-ease), color .15s var(--ord-ease), border-color .15s var(--ord-ease);
  }
  #addcart-modal .modal-footer .btn-primary, #cart-modal .modal-footer .btn-primary, .ord-d #procedi {
    background: var(--ord-navy); border: 1px solid var(--ord-navy); color: #fff;
  }
  #addcart-modal .modal-footer .btn-primary:hover, #cart-modal .modal-footer .btn-primary:hover, .ord-d #procedi:hover {
    background: var(--ord-navy-2); border-color: var(--ord-navy-2);
  }
  #addcart-modal .modal-footer .btn-info, #cart-modal .modal-footer .btn-info {
    background: #fff; border: 1px solid var(--ord-line); color: var(--ord-navy);
  }
  #addcart-modal .modal-footer .btn-info:hover, #cart-modal .modal-footer .btn-info:hover { background: var(--ord-soft); border-color: #cfd5da; }
  #addcart-modal .modal-footer .btn:focus-visible, #cart-modal .modal-footer .btn:focus-visible, .ord-d #procedi:focus-visible {
    outline: 2px solid var(--ord-navy); outline-offset: 2px; box-shadow: none;
  }

  /* ---------- finestre ---------- */
  #addcart-modal .modal-dialog, #cart-modal .modal-dialog { max-width: 560px; }
  #addcart-modal .modal-content, #cart-modal .modal-content {
    border: 0; border-radius: 8px; overflow: hidden !important; box-shadow: 0 24px 64px -24px rgba(16, 45, 69, .45);
  }
  #cart-modal #cont_carrello { display: flex; flex-direction: column; max-height: calc(100vh - 3.5rem); }
  #addcart-modal .modal-header, #cart-modal .modal-header {
    padding: 22px 28px 18px; border-bottom: 1px solid var(--ord-line); align-items: center;
  }
  #addcart-modal .modal-title, #cart-modal .modal-title { font-size: 1.25rem; font-weight: 600; color: var(--ord-ink); margin: 0; }
  #addcart-modal .modal-header .btn-close, #cart-modal .modal-header .btn-close {
    position: static; margin: 0 0 0 auto; width: 16px; height: 16px; padding: 10px; border-radius: 4px; opacity: .55;
  }
  #addcart-modal .modal-header .btn-close:hover, #cart-modal .modal-header .btn-close:hover { opacity: 1; background-color: var(--ord-soft); }
  #addcart-modal .modal-body, #cart-modal .modal-body { padding: 4px 28px !important; overflow-y: auto; }
  #addcart-modal .modal-footer, #cart-modal .modal-footer {
    display: grid; grid-template-columns: 1fr; gap: 10px; padding: 20px 28px 24px; border-top: 1px solid var(--ord-line); background: #fff;
  }
  #addcart-modal .modal-footer > *, #cart-modal .modal-footer > * { margin: 0; }
  #addcart-modal .modal-footer a, #cart-modal .modal-footer a { display: block; }
  /* "Aggiunto al carrello": i due pulsanti affiancati */
  #addcart-modal .modal-footer { grid-template-columns: 1fr 1fr; }
  #addcart-modal .modal-footer .box-total:first-child { order: 2; }
  #addcart-modal .modal-footer .box-total:last-child { order: 1; }
  /* totali nella finestra "Carrello" */
  #cart-modal .box-subtotal p { display: flex; justify-content: space-between; margin: 0 0 6px !important; font-size: 14px; color: var(--ord-muted); }
  #cart-modal .box-subtotal p .value { float: none !important; color: var(--ord-ink); font-weight: 500; font-size: 14px !important; }
  #cart-modal .box-subtotal p.t-red, #cart-modal .box-subtotal p.t-red .value { color: var(--ord-sale); }
  #cart-modal .box-subtotal p:last-child {
    margin: 12px 0 6px !important; padding-top: 12px; border-top: 1px solid var(--ord-line); font-size: 16px !important; font-weight: 600; color: var(--ord-ink);
  }
  #cart-modal .box-subtotal p:last-child .value { font-size: 18px !important; font-weight: 600; }
  #cart-modal .modal-footer .box-total { margin: 0; }

  /* ---------- pagina carrello (order/cart.php) ---------- */
  body.ord-d { background: var(--ord-soft); }
  .ord-d section.cart { padding: 40px 0 72px !important; }
  .ord-d section.cart > .container { max-width: 1140px; padding: 0 24px; }
  .ord-d section.cart > .container > .row {
    display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 32px; align-items: start; margin: 0; overflow: visible !important;
  }
  .ord-d section.cart > .container > .row > .col-md-6 {
    width: auto; max-width: none; margin: 0; padding: 8px 32px 16px !important; background: #fff; border: 1px solid var(--ord-line); border-radius: 8px;
  }
  .ord-d section.cart > .container > .row > .col-md-6:last-child { position: sticky; top: 96px; padding: 8px 28px 24px !important; }
  .ord-d .box-cart h1 { font-size: 1.6rem !important; font-weight: 600; color: var(--ord-ink); margin: 20px 0 12px !important; }
  .ord-d .box-cart h1 .cart-count { font-weight: 400; color: var(--ord-muted); }
  .ord-d .box-cart > hr:first-of-type { margin-bottom: 0; }
  .ord-d .box-cart .product > .col-8 > a.delete + .line { margin-top: 2px; }
  /* quantità */
  .ord-d .box_qta { width: auto; margin-top: 14px; display: inline-flex; border: 1px solid var(--ord-line); border-radius: 4px; overflow: hidden; }
  .ord-d .box_qta .minus, .ord-d .box_qta .plus {
    width: 36px; height: 36px; border: 0; background: #fff; color: var(--ord-ink); font-size: 16px; line-height: 1; cursor: pointer;
    transition: background-color .15s var(--ord-ease);
  }
  .ord-d .box_qta .minus:hover, .ord-d .box_qta .plus:hover { background: var(--ord-soft); }
  .ord-d .box_qta .minus:focus-visible, .ord-d .box_qta .plus:focus-visible { outline: 2px solid var(--ord-navy); outline-offset: -2px; }
  .ord-d .box_qta .qnty {
    width: 44px !important; height: 36px !important; padding: 0; border: 0; border-left: 1px solid var(--ord-line); border-right: 1px solid var(--ord-line);
    border-radius: 0; background: #fff !important; color: var(--ord-ink); font-weight: 500; -moz-appearance: textfield;
  }
  .ord-d .box_qta .qnty::-webkit-inner-spin-button, .ord-d .box_qta .qnty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  /* riepilogo a destra */
  .ord-d .checkout h2 { font-size: 13px !important; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ord-muted); margin: 22px 0 8px !important; }
  .ord-d .checkout h2 hr { display: none; }
  .ord-d .checkout .box-shipping { font-size: 15px; color: var(--ord-ink); padding-bottom: 18px !important; border-bottom: 1px solid var(--ord-line); }
  .ord-d .checkout .box-shipping + h2 { margin-top: 18px !important; }
  .ord-d .checkout .box-shipping ~ .p-0 img { max-width: 100%; height: auto; }
  .ord-d .checkout .box-subtotal { margin-top: 18px; padding-top: 18px !important; border-top: 1px solid var(--ord-line); }
  .ord-d .checkout .box-subtotal p { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 14px; font-weight: 400; color: var(--ord-muted); }
  .ord-d .checkout .box-subtotal p .value { float: none !important; color: var(--ord-ink); font-weight: 500; }
  .ord-d .checkout .box-subtotal p.t-red, .ord-d .checkout .box-subtotal p.t-red .value { color: var(--ord-sale); }
  .ord-d .checkout .box-total { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--ord-line); }
  .ord-d .checkout .box-total .total { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px !important; color: var(--ord-ink); margin-bottom: 18px !important; }
  .ord-d .checkout .box-total .total .value { float: none !important; font-size: 22px; font-weight: 600; }
  .ord-d #procedi { width: 100%; margin-bottom: 14px !important; }
  .ord-d .checkout .box-total > p:last-child { font-size: 13px; line-height: 1.5; color: var(--ord-muted); margin: 0; }
  /* prodotti consigliati: sotto al carrello, a tutta larghezza (spostati da uno script in cart.php) */
  .ord-d .ord-consigliati { max-width: 1140px; margin: 40px auto 0; padding: 0 24px; }
  .ord-d .ord-consigliati .ord-consigliati-titolo { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ord-muted); margin: 0 0 16px; }
  .ord-d .ord-consigliati section.products { background: transparent; }
}

/* =====================================================================
   PAGINE DEL CHECKOUT CON SCHEDA CENTRALE (section.login-card):
   conferma, indirizzi, modifica ordine, pagamento, esito, fattura, resi.
   Rifinitura prudente: stessa scheda, stessi pulsanti e totali del carrello.
   L'intestazione grigia resta com'è (è condivisa con le pagine di login).
   ===================================================================== */
@media (min-width: 992px) {
  /* barra degli step */
  .ord-d .step-bar { padding: 28px 0 4px !important; }
  .ord-d .step-bar .text-end { max-width: 720px; }
  .ord-d .step-bar .row { max-width: 560px; }
  .ord-d .step-bar .step img { width: 40px; }
  .ord-d .step-bar .after-icon { font-size: 13px; color: var(--ord-muted); margin-top: 6px; }

  /* scheda centrale */
  .ord-d section.login-card { padding: 24px 0 72px !important; }
  .ord-d section.login-card > .container > .row > [class*="col-md-"] {
    flex: 0 0 auto; width: 100%; max-width: 720px; margin: 0 auto;
    background: #fff; border: 1px solid var(--ord-line); border-radius: 8px; box-shadow: none !important;
    padding: 36px 48px 44px !important;
  }
  .ord-d section.login-card > .container > .text-end {
    max-width: 720px; margin: 0 auto 12px; padding: 0 !important; background: transparent; box-shadow: none !important; border: 0;
  }
  .ord-d section.login-card > .container > .text-end .button-link { font-size: 14px; color: var(--ord-navy); }
  .ord-d section.login-card h1, .ord-d section.login-card h2 { color: var(--ord-ink); }
  .ord-d section.login-card .border-wrap { border-color: var(--ord-line); border-radius: 6px; }
  .ord-d section.login-card .form-control:focus { border-color: var(--ord-navy); box-shadow: 0 0 0 3px rgba(16, 45, 69, .12); }

  /* totali in fondo alla scheda */
  .ord-d section.login-card .checkout .background-wrap {
    background: transparent; margin: 28px 0 0; padding: 24px 0 0; border-top: 1px solid var(--ord-line);
  }

  /* pulsanti: azione principale blu Dalmesse, secondarie con bordo */
  .ord-d section.login-card .btn {
    min-height: 48px; border-radius: 4px; font-size: 14px; font-weight: 500; letter-spacing: .06em;
    transition: background-color .15s var(--ord-ease), color .15s var(--ord-ease), border-color .15s var(--ord-ease);
  }
  .ord-d section.login-card .btn-primary,
  .ord-d section.login-card .btn-secondary:not(.color2):not(.signin) {
    background: var(--ord-navy); border: 1px solid var(--ord-navy); color: #fff;
  }
  .ord-d section.login-card .btn-primary:hover,
  .ord-d section.login-card .btn-secondary:not(.color2):not(.signin):hover { background: var(--ord-navy-2); border-color: var(--ord-navy-2); color: #fff; }
  .ord-d section.login-card .btn-secondary.color2, .ord-d section.login-card .outline-btn, .ord-d section.login-card .btn-outline-secondary {
    background: #fff !important; border: 1px solid var(--ord-line); color: var(--ord-navy);
  }
  .ord-d section.login-card .btn-secondary.color2:hover, .ord-d section.login-card .outline-btn:hover, .ord-d section.login-card .btn-outline-secondary:hover {
    background: var(--ord-soft) !important; border-color: #cfd5da; color: var(--ord-navy);
  }
  .ord-d section.login-card .btn:focus-visible { outline: 2px solid var(--ord-navy); outline-offset: 2px; box-shadow: none; }
}
