/* ===================================================================
   Service cart: the header button, the drawer, and "Add to cart" on a
   service page. Logical properties throughout, so it mirrors under
   [dir="rtl"]; colours come from the theme tokens in style.css, so
   [data-theme=dark_mode] follows without overrides.
   =================================================================== */

/* Header button */
.gt-hdr__cart {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--gt-hdr-chip-border, var(--border-soft));
  border-radius: 12px;
  background: var(--gt-hdr-chip-bg, var(--sub-bg));
  color: var(--gt-hdr-ink, var(--heading-color));
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gt-hdr__cart:hover {
  background: var(--gt-hdr-chip-hover, var(--primary10));
  color: var(--gt-hdr-accent, var(--primary-color));
}

.gt-hdr__cart:focus-visible {
  outline: 2px solid var(--gt-hdr-accent, var(--primary-color));
  outline-offset: 2px;
}

.gt-hdr__cart-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--main-bg);
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.gt-hdr__cart-badge[hidden] {
  display: none;
}

.gt-hdr__cart-badge.is-bump {
  animation: gt-cart-bump 0.45s ease;
}

@keyframes gt-cart-bump {
  30% {
    transform: scale(1.35);
  }
}

/* Drawer */
html.gt-cart-locked {
  overflow: hidden;
}

.gt-cart {
  position: fixed;
  inset: 0;
  z-index: 1090;
}

.gt-cart[hidden] {
  display: none;
}

.gt-cart__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 13, 29, 0.5);
  opacity: 0;
  backdrop-filter: blur(2px);
  transition: opacity 0.28s ease;
}

.gt-cart__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  background: var(--main-bg);
  box-shadow: -20px 0 60px rgba(15, 13, 29, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  outline: none;
}

[dir="rtl"] .gt-cart__panel {
  box-shadow: 20px 0 60px rgba(15, 13, 29, 0.18);
  transform: translateX(-100%);
}

.gt-cart.is-open .gt-cart__overlay {
  opacity: 1;
}

.gt-cart.is-open .gt-cart__panel {
  transform: translateX(0);
}

.gt-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.gt-cart__title {
  margin: 0;
  color: var(--heading-color);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.gt-cart__title-count {
  color: var(--paragraph);
  font-weight: 500;
}

.gt-cart__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: transparent;
  color: var(--heading-color);
  transition: background-color 0.2s ease;
}

.gt-cart__close:hover {
  background: var(--sub-bg);
}

.gt-cart__close:focus-visible,
.gt-cart__btn:focus-visible,
.gt-cart__qty-btn:focus-visible,
.gt-cart__remove:focus-visible,
.gt-cart__name:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.gt-cart__notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 24px 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--success-color) 12%, transparent);
  color: var(--heading-color);
  font-size: 14px;
  font-weight: 500;
  animation: gt-cart-in 0.3s ease;
}

.gt-cart__notice[hidden] {
  display: none;
}

.gt-cart__notice-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--success-color);
  color: #fff;
}

.gt-cart__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 24px;
}

.gt-cart__skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0;
}

.gt-cart__skeleton[hidden] {
  display: none;
}

.gt-cart__skeleton span {
  height: 84px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--sub-bg) 0%, var(--border-soft) 50%, var(--sub-bg) 100%);
  background-size: 200% 100%;
  animation: gt-cart-shimmer 1.2s linear infinite;
}

@keyframes gt-cart-shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes gt-cart-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.gt-cart__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gt-cart__list[hidden] {
  display: none;
}

.gt-cart__line {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
  transition: opacity 0.2s ease;
}

.gt-cart__line:last-child {
  border-bottom: 0;
}

.gt-cart__line.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.gt-cart__line.is-new {
  animation: gt-cart-in 0.35s ease;
}

.gt-cart__line.is-new .gt-cart__media {
  box-shadow: 0 0 0 2px var(--primary-color);
}

.gt-cart__media {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--primary10);
  color: var(--primary-color);
  font-size: 22px;
  font-weight: 700;
}

.gt-cart__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gt-cart__line-body {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline-end: 30px;
}

.gt-cart__name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--heading-color);
  font-size: 15px;
  font-weight: 600;
  line-height: 21px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gt-cart__name:hover {
  color: var(--primary-color);
}

.gt-cart__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
  color: var(--paragraph);
  font-size: 12.5px;
}

.gt-cart__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.gt-cart__tag--express {
  background: color-mix(in srgb, #f59f00 16%, transparent);
  color: #8a5300;
}

[data-theme=dark_mode] .gt-cart__tag--express {
  color: #ffc35a;
}

.gt-cart__extras {
  margin: 6px 0 0;
  padding: 0;
  color: var(--paragraph);
  font-size: 12.5px;
  line-height: 18px;
  list-style: none;
}

.gt-cart__line-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.gt-cart__qty {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
}

.gt-cart__qty-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--heading-color);
  font-size: 16px;
  line-height: 1;
}

.gt-cart__qty-btn:hover:not(:disabled) {
  background: var(--sub-bg);
}

.gt-cart__qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gt-cart__qty-value {
  min-width: 26px;
  color: var(--heading-color);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.gt-cart__price {
  color: var(--heading-color);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.gt-cart__remove {
  position: absolute;
  top: 14px;
  inset-inline-end: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--paragraph);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gt-cart__remove:hover {
  background: color-mix(in srgb, var(--danger-color) 12%, transparent);
  color: var(--danger-color);
}

.gt-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 12px;
  text-align: center;
}

.gt-cart__empty[hidden] {
  display: none;
}

.gt-cart__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--primary10);
  color: var(--primary-color);
}

.gt-cart__empty h3 {
  margin: 0 0 8px;
  color: var(--heading-color);
  font-size: 18px;
  font-weight: 700;
}

.gt-cart__empty p {
  max-width: 300px;
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 21px;
}

.gt-cart__foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 24px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-soft);
  background: var(--main-bg);
}

.gt-cart__foot[hidden] {
  display: none;
}

.gt-cart__subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--heading-color);
  font-size: 15px;
  font-weight: 600;
}

.gt-cart__subtotal strong {
  font-size: 22px;
  font-weight: 700;
}

.gt-cart__note,
.gt-cart__hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 18px;
}

.gt-cart__hint {
  text-align: center;
}

.gt-cart__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: filter 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gt-cart__btn--primary {
  width: 100%;
  background: var(--gradient-bg);
  color: #fff;
}

.gt-cart__empty .gt-cart__btn--primary {
  width: auto;
}

.gt-cart__btn--primary:hover {
  color: #fff;
  filter: brightness(1.08);
}

/* The theme colours every link's span; the button keeps its own. */
.gt-cart__btn span {
  color: inherit;
}

.gt-cart__btn--ghost {
  min-height: 44px;
  border-color: var(--border-soft);
  background: transparent;
  color: var(--heading-color);
}

.gt-cart__btn--ghost:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* "Add to cart" on the service page */
.svc-buy__cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 25px;
  border: 1.5px solid var(--primary-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary-color);
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.svc-buy__cart:hover:not(:disabled) {
  background: var(--primary10);
}

.svc-buy__cart:focus-visible,
.svc-mbar__cart:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.svc-buy__cart.is-busy,
.svc-mbar__cart.is-busy {
  cursor: progress;
  opacity: 0.7;
}

.svc-buy__cart-done {
  display: none;
}

.svc-buy__cart.is-done,
.svc-mbar__cart.is-done {
  border-color: var(--success-color);
  background: var(--success-color);
  color: #fff;
}

.is-done > .svc-buy__cart-icon {
  display: none;
}

.is-done > .svc-buy__cart-done {
  display: inline-block;
}

.svc-mbar__cart {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-inline-start: auto;
  padding: 0;
  border: 1.5px solid var(--primary-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary-color);
}

@media (max-width: 575px) {
  .gt-cart__head,
  .gt-cart__body,
  .gt-cart__foot {
    padding-inline: 18px;
  }

  .gt-cart__notice {
    margin-inline: 18px;
  }

  .gt-hdr__cart {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gt-cart__overlay,
  .gt-cart__panel,
  .gt-hdr__cart-badge.is-bump,
  .gt-cart__line.is-new,
  .gt-cart__notice,
  .gt-cart__skeleton span {
    animation: none;
    transition: none;
  }
}
