/* =====================================================
   3T Cart v2 — UX e-commerce devis B2B
   ===================================================== */

.cart-toggle { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #0f1b2d; cursor: pointer; transition: all 0.18s; margin: 0 6px; flex-shrink: 0; }
.cart-toggle:hover { border-color: #1d4ed8; background: #eff3ff; color: #1d4ed8; }
.cart-toggle:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.cart-toggle svg { width: 19px; height: 19px; }
.cart-badge { position: absolute; top: -6px; right: -6px; background: #1d4ed8; color: #fff; font-size: 11px; font-weight: 800; min-width: 19px; height: 19px; border-radius: 10px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; letter-spacing: -0.02em; transition: transform 0.25s cubic-bezier(0.22,1,0.36,1); }
.cart-badge[data-count="0"] { display: none; }
.cart-badge:not([data-count="0"]) { animation: cart-pop 0.4s ease; }
@keyframes cart-pop { 0%{transform:scale(0.6)} 60%{transform:scale(1.15)} 100%{transform:scale(1)} }

.hero-cart-block { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; flex-wrap: wrap; }
.cart-qty-inline { display: inline-flex; align-items: center; border: 2px solid #e2e8f0; border-radius: 11px; overflow: hidden; background: #fff; height: 52px; flex-shrink: 0; }
.cart-qty-inline button { width: 44px; height: 100%; border: 0; background: transparent; color: #0f1b2d; font-size: 22px; font-weight: 700; cursor: pointer; line-height: 1; transition: background 0.15s, color 0.15s; }
.cart-qty-inline button:hover { background: #eff3ff; color: #1d4ed8; }
.cart-qty-inline input { width: 54px; height: 100%; border: 0; text-align: center; font-weight: 800; font-size: 17px; background: #fff; color: #0f1b2d; outline: none; -moz-appearance: textfield; }
.cart-qty-inline input::-webkit-outer-spin-button, .cart-qty-inline input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-cart-add { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 26px; height: 52px; background: #1d4ed8; color: #fff; border: 0; border-radius: 11px; font-weight: 800; font-size: 15.5px; letter-spacing: -0.01em; cursor: pointer; transition: transform 0.18s, box-shadow 0.18s, background 0.15s; text-decoration: none; line-height: 1; box-shadow: 0 6px 18px rgba(29, 78, 216, 0.28); flex: 1 1 auto; min-width: 220px; }
.btn-cart-add:hover { background: #1e3aa8; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(29, 78, 216, 0.4); }
.btn-cart-add:active { transform: translateY(0); }
.btn-cart-add:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 3px; }
.btn-cart-add svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-cart-add.added { background: #16a34a; box-shadow: 0 6px 18px rgba(22,163,74,0.4); animation: cart-success 0.5s ease; }
@keyframes cart-success { 0%{transform:scale(1)} 30%{transform:scale(1.05)} 100%{transform:scale(1)} }

.hero-actions-secondary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: #64748b; margin-top: 6px; }
.hero-actions-secondary a { display: inline-flex; align-items: center; gap: 6px; color: #475569; text-decoration: none; font-weight: 600; transition: color 0.15s; cursor: pointer; }
.hero-actions-secondary a:hover { color: #1d4ed8; }
.hero-actions-secondary a svg { width: 14px; height: 14px; }
.hero-actions-secondary .sep { color: #cbd5e1; }

.cart-sticky-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(160%); z-index: 9998; background: #0f1b2d; color: #fff; padding: 12px 16px 12px 20px; border-radius: 14px; box-shadow: 0 16px 48px rgba(15, 23, 42, 0.4); display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.cart-sticky-bar.visible { transform: translateX(-50%) translateY(0); }
.cart-sticky-bar .sticky-bar-icon { width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cart-sticky-bar .sticky-bar-icon svg { width: 18px; height: 18px; color: #fff; }
.cart-sticky-bar .sticky-bar-label { line-height: 1.3; flex: 1; min-width: 0; }
.cart-sticky-bar .sticky-bar-cta { background: #1d4ed8; color: #fff; border: 0; padding: 9px 16px; border-radius: 9px; font-weight: 800; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, transform 0.15s; white-space: nowrap; }
.cart-sticky-bar .sticky-bar-cta:hover { background: #2563eb; transform: translateY(-1px); }
.cart-sticky-bar .sticky-bar-cta svg { width: 14px; height: 14px; }
@media (min-width: 1024px) { .cart-sticky-bar { bottom: 28px; right: 28px; left: auto; transform: translateY(160%); } .cart-sticky-bar.visible { transform: translateY(0); } }

.cart-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.cart-modal.open { opacity: 1; pointer-events: all; }
.cart-modal-inner { background: #fff; width: 100%; max-width: 720px; max-height: 90vh; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 40px 100px rgba(15, 23, 42, 0.4); transform: translateY(30px) scale(0.97); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.cart-modal.open .cart-modal-inner { transform: translateY(0) scale(1); }
.cart-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid #e2e8f0; background: #f7f9fc; }
.cart-modal-header h2 { margin: 0; font-size: 19px; font-weight: 800; color: #0f1b2d; }
.cart-modal-close { width: 34px; height: 34px; border: 0; background: #fff; border-radius: 8px; font-size: 22px; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.cart-modal-close:hover { background: #fee2e2; color: #dc2626; }
.cart-modal-body { padding: 22px 26px; overflow-y: auto; flex: 1; }
.cart-modal-footer { padding: 18px 26px; border-top: 1px solid #e2e8f0; background: #f7f9fc; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.cart-items { display: flex; flex-direction: column; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 14px; align-items: center; padding: 14px; background: #f7f9fc; border-radius: 12px; border: 1px solid transparent; transition: border-color 0.15s; }
.cart-item:hover { border-color: #cbd5e1; }
.cart-item-img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; padding: 5px; border: 1px solid #e2e8f0; }
.cart-item-info { min-width: 0; }
.cart-item-ref { font-size: 11px; font-weight: 800; color: #1d4ed8; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
.cart-item-title a { font-size: 14px; font-weight: 600; color: #0f1b2d; line-height: 1.3; text-decoration: none; }
.cart-item-title a:hover { color: #1d4ed8; text-decoration: underline; }
.cart-qty-edit { display: inline-flex; align-items: center; border: 1.5px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fff; height: 36px; }
.cart-qty-edit button { width: 30px; height: 100%; border: 0; background: transparent; color: #0f1b2d; font-size: 17px; font-weight: 700; cursor: pointer; line-height: 1; }
.cart-qty-edit button:hover { background: #eff3ff; color: #1d4ed8; }
.cart-qty-edit input { width: 42px; height: 100%; border: 0; text-align: center; font-weight: 700; font-size: 14px; background: #fff; outline: none; -moz-appearance: textfield; }
.cart-qty-edit input::-webkit-outer-spin-button, .cart-qty-edit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item-remove { width: 34px; height: 34px; border: 0; background: #fff; color: #64748b; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.cart-item-remove:hover { background: #fee2e2; color: #dc2626; }
.cart-item-remove svg { width: 17px; height: 17px; }

.cart-empty { text-align: center; padding: 60px 20px; color: #64748b; }
.cart-empty svg { width: 56px; height: 56px; opacity: 0.4; margin-bottom: 16px; }
.cart-empty p { font-size: 16px; font-weight: 700; color: #0f1b2d; margin: 0 0 6px; }
.cart-empty-hint { font-size: 13.5px; color: #64748b; }

.btn-cart-continue, .btn-cart-checkout { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; font-weight: 700; font-size: 14px; border-radius: 9px; cursor: pointer; border: 0; transition: all 0.2s; text-decoration: none; line-height: 1; }
.btn-cart-continue { background: #fff; color: #0f1b2d; border: 1.5px solid #e2e8f0; }
.btn-cart-continue:hover { border-color: #1d4ed8; color: #1d4ed8; }
.btn-cart-checkout { background: #1d4ed8; color: #fff; box-shadow: 0 6px 16px rgba(29, 78, 216, 0.28); }
.btn-cart-checkout:hover { background: #1e3aa8; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(29, 78, 216, 0.4); }
.btn-cart-checkout:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.checkout-form { display: flex; flex-direction: column; gap: 14px; }
.checkout-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-form .form-field { display: flex; flex-direction: column; gap: 5px; }
.checkout-form .form-field label { font-size: 13px; font-weight: 700; color: #0f1b2d; }
.checkout-form .form-field .required { color: #dc2626; }
.checkout-form .form-field input, .checkout-form .form-field textarea { padding: 11px 13px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 14.5px; font-family: inherit; background: #fff; color: #0f1b2d; outline: none; transition: border-color 0.18s, box-shadow 0.18s; }
.checkout-form .form-field input:focus, .checkout-form .form-field textarea:focus { border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12); }
.checkout-form .form-field textarea { resize: vertical; min-height: 80px; }
.checkout-form .form-consent { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 12.5px; color: #475569; line-height: 1.5; cursor: pointer; }
.checkout-form .form-consent input { margin-top: 1px; width: 16px; height: 16px; accent-color: #1d4ed8; cursor: pointer; flex-shrink: 0; }

.checkout-summary { background: #f7f9fc; border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }
.checkout-summary h3 { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: 0.06em; }
.checkout-summary table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.checkout-summary table th, .checkout-summary table td { padding: 7px 4px; text-align: left; }
.checkout-summary table th { color: #64748b; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e2e8f0; }
.checkout-summary table td { border-bottom: 1px solid #f1f5f9; color: #0f1b2d; }
.checkout-summary table td:nth-child(3) { text-align: right; font-weight: 800; color: #1d4ed8; }
.checkout-summary table tr:last-child td { border-bottom: 0; }

.checkout-success { text-align: center; padding: 36px 20px; }
.checkout-success-icon { width: 72px; height: 72px; background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; font-size: 36px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; font-weight: 800; box-shadow: 0 10px 28px rgba(22, 163, 74, 0.35); animation: cart-success-pop 0.55s cubic-bezier(0.22,1,0.36,1); }
@keyframes cart-success-pop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }
.checkout-success h3 { font-size: 20px; margin: 0 0 8px; color: #0f1b2d; }
.checkout-success p { font-size: 14px; color: #64748b; margin: 0 0 18px; max-width: 420px; margin-left: auto; margin-right: auto; line-height: 1.5; }

@media (max-width: 540px) {
  .cart-modal { padding: 0; }
  .cart-modal-inner { max-height: 100vh; height: 100vh; border-radius: 0; max-width: 100%; }
  .checkout-form .form-row { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 56px 1fr; grid-template-rows: auto auto; gap: 10px; padding: 12px; position: relative; }
  .cart-item-img { grid-row: 1 / 3; width: 56px; height: 56px; }
  .cart-qty-edit { grid-column: 2; justify-self: start; }
  .cart-item-remove { position: absolute; top: 12px; right: 12px; }
  .btn-cart-add { min-width: 0; width: 100%; }
  .hero-cart-block { gap: 8px; }
}
