/*!
 * rb-mobile-cart.css — RoadBiker mobile shopping-cart redesign
 * -----------------------------------------------------------------
 * Mobile only (<=991px) and scoped to html.route-checkout-cart, so the
 * desktop cart and every other page are untouched.
 *
 * Turns the 6-column data table into one card per product (image / name /
 * unit price / stepper / line total), lightens the dark panels, restyles the
 * free-shipping meter in brand gold, and gives the page a single obvious
 * checkout call to action.
 *
 * CSS only — no markup or JS changes, so it is fully reversible by removing
 * the <link> tag.
 */

@media (max-width: 991px) {

  /* ---------------------------------------------------------------- page */

  html.route-checkout-cart #content {
    background: #f5f6f7;
    padding: 12px 12px 26px;
  }

  html.route-checkout-cart #content .page-title {
    font-size: 21px;
    font-weight: 900;
    color: #171717;
    margin: 4px 0 14px;
    padding: 0;
    border: 0;
  }

  /* The bottom menu bar overlaps the last element otherwise. */
  html.route-checkout-cart.has-bottom-menu .cart-page {
    padding-bottom: 70px;
  }

  /* ------------------------------------------------ free shipping meter */

  html.route-checkout-cart .card-progress {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 14px;
    margin: 0 0 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
  }

  html.route-checkout-cart .title-progress-cart,
  html.route-checkout-cart .title-progress-cart b {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.7;
    color: #3a3a3a;
    margin: 0 0 10px;
  }

  html.route-checkout-cart .title-progress-cart span {
    color: #b07400 !important;
    font-weight: 900;
  }

  html.route-checkout-cart .progress-cart .progress {
    height: 10px !important;
    border-radius: 999px !important;
    background: #eeeeef !important;
    overflow: hidden;
    margin: 0;
    box-shadow: none;
  }

  /* The theme paints the bar grey and floats it left; make it read as
     "progress toward free shipping" in brand gold instead. */
  html.route-checkout-cart .progress-cart .progress .progress-bar,
  html.route-checkout-cart #progress-bar {
    background: linear-gradient(90deg, #f5a400, #ffc95c) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
  }

  /* ------------------------------------------------------ product cards */

  html.route-checkout-cart .cart-table .table-responsive {
    overflow: visible;
    border: 0;
    margin: 0;
  }

  html.route-checkout-cart .cart-table table,
  html.route-checkout-cart .cart-table tbody {
    display: block;
    width: 100% !important;
    border: 0 !important;
    background: none;
  }

  html.route-checkout-cart .cart-table td {
    display: block;
    width: auto;
    border: 0 !important;
    background: none;
  }

  html.route-checkout-cart .cart-table thead {
    display: none;
  }

  html.route-checkout-cart .cart-table tbody tr {
    position: relative;
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    grid-template-areas:
      "img name  name"
      "img price price"
      "img qty   total";
    align-items: center;
    gap: 6px 12px;
    background: #fff;
    border: 1px solid #ececec !important;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
  }

  html.route-checkout-cart .cart-table td.td-image {
    grid-area: img;
    align-self: start;
    padding: 0 !important;
  }

  html.route-checkout-cart .cart-table td.td-image img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 4px;
    max-width: none;
  }

  html.route-checkout-cart .cart-table td.td-name {
    grid-area: name;
    align-self: start;
    padding: 0 !important;
    text-align: start;
    /* leave room for the floating remove button */
    padding-inline-end: 34px !important;
  }

  html.route-checkout-cart .cart-table td.td-name a {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    color: #171717;
    text-decoration: none;
    display: block;
  }

  /* Model number is warehouse noise on a phone. */
  html.route-checkout-cart .cart-table td.td-model {
    display: none !important;
  }

  html.route-checkout-cart .cart-table td.td-price {
    grid-area: price;
    padding: 0 !important;
    font-size: 12px;
    color: #8a8a8a;
    text-align: start;
  }

  html.route-checkout-cart .cart-table td.td-price::before {
    content: "سعر الوحدة: ";
  }

  html.route-checkout-cart .cart-table td.td-total {
    grid-area: total;
    padding: 0 !important;
    font-size: 16px;
    font-weight: 900;
    color: #171717;
    text-align: end;
    white-space: nowrap;
  }

  html.route-checkout-cart .cart-table td.td-qty {
    grid-area: qty;
    padding: 0 !important;
    text-align: start;
  }

  /* ------------------------------------------------ stepper and actions */

  html.route-checkout-cart .cart-table td.td-qty .input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
  }

  html.route-checkout-cart .cart-table .stepper {
    display: inline-flex;
    align-items: center;
    height: 38px;
    background: #fafafa;
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    overflow: hidden;
    width: auto;
  }

  html.route-checkout-cart .cart-table .stepper button {
    width: 38px;
    height: 38px;
    border: 0;
    background: none;
    color: #2f2f2f;
    font-size: 15px;
    line-height: 38px;
    padding: 0;
  }

  html.route-checkout-cart .cart-table .stepper button:active {
    background: #f0f0f0;
  }

  html.route-checkout-cart .cart-table .stepper input.form-control {
    width: 40px;
    height: 38px;
    border: 0;
    background: none;
    box-shadow: none;
    text-align: center;
    font-size: 14px;
    font-weight: 900;
    color: #171717;
    padding: 0;
  }

  html.route-checkout-cart .cart-table .input-group-btn {
    display: inline-flex;
    gap: 8px;
    width: auto;
  }

  /* Update = a clear gold action rather than a mystery refresh glyph. */
  html.route-checkout-cart .cart-table .btn-update {
    height: 38px;
    min-width: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff7e7;
    border: 1px solid #f5a400;
    color: #9a6200;
    font-size: 14px;
  }

  /* Remove floats to the card corner as a quiet icon. */
  html.route-checkout-cart .cart-table .btn-remove {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    background: #f7f7f8;
    border: 1px solid #ececec;
    color: #9a9a9a;
    font-size: 13px;
    line-height: 28px;
  }

  html.route-checkout-cart .cart-table .btn-remove:active {
    background: #ffecec;
    border-color: #ffc9c9;
    color: #d33;
  }

  /* --------------------------------------------------------- accordions */

  html.route-checkout-cart .cart-bottom,
  html.route-checkout-cart .panels-total,
  html.route-checkout-cart .cart-panels {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  html.route-checkout-cart .cart-panels > .title {
    font-size: 16px;
    font-weight: 900;
    color: #171717;
    margin: 18px 0 6px;
    padding: 0;
    border: 0;
    background: none;
  }

  html.route-checkout-cart .cart-panels > p {
    font-size: 12.5px;
    color: #8a8a8a;
    line-height: 1.7;
    margin: 0 0 12px;
  }

  html.route-checkout-cart .cart-panels .panel,
  html.route-checkout-cart .cart-panels .panel-heading,
  html.route-checkout-cart .cart-panels .panel-body {
    background: #fff !important;
    color: #171717 !important;
  }

  html.route-checkout-cart .cart-panels .panel {
    border: 1px solid #ececec !important;
    border-radius: 14px !important;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
  }

  html.route-checkout-cart .cart-panels .panel-heading {
    padding: 0 !important;
    border: 0 !important;
  }

  html.route-checkout-cart .cart-panels .panel-title {
    margin: 0;
  }

  html.route-checkout-cart .cart-panels .panel-title a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 14px;
    font-size: 13.5px;
    font-weight: 800;
    color: #171717 !important;
    text-decoration: none;
  }

  html.route-checkout-cart .cart-panels .panel-title a .fa {
    color: #b3b3b3;
    transition: transform .18s ease;
  }

  html.route-checkout-cart .cart-panels .panel-title a[aria-expanded="true"] .fa {
    transform: rotate(180deg);
  }

  html.route-checkout-cart .cart-panels .panel-body {
    padding: 14px !important;
    border-top: 1px solid #f2f2f2 !important;
  }

  html.route-checkout-cart .cart-panels .panel-body label {
    display: block;
    width: auto;
    float: none;
    text-align: start;
    font-size: 12.5px;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    padding: 0;
  }

  html.route-checkout-cart .cart-panels .panel-body .form-control,
  html.route-checkout-cart .cart-panels .panel-body select,
  html.route-checkout-cart .cart-panels .panel-body input[type="text"] {
    height: 44px;
    border-radius: 10px;
    border: 1px solid #e2e2e2;
    box-shadow: none;
    font-size: 14px;
    background: #fff;
    color: #171717;
  }

  html.route-checkout-cart .cart-panels .panel-body .btn,
  html.route-checkout-cart .cart-panels .panel-body input[type="button"] {
    height: 44px;
    border-radius: 10px;
    background: #171717;
    border-color: #171717;
    color: #fff;
    font-size: 13.5px;
    font-weight: 800;
    padding: 0 16px;
  }

  html.route-checkout-cart .cart-panels .input-group {
    display: flex;
    gap: 8px;
  }

  html.route-checkout-cart .cart-panels .input-group .form-control {
    flex: 1;
    min-width: 0;
  }

  html.route-checkout-cart .cart-panels .input-group-btn {
    width: auto;
    display: flex;
  }

  /* ------------------------------------------------------------ totals */

  html.route-checkout-cart .cart-total {
    width: 100%;
    float: none;
    padding: 0;
    margin: 14px 0 0;
  }

  html.route-checkout-cart .cart-total .table-responsive,
  html.route-checkout-cart .cart-total .table-scroll {
    overflow: visible;
    border: 0;
    margin: 0;
  }

  html.route-checkout-cart .cart-total table {
    display: block;
    background: #fff;
    border: 1px solid #ececec !important;
    border-radius: 16px;
    padding: 4px 14px;
    margin: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
  }

  html.route-checkout-cart .cart-total tbody,
  html.route-checkout-cart .cart-total tr {
    display: block;
  }

  html.route-checkout-cart .cart-total tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px dashed #eee;
  }

  html.route-checkout-cart .cart-total tr:last-child {
    border-bottom: 0;
  }

  html.route-checkout-cart .cart-total td {
    display: block;
    border: 0 !important;
    padding: 0 !important;
    font-size: 13.5px;
    color: #6f6f6f;
    text-align: start !important;
    white-space: nowrap;
  }

  html.route-checkout-cart .cart-total td strong {
    font-weight: 700;
    color: #6f6f6f;
  }

  html.route-checkout-cart .cart-total tr:last-child td,
  html.route-checkout-cart .cart-total tr:last-child td strong {
    font-size: 18px;
    font-weight: 900;
    color: #171717;
  }

  /* ------------------------------------------------------------ buttons */

  html.route-checkout-cart .cart-page .buttons {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    background: none;
  }

  html.route-checkout-cart .cart-page .buttons .pull-left,
  html.route-checkout-cart .cart-page .buttons .pull-right {
    float: none !important;
    width: 100%;
  }

  html.route-checkout-cart .cart-page .buttons .btn {
    display: block;
    width: 100%;
    height: auto;
    padding: 15px 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 900;
    text-align: center;
    white-space: normal;
  }

  html.route-checkout-cart .cart-page .buttons .btn-primary {
    background: #f5a400;
    border-color: #f5a400;
    color: #1a1208;
    box-shadow: 0 6px 16px rgba(245, 164, 0, .3);
  }

  html.route-checkout-cart .cart-page .buttons .btn-default {
    background: #fff;
    border: 1px solid #e2e2e2;
    color: #444;
    font-weight: 700;
  }

  /* mispay widget sits between totals and buttons */
  html.route-checkout-cart .mispay-widget-container {
    margin: 12px 0 !important;
  }

  /* ------------------------------------------------------- empty cart */

  html.route-checkout-cart #content > p {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 22px 16px;
    text-align: center;
    font-size: 14px;
    color: #6f6f6f;
  }

  /* ------------------------------------------------------- hardening ----
     The theme runs a dark colour scheme: it paints text rgb(183,183,183),
     the line total rgb(247,247,247) (white on white) and the cart buttons
     rgb(35,40,41). Those rules outrank the ones above, so the cards need
     these explicit overrides to be readable on a white surface. */

  html.route-checkout-cart .cart-page .cart-table td.td-name a,
  html.route-checkout-cart .cart-page .cart-table td.td-name {
    color: #171717 !important;
  }

  html.route-checkout-cart .cart-page .cart-table td.td-price {
    color: #8a8a8a !important;
  }

  html.route-checkout-cart .cart-page .cart-table td.td-total {
    color: #171717 !important;
    font-weight: 900 !important;
  }

  html.route-checkout-cart .cart-page .cart-table .stepper {
    background: #fafafa !important;
    border: 1px solid #e4e4e4 !important;
  }

  html.route-checkout-cart .cart-page .cart-table .stepper button {
    width: 38px !important;
    min-width: 38px !important;
    flex: 0 0 38px !important;
    height: 38px !important;
    background: transparent !important;
    border: 0 !important;
    color: #2f2f2f !important;
  }

  html.route-checkout-cart .cart-page .cart-table .stepper input.form-control {
    background: transparent !important;
    color: #171717 !important;
    border: 0 !important;
    width: 40px !important;
    height: 38px !important;
  }

  html.route-checkout-cart .cart-page .cart-table .btn-update {
    background: #fff7e7 !important;
    border: 1px solid #f5a400 !important;
    color: #9a6200 !important;
    width: auto !important;
    height: 38px !important;
    border-radius: 999px !important;
  }

  html.route-checkout-cart .cart-page .cart-table .btn-remove {
    background: #f7f7f8 !important;
    border: 1px solid #ececec !important;
    color: #9a9a9a !important;
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    font-size: 12px !important;
  }

  /* totals + panels sit on white cards, so their text must be dark too */
  html.route-checkout-cart .cart-page .cart-total td,
  html.route-checkout-cart .cart-page .cart-total td strong {
    color: #6f6f6f !important;
  }

  html.route-checkout-cart .cart-page .cart-total tr:last-child td,
  html.route-checkout-cart .cart-page .cart-total tr:last-child td strong {
    color: #171717 !important;
  }

  html.route-checkout-cart .cart-page .cart-panels .panel-title a,
  html.route-checkout-cart .cart-page .cart-panels .panel-body,
  html.route-checkout-cart .cart-page .cart-panels .panel-body label {
    color: #171717 !important;
  }

  html.route-checkout-cart .cart-page .cart-panels > .title {
    color: #171717 !important;
  }

  /* ------------------------------------------------- rebuilt cart cards --
     Markup built by rb-mobile-cart.js. Own class names, so none of the
     theme's table/button rules apply and nothing has to be fought. */

  html.route-checkout-cart .rb-cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 4px;
  }

  html.route-checkout-cart .rb-cart-card {
    position: relative;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas:
      "thumb info"
      "foot  foot";
    gap: 12px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    transition: opacity .15s ease;
  }

  html.route-checkout-cart .rb-cart-card.is-updating {
    opacity: .5;
    pointer-events: none;
  }

  html.route-checkout-cart .rb-cart-thumb {
    grid-area: thumb;
    width: 84px;
    height: 84px;
    border: 1px solid #f1f1f1;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  html.route-checkout-cart .rb-cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  html.route-checkout-cart .rb-cart-info {
    grid-area: info;
    min-width: 0;
    padding-inline-end: 34px;
  }

  html.route-checkout-cart .rb-cart-name {
    display: block;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    color: #171717 !important;
    text-decoration: none !important;
    max-height: 2.9em;
    overflow: hidden;
  }

  html.route-checkout-cart .rb-cart-variant {
    font-size: 11.5px;
    color: #8a8a8a !important;
    margin-top: 4px;
  }

  html.route-checkout-cart .rb-cart-unit {
    font-size: 12px;
    color: #8a8a8a !important;
    margin-top: 7px;
  }

  html.route-checkout-cart .rb-cart-unit::before {
    content: "سعر الوحدة: ";
  }

  html.route-checkout-cart .rb-cart-x {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    background: #f7f7f8 !important;
    border: 1px solid #ececec !important;
    color: #9a9a9a !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  html.route-checkout-cart .rb-cart-x svg {
    width: 15px;
    height: 15px;
  }

  html.route-checkout-cart .rb-cart-x:active {
    background: #ffecec !important;
    border-color: #ffc9c9 !important;
    color: #d33 !important;
  }

  html.route-checkout-cart .rb-cart-foot {
    grid-area: foot;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
  }

  html.route-checkout-cart .rb-qty {
    display: inline-flex;
    align-items: center;
    background: #fafafa !important;
    border: 1px solid #e4e4e4 !important;
    border-radius: 999px;
    overflow: hidden;
  }

  html.route-checkout-cart .rb-qty button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0 !important;
    background: none !important;
    color: #2f2f2f !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  html.route-checkout-cart .rb-qty button:active {
    background: #f0f0f0 !important;
  }

  html.route-checkout-cart .rb-qty button svg {
    width: 16px;
    height: 16px;
  }

  html.route-checkout-cart .rb-qty-val {
    min-width: 34px;
    text-align: center;
    font-size: 14px;
    font-weight: 900;
    color: #171717 !important;
  }

  html.route-checkout-cart .rb-cart-total {
    font-size: 17px;
    font-weight: 900;
    color: #171717 !important;
    white-space: nowrap;
  }
}
