.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.product-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.product-card__title-link {
  color: inherit;
  text-decoration: none;
}

.product-card__title-link:hover {
  color: #53b61a;
}

.product-card__footer {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: auto;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
}

.product-card__price {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.product-card__price--view {
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
}

.product-card__sale-price {
  color: #53b61a;
  margin-right: 0.6rem;
}

.product-card__regular-price {
  text-decoration: line-through;
  color: rgba(0, 0, 0, 0.55);
  font-weight: 500;
}

.product-card__add-button {
  width: 100%;
}

.product-card__add-button--added {
  background: #4f9b23;
}

.product-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.product-cart-drawer[hidden] {
  display: none;
}

.product-cart-drawer--open {
  display: block;
}

.product-cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.product-cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 42rem);
  height: 100%;
  background: #fff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  outline: none;
  overflow: hidden;
}

.product-cart-drawer__close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 2;
  border: 0;
  background: transparent;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
}

.product-cart-drawer__body {
  overflow-y: auto;
  padding: 2.4rem;
  flex: 1;
}

.product-cart-drawer__loading {
  padding: 4rem 0;
  text-align: center;
  color: rgba(0, 0, 0, 0.7);
}

.product-cart-drawer__product {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.6rem;
  align-items: center;
  margin-bottom: 2rem;
}

.product-cart-drawer__image {
  width: 8rem;
  height: 8rem;
  object-fit: cover;
  border-radius: 8px;
  background: #f6f6f6;
}

.product-cart-drawer__title {
  font-size: 2.2rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.product-cart-drawer__subtitle {
  font-size: 1.6rem;
  color: rgba(0, 0, 0, 0.65);
}

.product-cart-drawer__variants {
  border: 0;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.product-cart-drawer__variant {
  display: block;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  cursor: pointer;
}

.product-cart-drawer__variant:has(input:checked) {
  border-color: #53b61a;
  background: rgba(83, 182, 26, 0.06);
}

.product-cart-drawer__variant--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.product-cart-drawer__variant input {
  margin-right: 1rem;
}

.product-cart-drawer__variant-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.product-cart-drawer__variant-name {
  font-weight: 600;
}

.product-cart-drawer__variant-status {
  width: 100%;
  font-size: 1.4rem;
  color: rgba(0, 0, 0, 0.65);
}

.product-cart-drawer__quantity {
  margin-bottom: 2rem;
}

.product-cart-drawer__quantity-label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.product-cart-drawer__message {
  margin-bottom: 1.2rem;
  color: #c0392b;
  font-size: 1.6rem;
}

.product-cart-drawer__message--success {
  color: #53b61a;
}

.product-cart-drawer__actions,
.product-cart-drawer__success-actions {
  display: grid;
  gap: 1rem;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 1210;
}

.cart-drawer[hidden] {
  display: none;
}

.cart-drawer--open {
  display: block;
}

.cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 44rem);
  height: 100%;
  background: #fff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  outline: none;
  overflow: hidden;
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: 2rem 2.4rem 1.2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.cart-drawer__title {
  font-size: 2.4rem;
  line-height: 1.2;
  margin: 0;
}

.cart-drawer__close {
  border: 0;
  background: transparent;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.4rem;
}

.cart-drawer__body {
  overflow-y: auto;
  padding: 1.6rem 2.4rem;
  flex: 1;
}

.cart-drawer__loading,
.cart-drawer__empty {
  padding: 3rem 0;
  text-align: center;
  color: rgba(0, 0, 0, 0.75);
}

.cart-drawer__empty-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.cart-drawer__empty-text {
  font-size: 1.6rem;
  margin-bottom: 2rem;
}

.cart-drawer__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}

.cart-drawer__item {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  gap: 1.2rem 1.6rem;
  align-items: start;
}

.cart-drawer__item--updating {
  opacity: 0.65;
}

.cart-drawer__item-image-link {
  display: block;
}

.cart-drawer__item-image {
  width: 8rem;
  height: 8rem;
  object-fit: cover;
  border-radius: 8px;
  background: #f6f6f6;
  display: block;
}

.cart-drawer__item-image--placeholder {
  display: block;
}

.cart-drawer__item-content {
  min-width: 0;
}

.cart-drawer__item-title {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
  margin-bottom: 0.4rem;
  word-break: break-word;
}

.cart-drawer__item-title:hover {
  color: #53b61a;
}

.cart-drawer__item-variant {
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 0.4rem;
  word-break: break-word;
}

.cart-drawer__item-price {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: rgba(0, 0, 0, 0.85);
}

.cart-drawer__item-total {
  font-size: 1.7rem;
  font-weight: 700;
  white-space: nowrap;
  align-self: start;
}

.cart-drawer__quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.cart-drawer__quantity-btn {
  border: 0;
  background: #f6f6f6;
  width: 4.4rem;
  height: 4.4rem;
  font-size: 2rem;
  cursor: pointer;
}

.cart-drawer__quantity-btn:disabled,
.cart-drawer__quantity-input:disabled,
.cart-drawer__remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cart-drawer__quantity-input {
  width: 5.6rem;
  height: 4.4rem;
  border: 0;
  text-align: center;
  font: inherit;
}

.cart-drawer__remove {
  display: inline-block;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 1.4rem;
  color: rgba(0, 0, 0, 0.65);
  text-decoration: underline;
  cursor: pointer;
}

.cart-drawer__footer {
  padding: 1.6rem 2.4rem 2.4rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  flex-shrink: 0;
  display: grid;
  gap: 1rem;
}

.cart-drawer__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 1.8rem;
  font-weight: 700;
}

.cart-drawer__note {
  font-size: 1.4rem;
  color: rgba(0, 0, 0, 0.65);
  margin: 0;
}

.cart-drawer__checkout,
.cart-drawer__continue {
  width: 100%;
}

.cart-drawer__error {
  font-size: 1.5rem;
  color: #c0392b;
  margin: 0 0 1rem;
}

.cart-drawer__error--line {
  margin-top: 0.6rem;
}

.cart-drawer__error--page {
  text-align: center;
  padding: 1rem 0;
}

.cart-drawer__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

.quantity-control button {
  border: 0;
  background: #f6f6f6;
  width: 4.4rem;
  height: 4.4rem;
  font-size: 2rem;
  cursor: pointer;
}

.quantity-control input {
  width: 5.6rem;
  height: 4.4rem;
  border: 0;
  text-align: center;
  font: inherit;
}

.fab {
  position: relative;
}

.fab__count {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: #53b61a;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 2rem;
  text-align: center;
}

.fab__count[hidden] {
  display: none;
}

@media screen and (max-width: 680px) {
  .product-cart-drawer__panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
  }

  .cart-drawer__panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: min(100%, 92vh);
    border-radius: 16px 16px 0 0;
  }

  .cart-drawer__item {
    grid-template-columns: 7rem 1fr;
  }

  .cart-drawer__item-image {
    width: 7rem;
    height: 7rem;
  }

  .cart-drawer__item-total {
    grid-column: 2;
    justify-self: start;
  }
}
