/* ==========================================================================
   DETAILINGSHOP.cz — Redesign košíku a pokladny (Fáze 1 + Fáze 2 + Tablet/1024px)
   Soubor: ds-checkout-ui-v6.css
   Scope: výhradně body.ordering-process (Košík + Krok 1 + Krok 2)
   ========================================================================== */

/* 1. Bez horizontálního scrollbaru & zjednodušená checkout hlavička bez rozptylování */
html:has(body.ordering-process),
body.ordering-process,
body.ordering-process .overall-wrapper {
  overflow-x: clip !important;
}

body.ordering-process .top-navigation-bar .top-navigation-menu,
body.ordering-process #header .search,
body.ordering-process #header #navigation,
body.ordering-process #header .menu-helper {
  display: none !important;
}

body.ordering-process header#header {
  background: #ffffff !important;
  border-bottom: 1px solid #e5e9ef !important;
}

body.ordering-process header#header .header-top {
  padding: 12px 0 !important;
  min-height: 60px !important;
}

/* 2. Čisté karty (jednotný rádius 6px) a krokový ukazatel (.cart-header) */
body.ordering-process .cart-content,
body.ordering-process .co-box.box,
body.ordering-process .co-billing-address > fieldset.box,
body.ordering-process #checkoutSidebar .order-summary {
  border-radius: 6px !important;
  border: 1px solid #e5e9ef !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
}

body.ordering-process ol.cart-header {
  border-radius: 6px 6px 0 0 !important;
  overflow: hidden !important;
}

body.ordering-process ol.cart-header li.active,
body.ordering-process ol.cart-header li.active strong,
body.ordering-process ol.cart-header li.active a {
  color: #02838f !important;
}

body.ordering-process ol.cart-header li.active {
  border-bottom: 2px solid #02838f !important;
}

/* Oprava useknutého mobilního stepperu pod hlavičkou */
@media (max-width: 767px) {
  body.ordering-process ol.cart-header {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    margin: 0 0 12px 0 !important;
    border-radius: 6px !important;
    border: 1px solid #e5e9ef !important;
    background: #ffffff !important;
    padding: 10px 14px !important;
  }

  body.ordering-process ol.cart-header li.active {
    border-bottom: none !important;
    font-weight: 700 !important;
    font-size: 14px !important;
  }
}

/* 3. Krok 1 (Košík): čitelné názvy bez ALL-CAPS, obrácení priority sidebaru */
body.ordering-process .cart-table td.p-name a.main-link,
body.ordering-process #summary-box .cart-item-name a {
  text-transform: none !important;
  font-weight: 600 !important;
  color: #1a232b !important;
  letter-spacing: 0 !important;
  line-height: 1.35 !important;
}

body.ordering-process .cart-table td.p-name a.main-link:hover,
body.ordering-process #summary-box .cart-item-name a:hover {
  color: #02838f !important;
}

body.ordering-process .cart-table td.cart-p-image img {
  border-radius: 6px !important;
  border: 1px solid #eef1f5 !important;
}

body.ordering-process .cart-table tr.removeable {
  border-bottom: 1px solid #eef1f5 !important;
}

body.ordering-process .col-md-4.sidebar-in-cart {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

body.ordering-process .col-md-4.sidebar-in-cart > .summary-wrapper {
  order: -1 !important;
  margin-bottom: 0 !important;
}

body.ordering-process .col-md-4.sidebar-in-cart > .checkout-box-wrapper {
  order: 1 !important;
  background: #f8fafb !important;
  overflow-wrap: anywhere !important;
}

@media (min-width: 992px) {
  body.ordering-process .col-md-4.sidebar-in-cart {
    position: sticky !important;
    top: 20px !important;
    align-self: flex-start !important;
  }
}

/* Výrazný tyrkysový progress bar dopravy zdarma (odsazená ::before ikonka autíčka) */
body.ordering-process .extras-wrap .extra.delivery {
  background: rgba(2, 131, 143, 0.05) !important;
  border: 1px solid rgba(2, 131, 143, 0.2) !important;
  border-radius: 6px !important;
  padding: 12px 14px 12px 62px !important;
  margin-bottom: 10px !important;
}

body.ordering-process .extras-wrap .extra.delivery::before {
  left: 14px !important;
  color: #02838f !important;
}

body.ordering-process .extra.delivery .price-range {
  background: #d8e7e9 !important;
  height: 8px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  margin-top: 8px !important;
}

body.ordering-process .extra.delivery .price-range > div {
  background: #02838f !important;
  height: 100% !important;
  border-radius: 6px !important;
}

/* Slevový kupón: oprava pravého rámečku inputu + moderní ikona kupónu/slevy + sbalitelný toggle */
body.ordering-process .discount-coupon .compact-form input#discountCouponCode.form-control {
  border: 1px solid #cbd5e1 !important;
  border-right-style: solid !important;
  border-radius: 6px !important;
}

body.ordering-process .discount-coupon .compact-form input#discountCouponCode.form-control:focus {
  border-color: #02838f !important;
  box-shadow: 0 0 0 3px rgba(2, 131, 143, 0.12) !important;
  outline: none !important;
}

body.ordering-process .discount-coupon .compact-form button[data-testid="buttonSubmitDiscountCoupon"] {
  border-radius: 6px !important;
}

body.ordering-process .discount-coupon,
body.ordering-process .extras-wrap .extra.discount {
  padding-left: 50px !important;
}

body.ordering-process .discount-coupon::before,
body.ordering-process .extras-wrap .extra.discount::before {
  content: "" !important;
  width: 36px !important;
  height: 36px !important;
  left: 0 !important;
  top: 50% !important;
  margin-top: -18px !important;
  border-radius: 6px !important;
  background-color: rgba(2, 131, 143, 0.08) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2302838f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z'/%3E%3Cpath d='m9 15 6-6'/%3E%3Ccircle cx='9.5' cy='9.5' r='.75' fill='%2302838f'/%3E%3Ccircle cx='14.5' cy='14.5' r='.75' fill='%2302838f'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 20px 20px !important;
}

body.ordering-process .discount-coupon.ds-coupon-collapsible {
  min-height: 40px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

body.ordering-process .ds-coupon-toggle {
  appearance: none;
  background: transparent;
  border: none;
  padding: 6px 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #02838f;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

body.ordering-process .ds-coupon-toggle:hover {
  color: #026e78;
  text-decoration: underline;
}

body.ordering-process .ds-coupon-toggle .ds-chevron {
  display: inline-block;
  font-size: 11px;
  transition: transform 0.18s ease;
}

body.ordering-process .discount-coupon.ds-coupon-open .ds-coupon-toggle .ds-chevron {
  transform: rotate(180deg);
}

body.ordering-process .discount-coupon.ds-coupon-collapsible:not(.ds-coupon-open) > form {
  display: none !important;
}

body.ordering-process .discount-coupon.ds-coupon-open > form {
  margin-top: 8px;
}

/* 4. Krok 2 (Doprava a platba): kompaktní Země/Měna, interaktivní karty (6px), tlačítko odběrného místa */
body.ordering-process #select-country-payment .co-basic-information {
  padding: 14px 20px !important;
  margin-bottom: 16px !important;
}

body.ordering-process #select-country-payment .co-basic-information h2 {
  font-size: 15px !important;
  margin: 0 0 10px 0 !important;
}

body.ordering-process #select-country-payment .co-basic-information .form-group {
  margin-bottom: 4px !important;
}

body.ordering-process .shipping-billing-table .radio-wrapper {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 6px !important;
  margin-bottom: 8px !important;
  padding: 2px 6px !important;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease !important;
}

body.ordering-process .shipping-billing-table .radio-wrapper:hover {
  border-color: #94c7cc !important;
  background: #fafdfd !important;
}

body.ordering-process .shipping-billing-table .radio-wrapper.active,
body.ordering-process .shipping-billing-table .radio-wrapper:has(> input:checked) {
  border-color: #02838f !important;
  background: rgba(2, 131, 143, 0.05) !important;
  box-shadow: 0 2px 8px rgba(2, 131, 143, 0.1) !important;
}

body.ordering-process .shipping-billing-table .radio-wrapper:has(> input:disabled) {
  opacity: 0.52 !important;
  background: #f8fafc !important;
  border-style: dashed !important;
}

body.ordering-process .shipping-billing-table .payment-shipping-price.for-free {
  color: #02838f !important;
  font-weight: 700 !important;
}

body.ordering-process .shipping-billing-table .pickup-point-choose a,
body.ordering-process .shipping-billing-table .new-gen-choose a {
  display: inline-flex !important;
  align-items: center !important;
  margin-top: 6px !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  border: 1.5px solid #02838f !important;
  color: #02838f !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

body.ordering-process .shipping-billing-table .pickup-point-choose a:hover,
body.ordering-process .shipping-billing-table .new-gen-choose a:hover {
  background: #02838f !important;
  color: #ffffff !important;
}

/* 5. Pravý sidebar (Kroky 2 & 3): potlačení konkurenční tyrkysové na Pomoc, čistá rekapitulace a silné CTA */
body.ordering-process #checkoutSidebar .checkout-box {
  margin-bottom: 10px !important;
}

body.ordering-process #checkoutSidebar .checkout-box .toggle-contacts {
  background: #f4f7f9 !important;
  color: #334155 !important;
  border: 1px solid #dce3ea !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 9px 14px !important;
  box-shadow: none !important;
  text-transform: none !important;
}

body.ordering-process #checkoutSidebar .checkout-box .toggle-contacts:hover {
  background: #eaf1f4 !important;
  color: #02838f !important;
  border-color: #b7d3d7 !important;
}

body.ordering-process #summary-box .cart-item {
  border-bottom: 1px solid #eef1f5 !important;
  padding: 7px 0 !important;
}

body.ordering-process #summary-box .cart-item > div {
  border-left: none !important;
  border-right: none !important;
}

body.ordering-process #summary-box .recapitulation-single strong,
body.ordering-process #summary-box .recapitulation-single span:first-child {
  white-space: nowrap !important;
}

body.ordering-process #checkoutSidebar #summary-box .order-summary-item.price {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 14px 0 4px 0 !important;
  border-top: 1px solid #dce3ea !important;
}

body.ordering-process .next-step .btn-conversion,
body.ordering-process button#submit-order.btn-conversion {
  background: #02838f !important;
  border-color: #02838f !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  min-height: 48px !important;
  box-shadow: 0 4px 12px rgba(2, 131, 143, 0.22) !important;
}

body.ordering-process .next-step .btn-conversion:hover,
body.ordering-process button#submit-order.btn-conversion:hover {
  background: #026e78 !important;
  border-color: #026e78 !important;
}

/* Provzdušnění úzkého sidebaru pokladny na malém notebooku (992–1199 px) */
@media (min-width: 992px) and (max-width: 1199px) {
  body.ordering-process #checkoutSidebar > .cart-content {
    padding: 14px !important;
  }

  body.ordering-process #checkoutSidebar .order-summary-inner {
    padding: 12px !important;
  }

  body.ordering-process #summary-box .cart-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  body.ordering-process #summary-box .cart-item .cart-item-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    padding: 0 !important;
    font-size: 12.5px !important;
  }

  body.ordering-process #summary-box .cart-item .cart-item-amount,
  body.ordering-process #summary-box .cart-item .cart-item-price {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 0 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
  }
}

/* 6. Krok 3 (Dodací údaje): sjednocená šířka karet, 2sloupcový formulář s popisky nad poli + kompaktní souhlasy */
body.ordering-process .co-billing-address {
  padding: 0 !important;
  margin: 16px 0 0 0 !important;
}

body.ordering-process fieldset.co-contact-information,
body.ordering-process .co-billing-address > fieldset.box {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 22px 26px !important;
  box-sizing: border-box !important;
}

@media (min-width: 768px) {
  body.ordering-process form#order-form.sending-order.inline-form-fields fieldset.co-contact-information,
  body.ordering-process form#order-form.sending-order.inline-form-fields .co-billing-address > fieldset {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 16px !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields fieldset.co-contact-information > *,
  body.ordering-process form#order-form.sending-order.inline-form-fields .co-billing-address > fieldset > * {
    grid-column: 1 / -1 !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields .form-group:has(#email) {
    grid-column: 1 / 2 !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields .form-group.phone-form-group {
    grid-column: 2 / 3 !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields .form-group:has(#billCity) {
    grid-column: 1 / 2 !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields .form-group:has(#billZip) {
    grid-column: 2 / 3 !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields .form-group.smart-label-wrapper.form-group--inline {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    margin-bottom: 14px !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields .form-group.smart-label-wrapper.form-group--inline > label {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    text-align: left !important;
    padding: 0 0 5px 0 !important;
    margin: 0 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #334155 !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields .form-group.smart-label-wrapper.form-group--inline > .form-control-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields input.form-control,
  body.ordering-process form#order-form.sending-order.inline-form-fields input#billZip.form-control.short {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 6px !important;
    border: 1.5px solid #d5dde5 !important;
  }

  body.ordering-process form#order-form.sending-order.inline-form-fields input.form-control:focus {
    border-color: #02838f !important;
    box-shadow: 0 0 0 3px rgba(2, 131, 143, 0.12) !important;
    outline: none !important;
  }
}

/* Zkompaktnění souhlasů v pravém sidebaru Kroku 3 */
body.ordering-process #checkoutSidebar .form-group.consents {
  margin-bottom: 6px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

body.ordering-process #checkoutSidebar .order-summary-inner {
  padding: 14px 16px !important;
}

body.ordering-process #checkoutSidebar .next-step--step-2 {
  margin-top: 12px !important;
}

/* ==========================================================================
   7. FÁZE 2 — Živá hláška expedice, Trust lišta, Mobilní & Tablet accordion + Sticky bar
   ========================================================================== */

.ds-checkout-dispatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin: 0 0 12px 0;
  border-radius: 6px;
  background: rgba(2, 131, 143, 0.06);
  border: 1px solid rgba(2, 131, 143, 0.18);
  font-size: 12.5px;
  line-height: 1.35;
  color: #1e293b;
}

.ds-checkout-dispatch svg {
  flex: 0 0 16px;
  color: #02838f;
}

.ds-checkout-dispatch strong {
  color: #02838f;
  font-weight: 700;
}

.ds-checkout-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef1f5;
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.3;
}

.ds-checkout-trust span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ds-checkout-trust svg {
  width: 13px;
  height: 13px;
  color: #02838f;
  flex-shrink: 0;
}

.ds-mobile-recap,
.ds-mobile-sticky-bar {
  display: none;
}

/* Aktivní pro mobil i tablet na výšku (<= 991px, kde se sidebar láme pod obsah) */
@media (max-width: 991px) {
  body.ordering-process.ds-has-sticky-bar {
    padding-bottom: 84px !important;
  }

  body.ordering-process #checkoutSidebar .next-step {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }

  body.ordering-process #checkoutSidebar .next-step > a,
  body.ordering-process #checkoutSidebar .next-step > button {
    width: 100% !important;
    max-width: 100% !important;
  }

  .ds-mobile-recap {
    display: block;
    margin: 0 0 12px 0;
    background: #ffffff;
    border: 1px solid #e5e9ef;
    border-radius: 6px;
    overflow: hidden;
  }

  .ds-mobile-recap-toggle {
    appearance: none;
    width: 100%;
    background: #f8fafb;
    border: none;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
  }

  .ds-mobile-recap-toggle .ds-recap-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #02838f;
  }

  .ds-mobile-recap-toggle .ds-recap-price {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    white-space: nowrap;
  }

  .ds-mobile-recap-toggle .ds-chevron {
    display: inline-block;
    font-size: 11px;
    transition: transform 0.18s ease;
  }

  .ds-mobile-recap.is-open .ds-mobile-recap-toggle .ds-chevron {
    transform: rotate(180deg);
  }

  .ds-mobile-recap-body {
    display: none;
    padding: 10px 14px 12px;
    border-top: 1px solid #eef1f5;
    font-size: 12.5px;
  }

  .ds-mobile-recap.is-open .ds-mobile-recap-body {
    display: block;
  }

  .ds-mobile-recap-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
  }

  .ds-mobile-recap-item:last-child {
    border-bottom: none;
  }

  .ds-mobile-recap-item .ds-item-name {
    flex: 1 1 auto;
    line-height: 1.3;
  }

  .ds-mobile-recap-item .ds-item-price {
    flex: 0 0 auto;
    font-weight: 600;
    white-space: nowrap;
  }

  .ds-mobile-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 890;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.09);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  .ds-mobile-sticky-bar.is-hidden {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
  }

  .ds-mobile-sticky-total {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .ds-mobile-sticky-label {
    font-size: 11px;
    color: #64748b;
    line-height: 1.15;
  }

  .ds-mobile-sticky-price {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    white-space: nowrap;
  }

  .ds-mobile-sticky-cta {
    appearance: none;
    flex: 0 1 auto;
    min-width: 158px;
    min-height: 44px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    background: #02838f;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(2, 131, 143, 0.24);
  }

  .ds-mobile-sticky-cta:active {
    background: #026e78;
  }
}
