/* ════════════════════════════════════════════════════════
   Checkout page — body.order
   Targets PrestaShop 9 / Panda checkout HTML structure
   ════════════════════════════════════════════════════════ */

/* ── Checkout header ── */
body.order #header_primary.checkout_header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  height: 60px;
  padding: 0 40px;
}

body.order #header_primary.checkout_header .wide_container,
body.order #header_primary.checkout_header .container {
  height: 100%;
  padding: 0;
  max-width: none;
}

body.order #header_primary.checkout_header #checkout_header_wrap {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
}

body.order #header_primary.checkout_header .shop_logo img {
  max-height: 36px;
  width: auto;
}

body.order #header_primary.checkout_header .checkout_header_right {
  display: flex;
  font-size: 12px;
  color: #777;
  gap: 6px;
  align-items: center;
}

/* ── Wrapper / layout reset ── */
body.order #wrapper.checkout_wrapper {
  background: #fff;
  padding: 0;
}

body.order #wrapper.checkout_wrapper > .container {
  max-width: none;
  padding: 0;
}

/* ── Main 2-col grid ── */
body.order #content > .row {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 40px;
  align-items: start;
  flex-wrap: unset;
}

body.order .checkout_right_wrapper {
  order: 2;
  max-width: none;
  width: 100%;
  flex: none;
  padding: 0;
}

body.order .checkout_left_wrapper {
  order: 1;
  max-width: none;
  width: 100%;
  flex: none;
  padding: 0;
}

body.order .checkout_right_column,
body.order .checkout_left_column {
  margin-bottom: 0;
}

/* ── Step progress breadcrumb bar ── */
body.order .checkout-steps-progress {
  background: #f8f8f8;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 40px;
}

body.order .checkout-steps-progress-inner {
  display: flex;
  max-width: 760px;
  margin: 0 auto;
}

body.order .checkout-steps-progress .checkout-step-tab {
  flex: 1;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #bbb;
  border-bottom: 3px solid transparent;
  text-decoration: none;
}

body.order .checkout-steps-progress .checkout-step-tab.done {
  color: #aaa;
  border-bottom-color: transparent;
}

body.order .checkout-steps-progress .checkout-step-tab.active {
  color: #111;
  font-weight: 700;
  border-bottom-color: #111;
}

body.order .checkout-steps-progress .checkout-step-tab .tab-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid #ddd;
  color: #bbb;
  background: transparent;
}

body.order .checkout-steps-progress .checkout-step-tab.done .tab-number {
  background: #aaa;
  border-color: #aaa;
  color: #fff;
}

body.order .checkout-steps-progress .checkout-step-tab.active .tab-number {
  background: #111;
  border-color: #111;
  color: #fff;
  font-weight: 900;
}

/* ── Step cards (base) ── */
body.order .checkout-step {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
  opacity: 1;
}

body.order .checkout-step .step-title {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fafafa;
  border-bottom: none;
  cursor: pointer;
}

body.order .checkout-step .step-title .heading_color {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #111;
  line-height: 1;
}

body.order .checkout-step .step-title .step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ccc;
  color: #bbb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
  background: transparent;
}

body.order .checkout-step .step-title .fto-ok-1 {
  display: none;
}

body.order .checkout-step .step-title .step-edit {
  font-size: 11px;
  color: #555;
  font-weight: 600;
  text-decoration: underline;
  margin-left: auto;
}

body.order .checkout-step .content {
  display: none;
}

/* Unreachable */
body.order .checkout-step:not(.-reachable):not(.-current):not(.-complete) {
  opacity: .5;
}

/* ── Active step ── */
body.order .checkout-step.-current {
  border: 2px solid #111;
}

body.order .checkout-step.-current .step-title {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

body.order .checkout-step.-current .step-title .step-number {
  background: #111;
  color: #fff;
  border-color: #111;
  font-weight: 900;
}

body.order .checkout-step.-current .step-title .heading_color {
  color: #111;
}

body.order .checkout-step.-current .content {
  display: block;
  padding: 24px 20px;
}

/* ── Completed step ── */
body.order .checkout-step.-complete {
  border: 1px solid #e8e8e8;
}

body.order .checkout-step.-complete .step-title {
  background: #fafafa;
}

body.order .checkout-step.-complete .step-title .step-number {
  display: none;
}

body.order .checkout-step.-complete .step-title .fto-ok-1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 11px;
  flex-shrink: 0;
}

body.order .checkout-step.-complete .step-title .heading_color {
  color: #111;
}

body.order .checkout-step.-complete .content {
  display: none;
}

/* ── Form fields inside active step ── */
body.order .checkout-step .content label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #555;
  margin-bottom: 5px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

body.order .checkout-step .content input[type="text"],
body.order .checkout-step .content input[type="email"],
body.order .checkout-step .content input[type="tel"],
body.order .checkout-step .content input[type="password"],
body.order .checkout-step .content select,
body.order .checkout-step .content textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  color: #111;
  outline: none;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s;
  font-family: inherit;
}

body.order .checkout-step .content input[type="text"]:focus,
body.order .checkout-step .content input[type="email"]:focus,
body.order .checkout-step .content input[type="tel"]:focus,
body.order .checkout-step .content input[type="password"]:focus,
body.order .checkout-step .content select:focus,
body.order .checkout-step .content textarea:focus {
  border-color: #111;
}

/* Override Panda's flex row layout (label + input horizontal) */
body.order .checkout-step .content .form-group {
  display: block;
  flex: none;
  flex-flow: unset;
  align-items: unset;
  margin-bottom: 14px;
}

body.order .checkout-step .content .form-control-group {
  margin-bottom: 14px;
}

/* 2-col grid for address fields */
body.order .checkout-step .content .com_grid_view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

/* Full-width fields */
body.order .checkout-step .content .com_grid_view .st_form_item_address,
body.order .checkout-step .content .com_grid_view .st_form_item_address2,
body.order .checkout-step .content .com_grid_view .st_form_item_phone,
body.order .checkout-step .content .com_grid_view .st_form_item_phone_mobile,
body.order .checkout-step .content .com_grid_view .st_form_item_id_country,
body.order .checkout-step .content .com_grid_view .st_form_item_alias {
  grid-column: 1 / -1;
}

body.order .checkout-step .content .form-group-small .form-control,
body.order .checkout-step .content .form-group-small .input-group,
body.order .checkout-step .content .js-input-column {
  max-width: none;
  width: 100%;
}

body.order .checkout-step .content .col-lg-6 {
  width: 100%;
  float: none;
  padding: 0;
}

body.order .checkout-step .content .form-control {
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  color: #111;
  height: auto;
  box-shadow: none;
}

body.order .checkout-step .content .form-control:focus {
  border-color: #111;
  box-shadow: none;
}

/* Checkbox */
body.order .checkout-step .content .custom-checkbox label,
body.order .checkout-step .content .ps-shown-by-js label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

body.order .checkout-step .content .custom-checkbox input[type="checkbox"],
body.order .checkout-step .content .ps-shown-by-js input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #111;
  flex-shrink: 0;
  padding: 0;
  border-radius: 3px;
}

/* CTA continue button */
body.order .checkout-step .content .continue,
body.order .checkout-step .content button[data-link-action="save-address"],
body.order .checkout-step .content button[name="confirmDeliveryOption"],
body.order .checkout-step .content button[name="payment-confirmation"] {
  padding: 13px 32px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.order .checkout-step .content .continue:hover,
body.order .checkout-step .content button[data-link-action="save-address"]:hover,
body.order .checkout-step .content button[name="confirmDeliveryOption"]:hover,
body.order .checkout-step .content button[name="payment-confirmation"]:hover {
  background: #333;
}

/* ── Shipping options ── */
body.order .delivery-options-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

body.order .delivery-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

body.order .delivery-option:has(input:checked) {
  border-color: #111;
}

body.order .delivery-option label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-transform: none !important;
  font-weight: 400 !important;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  letter-spacing: 0;
  margin: 0 !important;
}

body.order .delivery-option input[type="radio"] {
  accent-color: #111;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

body.order .delivery-option .carrier-delay {
  font-size: 12px;
  color: #888;
}

body.order .delivery-option .carrier-price {
  font-weight: 700;
  color: #111;
  font-size: 13px;
  margin-left: auto;
}

/* ── Payment options ── */
body.order .payment-options .payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

body.order .payment-options .payment-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  text-transform: none !important;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  letter-spacing: 0;
  margin: 0 !important;
}

body.order .payment-options .payment-option input[type="radio"] {
  accent-color: #111;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Conditions */
body.order .condition-label label {
  text-transform: none !important;
  font-size: 12px;
  font-weight: 400 !important;
  color: #555;
  letter-spacing: 0;
  cursor: pointer;
}

/* ── Order summary right column ── */
body.order .checkout_right_column {
  position: sticky;
  top: 80px;
}

body.order #js-checkout-summary {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

body.order #js-checkout-summary .card-block {
  padding: 0;
}

body.order #js-checkout-summary .cart-summary-products {
  padding: 16px 20px;
  background: #f8f8f8;
  border-bottom: 1px solid #e8e8e8;
  margin: 0;
}

body.order #js-checkout-summary .cart-summary-products .mar_b6 {
  margin-bottom: 0;
}

body.order #js-checkout-summary .cart-summary-products a[data-toggle="collapse"] {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

body.order #js-checkout-summary .summary-product-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: none;
}

body.order #js-checkout-summary .summary-product-list.dotted_line > * {
  border-bottom: none;
}

body.order #js-checkout-summary .summary-product-item {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  align-items: center;
  gap: 14px;
}

body.order #js-checkout-summary .summary-product-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

body.order #js-checkout-summary .summary-product-item .product-name {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  margin-bottom: 2px;
}

body.order #js-checkout-summary .summary-product-item .small_cart_attr_attr {
  font-size: 11px;
  color: #888;
}

body.order #js-checkout-summary .summary-product-item .summary-product-price {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin-left: auto;
  flex-shrink: 0;
}

/* Voucher */
body.order #js-checkout-summary .cart-voucher {
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
}

body.order #js-checkout-summary .cart-voucher hr {
  display: none;
}

body.order #js-checkout-summary .cart-voucher .card-block {
  padding: 0;
}

body.order #js-checkout-summary .cart-voucher .collapse-button,
body.order #js-checkout-summary .cart-voucher .promo-code-button {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  text-decoration: none;
}

body.order #js-checkout-summary .cart-voucher .input-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

body.order #js-checkout-summary .cart-voucher .promo-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  font-size: 12px;
  color: #111;
  outline: none;
  box-shadow: none;
  height: auto;
}

body.order #js-checkout-summary .cart-voucher .promo-input:focus {
  border-color: #111;
  box-shadow: none;
}

body.order #js-checkout-summary .cart-voucher .input-group-btn .btn,
body.order #js-checkout-summary .cart-voucher button[type="submit"] {
  padding: 9px 14px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  height: auto;
}

body.order #js-checkout-summary hr {
  margin: 0;
  border-color: #e8e8e8;
}

/* Cart summary lines (subtotals) */
body.order #js-checkout-summary .cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  font-size: 13px;
  color: #555;
}

body.order #js-checkout-summary .cart-summary-line .label {
  color: #555;
  font-weight: 400;
  background: none;
  padding: 0;
  font-size: 13px;
}

body.order #js-checkout-summary .cart-summary-line .value {
  font-weight: 600;
  color: #111;
}

/* Totals */
body.order #js-checkout-summary .cart-summary-totals {
  padding: 0 20px 16px;
}

body.order #js-checkout-summary .cart-summary-totals .cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1.5px solid #e8e8e8;
  margin-top: 8px;
  padding-left: 0;
  padding-right: 0;
}

body.order #js-checkout-summary .cart-summary-totals .cart-total .label {
  font-size: 15px;
  font-weight: 800;
  color: #111;
  background: none;
  padding: 0;
}

body.order #js-checkout-summary .cart-summary-totals .cart-total .value {
  font-size: 18px;
  font-weight: 900;
  color: #111;
}

body.order #js-checkout-summary .cart-summary-totals .cart-summary-line:not(.cart-total) {
  padding: 6px 0;
}

/* ── Reassurance block ── */
body.order .checkout_right_column .block-reassurance {
  margin-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: none;
  border: 1px solid #e8e8e8;
  border-top: none;
}

/* ── Alerts ── */
body.order .alert {
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  padding: 10px 14px;
}

/* ── Free shipping highlight ── */
body.order #js-checkout-summary .cart-summary-line .value.free-shipping,
body.order #js-checkout-summary .cart-summary-line .value[class*="free"] {
  color: #2ecc71;
  font-weight: 700;
}

/* ── IVA / tax note below total ── */
body.order #js-checkout-summary .cart-summary-totals .cart-summary-line.cart-summary-subtotals {
  font-size: 11px;
  color: #999;
  text-align: right;
  justify-content: flex-end;
  padding-top: 0;
  padding-bottom: 4px;
}

/* ── Reassurance trust row in summary ── */
body.order .checkout_right_column .checkout-trust-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 14px 20px;
  border-top: 1px solid #eee;
}

body.order .checkout_right_column .checkout-trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #888;
}

/* ── Block reassurance integration ── */
body.order .checkout_right_column .block-reassurance-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 12px;
  color: #555;
  border-top: 1px solid #eee;
}

body.order .checkout_right_column .block-reassurance-item img,
body.order .checkout_right_column .block-reassurance-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .6;
}

/* ── Completed step flex_child summary ── */
body.order .checkout-step.-complete .step-title .flex_child {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 12px;
  color: #555;
}

body.order .checkout-step.-complete .step-title .step-edit {
  margin-left: 0;
}

/* ── Payment confirmation button full width ── */
body.order #payment-confirmation button {
  width: 100%;
  justify-content: center;
  padding: 15px 32px;
  font-size: 15px;
}

/* ── Mobile ── */
@media (max-width: 991px) {
  body.order #content > .row {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 20px;
  }

  body.order .checkout_right_wrapper {
    order: -1;
  }

  body.order .checkout_left_wrapper {
    order: 1;
  }

  body.order .checkout_right_column {
    position: static;
  }

  body.order #header_primary.checkout_header {
    padding: 0 16px;
  }

  /* ── Mobile step progress ── */
  body.order .checkout-steps-progress {
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
  }

  body.order .checkout-steps-progress-inner {
    position: relative;
    align-items: flex-start;
    gap: 0;
  }

  body.order .checkout-steps-progress .checkout-step-tab {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 0;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    border-bottom: none;
    position: relative;
  }

  body.order .checkout-steps-progress .checkout-step-tab .tab-label {
    display: block;
  }

  body.order .checkout-steps-progress .checkout-step-tab .tab-number {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  /* Connector line between steps */
  body.order .checkout-steps-progress .checkout-step-tab:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 26px;
    left: calc(50% + 13px);
    width: calc(100% - 26px);
    height: 2px;
    background: #ddd;
    pointer-events: none;
  }

  /* ── Fix Panda's flex label+input row layout ── */
  body.order .checkout-step .content .form-group,
  body.order .checkout-step .content .form-group-small {
    display: block;
    flex: none;
    flex-flow: unset;
    align-items: unset;
    margin-bottom: 12px;
  }

  body.order .checkout-step .content .form-group label,
  body.order .checkout-step .content .form-group-small label {
    display: block;
    width: 100%;
    margin-bottom: 4px;
  }

  body.order .checkout-step .content .form-group .js-input-column,
  body.order .checkout-step .content .form-group-small .js-input-column {
    width: 100%;
    max-width: none;
  }

  body.order .checkout-step .content .form-group-small .form-control,
  body.order .checkout-step .content .form-group-small .input-group {
    max-width: none;
    width: 100%;
  }

  /* 2-column grid: nombre+apellidos, CP+ciudad */
  body.order .checkout-step .content .col-lg-6 {
    width: 100%;
    float: none;
    padding: 0;
  }

  body.order .checkout-step .content .com_grid_view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Full width: dirección, teléfono, país, alias */
  body.order .checkout-step .content .com_grid_view .st_form_item_address,
  body.order .checkout-step .content .com_grid_view .st_form_item_address2,
  body.order .checkout-step .content .com_grid_view .st_form_item_postcode,
  body.order .checkout-step .content .com_grid_view .st_form_item_city,
  body.order .checkout-step .content .com_grid_view .st_form_item_phone,
  body.order .checkout-step .content .com_grid_view .st_form_item_phone_mobile,
  body.order .checkout-step .content .com_grid_view .st_form_item_id_country,
  body.order .checkout-step .content .com_grid_view .st_form_item_alias {
    grid-column: 1 / -1;
  }

  /* ── Mobile step content padding ── */
  body.order .checkout-step .content,
  body.order .checkout-step.-current .content {
    padding: 16px;
  }

  /* ── Mobile order summary ── */
  body.order #js-checkout-summary .cart-summary-products a[data-toggle="collapse"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  body.order #js-checkout-summary .cart-summary-products a[data-toggle="collapse"]::after {
    content: '▾';
    font-size: 12px;
    color: #999;
    transition: transform .2s;
  }

  body.order #js-checkout-summary .cart-summary-products a[aria-expanded="true"]::after {
    transform: rotate(180deg);
  }
}
