.container {
    max-width: 1095px;
    padding: 100px 16px 30px 16px;
    margin-inline: auto;
}

.heading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-block: 20px;
}

.heading__subtitile {
    font-size: 12px;
    color: var(--black-500);
    text-align: center;
}

.heading__title {
    font-size: 28px;
    color: var(--black-400);
    text-align: center;
    font-family: var(--font-base-medium);
}

.empty-car__title {
    display: flex;
    justify-content: center;
    padding-block: 20px;
}

.buy-button {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-car__buy-now {
    width: 200px;
    height: 50px;
    border-radius: 25px;
    background-color: var(--emphasis-color);
    border: none;
    color: white;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    cursor: pointer;
}

.empty-car__buy-now p{
    font-family: var(--font-base-bold);
}

.empty-car__buy-now svg{
    width: 16px;
    height: 16px;
}

.empty-car__buy-now:hover {
    opacity: 0.9;
}

.basket-page-content {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;

    gap: 20px;
}

.car-items {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    gap: 10px;
}

.item-card {
    padding: 10px;
    border-radius: 8px;
    background-color: #F5F5F5;
    min-width: 320px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-sizing: border-box;
}

/* Highlight when requested qty > available stock */
.item-card--insufficient {
    background-color: #fff1f0; /* light red */
    border: 1px solid #f5c2c7; /* soft red border */
}

.card-image {
    object-fit: cover;

    display: flex;
    align-items: center;

    height: 100%;
    background-color: white;
    border-radius: 4px;
}

.item__img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    height: 75px;
    width: auto;
    border-radius: 4px;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item__name-delete {
    display: flex;
    flex: 1;
}

.item__name {
    flex: 1;
}

.item__name a {
    font-size: 16px;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    color: black;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-height: calc(1.5em * 2);
}

.basket-discount-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background-color: #FF1A1A;
    padding: 2px 8px;
    border-radius: 4px;
    vertical-align: middle;
}

.delete__icon {
    cursor: pointer;
}

.delete__icon-svg {
    fill: black;
}

.card-price {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.buy-section__price {
    display: flex;
    align-items: center;
}

.buy-section__price small {
    color: black;
    font-size: 12px;
}

.buy-section__price p {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: black;
}

.quantity {
    display: flex;
    align-items: center;
    background-color: #e9e9e9;
    height: 40px;
    border-radius: 20px;
}

.quantity-minus {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 16px;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px 0 0 20px;
    background-color: #e9e9e9;
    border: none;
    color: black;
    cursor: pointer;
}

.quantity-plus {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 16px;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    background-color: #e9e9e9;
    justify-content: center;
    border-radius: 0 20px 20px 0;
    border: none;
    color: black;
    cursor: pointer;
}

.quantity-input {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 16px;
    border: none;
    outline: none;
    text-align: center;
    user-select: none;
    background-color: #e9e9e9;
    color: rgb(0, 0, 0);
    width: 32px;
}

.quantity-minus:hover,
.quantity-plus:hover {
    background-color: #d8d8d8;
}

.quantity-plus:focus,
.quantity-minus:focus {
    background-color: #e9e9e9;
}

.quantity-plus:active,
.quantity-minus:active {
    background-color: #c0c0c0; 
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none; /* standard */
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield; /* standard */
}

.basket-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.basket-summary {
    border: 1px solid #CACACA;
    border-radius: 12px;
    padding: 14px 20px;
    min-width: 310px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.basket-summary__title {
    color: black;
    font-family: "Poppins", sans-serif;
    font-weight: 500;
    font-size: 20px;
}

hr {
    background-color: #CDCDCD;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-progress-title {
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: black;
}

.delivery-options__title {
    color: var(--black-300);
    font-size: 16px;
    font-family: var(--font-base-medium);
}

#id_delivery_options {
    display: flex;
    margin: 0px;
    padding: 0px;
    gap: 10px;
}

#id_delivery_options label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    user-select: none;
}

#id_delivery_options input[type="radio"] {
    opacity: 0;
    position: fixed;
    width: 0;
}

#id_delivery_options label:has(input[type="radio"]:checked) {
    background-color: var(--emphasis-color);
    color: white;
    border: none;
    fill: white;
}

.subtotal-container,
.delivery-container,
.total-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.basket-summary__subtotal,
.basket-summary__delivery {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: black;
    flex: 1;
}

.subtotal,
.delivery-price {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    color: black;
    font-size: 16px;
}

.delivery-price span {
    font-family: var(--font-base);
}

.basket-summary__total {
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: black;
    flex: 1;
}

#total {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    color: black;
    font-size: 16px;
}

.checkout {
    flex: 1;
    justify-content: center;
}

.checkout__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
    width: 100%;
    height: 50px;
    background-color:#1E44D9;
    /* background-color: var(--primary-color); */
    border-radius: 25px;
    border: none;
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.checkout__button p {
    margin: 0;
    color: white;
    font-size: 16px;
    font-family: var(--font-base-bold);
}

.checkout__button svg {
    fill: white;
    height: 16px;
    width: auto;
}

.checkout__account-hint {
    display: block;
    margin-top: 8px;
    color: var(--gray-100);
    text-align: center;
}

.auth-choice-dialog {
  position: fixed;
  inset: 0;
  width: calc(100% - 32px);
  max-width: 620px;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 30px;
  overflow-y: auto;
  box-sizing: border-box;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px #0004;
}
.auth-choice-dialog::backdrop { background: #101a3caa; }
.auth-choice-dialog__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 38px;
}
.auth-choice-dialog__header h2 {
  margin: 0 0 5px;
  color: var(--emphasis-color);
  font-size: 23px;
  line-height: 1.25;
}
.auth-choice-dialog__header p,
.auth-choice-option p {
  margin: 0;
  color: var(--gray-100);
  font-size: 14px;
  line-height: 1.45;
}
.auth-choice-dialog__icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--primary-color);
  background: var(--secondary-color);
}
.auth-choice-dialog__icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-choice-dialog__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}
.auth-choice-option {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid #e3e8f3;
  border-radius: 16px;
  background: #f8faff;
}
.auth-choice-option h3 {
  margin: 0 0 5px;
  color: var(--emphasis-color);
  font-size: 17px;
}
.auth-choice-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--primary-color);
  border-radius: 999px;
  color: #fff;
  background: var(--primary-color);
  text-decoration: none;
  font-family: var(--font-base-medium);
  font-size: 14px;
  font-weight: 600;
}
.auth-choice-button:hover {
  color: #fff;
  background: #2d57a5;
  border-color: #2d57a5;
}
.auth-choice-button--secondary {
  color: var(--primary-color);
  background: #fff;
}
.auth-choice-button--secondary:hover {
  color: var(--primary-color);
  background: var(--secondary-color);
  border-color: var(--primary-color);
}

/* --- Mobile Fixed Basket Bar --- */
.basket-mobile-fixed-bar {
  display: none;
}

@media screen and (max-width: 768px) {
  .basket-mobile-fixed-bar {
    display: flex;
    flex-direction: column;
    position: fixed;
    box-sizing: border-box;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    z-index: 1002;
    background: #ffffff;
    border-top: 1px solid #e1e5ea;
    border-radius: 20px 20px 0px 0px;
    box-shadow: 0 -4px 12px 8px rgba(0,0,0,0.1);
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 64px;
  }
  .basket-mobile-fixed-bar__total {
    font-size: 18px;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    color: var(--black-400);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    gap: 2px;
  }
  .basket-mobile-fixed-bar__total .total {
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    color: var(--black-300);
  }
  .basket-mobile-fixed-bar__action {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .checkout__button--mobile {
    font-family: "Poppins", sans-serif;
    width: 100%;
    min-width: 140px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 100px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 16px 18px;
  }
  /* Hide original checkout button on mobile */
  .checkout:not(:last-child) .checkout__button:not(.checkout__button--mobile) {
    display: none;
  }
}

@media screen and (min-width: 1000px) {
    .container {
        padding: 130px 0px 60px 0px;
    }
    .heading {
        margin-block: 50px;
    }
}
.order-address-dialog {
  position: fixed;
  inset: 0;
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 28px;
  overflow-y: auto;
  box-sizing: border-box;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px #0004;
}
.order-address-dialog::backdrop { background: #101a3caa; }
.modal-close-button {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  color: #566078; background: #f1f4fa; cursor: pointer;
}
.modal-close-button:hover { color: var(--emphasis-color); background: #e5eaf5; }
.modal-close-button:focus-visible { outline: 3px solid rgba(45, 87, 165, .22); outline-offset: 2px; }
.modal-close-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.order-address-dialog__header { display: flex; align-items: center; gap: 14px; padding-right: 38px; }
.order-address-dialog__header h2 { margin: 0 0 4px; color: var(--emphasis-color); font-size: 23px; }
.order-address-dialog__header p { margin: 0; color: var(--gray-100); font-size: 14px; line-height: 1.45; }
.order-address-dialog__icon {
  flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 14px; color: var(--primary-color); background: var(--secondary-color);
}
.order-address-dialog__icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.order-address-dialog__details { margin: 22px 0 24px; padding: 18px; border: 1px solid #e3e8f3; border-radius: 14px; background: #f8faff; }
.order-address-dialog__recipient { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #e3e8f3; }
.order-address-dialog__avatar {
  flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; color: #fff; background: var(--primary-color); font-weight: 700;
}
.order-address-dialog__recipient small, .order-address-dialog__recipient strong { display: block; }
.order-address-dialog__recipient small { margin-bottom: 2px; color: var(--gray-100); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.order-address-dialog__recipient strong { color: var(--emphasis-color); font-size: 16px; }
.order-address-dialog__details dl { display: grid; gap: 11px; margin: 16px 0 0; }
.order-address-dialog__details dl div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.order-address-dialog__details dt { color: var(--gray-100); font-size: 12px; font-weight: 500; }
.order-address-dialog__details dd { margin: 0; color: var(--emphasis-color); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.order-address-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.order-dialog-button {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 18px; border: 1px solid var(--primary-color); border-radius: 999px;
  color: #fff; background: var(--primary-color); text-decoration: none;
  font-family: var(--font-base-medium); font-size: 14px; font-weight: 600; cursor: pointer;
}
.order-dialog-button:hover { color: #fff; background: #2d57a5; border-color: #2d57a5; }
.order-dialog-button--secondary { color: var(--primary-color); background: #fff; }
.order-dialog-button--secondary:hover { color: var(--primary-color); background: var(--secondary-color); border-color: var(--primary-color); }
@media (max-width: 480px) {
  .auth-choice-dialog { padding: 24px 20px 20px; }
  .auth-choice-dialog__header { align-items: flex-start; }
  .auth-choice-dialog__icon { flex-basis: 42px; width: 42px; height: 42px; }
  .auth-choice-dialog__options { grid-template-columns: 1fr; }
  .order-address-dialog { padding: 22px; }
  .order-address-dialog__header { align-items: flex-start; }
  .order-address-dialog__icon { flex-basis: 42px; width: 42px; height: 42px; }
  .order-address-dialog__details dl div { grid-template-columns: 1fr; gap: 2px; }
  .order-address-dialog__actions { grid-template-columns: 1fr; }
  .order-dialog-button--secondary { order: 2; }
}
