#mobile-auth-login {
  min-width: 7rem;
  line-height: 1.5rem;
}

.auth-profile-trigger {
  max-width: 12rem;
}

.auth-profile-trigger.auth-profile-trigger-mobile {
  max-width: 7.5rem;
  padding-inline: 0.5rem;
}

.auth-profile-name {
  display: inline-block;
  min-width: 0;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5rem;
}

.auth-profile-name-mobile {
  max-width: 4.5rem;
}

@media (min-width: 480px) {
  #mobile-auth-login {
    min-width: 8rem;
    padding-inline: 1rem;
  }

  .auth-profile-trigger.auth-profile-trigger-mobile {
    max-width: 8.5rem;
    padding-inline: 0.75rem;
  }

  .auth-profile-name-mobile {
    max-width: 5.5rem;
  }
}

/* Price Animation Styles */

#price-box,
#price-box-mobile {
  color: inherit;
  text-decoration: none;
}

/* Increased Price Animation - Green */
@keyframes priceIncreaseAnimation {
  0% {
    color: inherit;
    opacity: 1;
    transform: scale(1);
  }
  30% {
    color: #22c55e;
    opacity: 0.8;
    transform: scale(1.05);
  }
  60% {
    color: #16a34a;
    opacity: 0.6;
    transform: scale(1.02);
  }
  100% {
    color: inherit;
    opacity: 1;
    transform: scale(1);
  }
}

/* Decreased Price Animation - Red */
@keyframes priceDecreaseAnimation {
  0% {
    color: inherit;
    opacity: 1;
    transform: scale(1);
  }
  30% {
    color: #ef4444;
    opacity: 0.8;
    transform: scale(1.05);
  }
  60% {
    color: #dc2626;
    opacity: 0.6;
    transform: scale(1.02);
  }
  100% {
    color: inherit;
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply animations to price elements */
.price-increase {
  animation: priceIncreaseAnimation 0.6s ease-in-out;
}

.price-decrease {
  animation: priceDecreaseAnimation 0.6s ease-in-out;
}

@keyframes priceBoxUpdateAnimation {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(180 132 34 / 0);
  }
  35% {
    box-shadow: 0 0 0 4px rgb(180 132 34 / 0.24);
  }
}

.price-box-update {
  animation: priceBoxUpdateAnimation 0.75s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .price-increase,
  .price-decrease,
  .price-box-update {
    animation-duration: 0.01ms;
  }
}

.address-card,
.address-form-panel,
.profile-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgb(148 163 184 / 0.28);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.58);
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.06);
}

.address-card {
  padding: 1.25rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.address-card:hover {
  border-color: rgb(180 132 34 / 0.42);
  box-shadow: 0 16px 34px rgb(15 23 42 / 0.1);
  transform: translateY(-2px);
}

.address-card__accent {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 4px;
  background: linear-gradient(180deg, #c99a3e, #8f651d);
}

.address-card__header,
.address-form-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.address-card__heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.address-card__icon,
.profile-panel__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  background: rgb(180 132 34 / 0.12);
  color: #a47624;
}

.address-card__icon svg,
.profile-panel__icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.address-card__eyebrow {
  margin-bottom: 0.2rem;
  color: rgb(100 116 139 / 0.86);
  font-size: 0.72rem;
}

.address-card__title,
.address-form-panel__title,
.profile-panel__title {
  color: rgb(30 41 59 / 0.96);
  font-size: 1rem;
  font-weight: 700;
}

.address-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.address-card__action,
.address-form-panel__cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgb(148 163 184 / 0.25);
  border-radius: 0.65rem;
  padding: 0.5rem 0.7rem;
  background: rgb(248 250 252 / 0.8);
  color: rgb(51 65 85 / 0.9);
  font-size: 0.78rem;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.address-card__action svg {
  width: 1rem;
  height: 1rem;
}

.address-card__action--edit:hover,
.address-form-panel__cancel:hover {
  border-color: rgb(180 132 34 / 0.35);
  background: rgb(180 132 34 / 0.1);
  color: #8f651d;
}

.address-card__action--delete:hover {
  border-color: rgb(239 68 68 / 0.25);
  background: rgb(239 68 68 / 0.08);
  color: #dc2626;
}

.address-card__body {
  margin: 1.25rem 0;
  border-radius: 0.75rem;
  background: rgb(248 250 252 / 0.7);
  padding: 0.9rem 1rem;
  color: rgb(51 65 85 / 0.9);
  font-size: 0.88rem;
  line-height: 1.9;
}

.address-card__meta {
  display: grid;
  gap: 0.65rem;
  color: rgb(100 116 139 / 0.95);
  font-size: 0.78rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.address-card__meta p {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.address-card__meta strong {
  color: rgb(51 65 85 / 0.9);
  font-weight: 600;
}

.address-card__map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #a47624;
  font-weight: 600;
}

.address-card__map-link svg {
  width: 1rem;
  height: 1rem;
}

.address-form-panel,
.profile-panel {
  padding: 1.25rem;
}

.address-form-panel__header {
  margin-bottom: 1.5rem;
  align-items: center;
}

.address-form-panel__title {
  margin-top: 0.15rem;
}

.profile-panel__heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.profile-panel__description {
  margin-top: 0.35rem;
  color: rgb(100 116 139 / 0.9);
  font-size: 0.8rem;
  line-height: 1.8;
}

.profile-panel__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(148 163 184 / 0.18);
}

.profile-field {
  position: relative;
  display: block;
  border: 1px solid rgb(148 163 184 / 0.38);
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 0.55);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.profile-field:focus-within {
  border-color: rgb(180 132 34 / 0.8);
  background: white;
  box-shadow: 0 0 0 3px rgb(180 132 34 / 0.12);
}

.profile-field input,
.profile-field textarea {
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  padding: 1.55rem 1rem 0.8rem;
  color: rgb(30 41 59 / 0.95);
  outline: 0;
}

.profile-field input {
  min-height: 4.25rem;
}

.profile-field textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.profile-field input:disabled {
  cursor: not-allowed;
  color: rgb(100 116 139 / 0.7);
}

.profile-field__label {
  position: absolute;
  inset-inline-start: 0.75rem;
  top: 0.8rem;
  padding: 0 0.4rem;
  background: transparent;
  color: rgb(100 116 139 / 0.85);
  font-size: 0.72rem;
  pointer-events: none;
}

.profile-field:focus-within .profile-field__label {
  color: #a47624;
}

.profile-panel--danger {
  border-color: rgb(239 68 68 / 0.2);
}

.profile-panel--danger .profile-panel__icon {
  background: rgb(239 68 68 / 0.1);
  color: #dc2626;
}

.dark .address-card,
.dark .address-form-panel,
.dark .profile-panel {
  border-color: hsl(var(--border) / 0.9);
  background: hsl(var(--muted) / 0.96);
  box-shadow: 0 14px 32px rgb(0 0 0 / 0.22);
}

.dark .address-card:hover {
  border-color: hsl(var(--primary) / 0.58);
  box-shadow: 0 18px 38px rgb(0 0 0 / 0.3);
}

.dark .address-card__eyebrow,
.dark .profile-panel__description,
.dark .address-card__meta,
.dark .profile-field__label {
  color: hsl(var(--text) / 0.62);
}

.dark .address-card__title,
.dark .address-form-panel__title,
.dark .profile-panel__title,
.dark .address-card__meta strong,
.dark .profile-field input,
.dark .profile-field textarea {
  color: hsl(var(--text) / 0.96);
}

.dark .address-card__body {
  background: hsl(var(--background) / 0.72);
  color: hsl(var(--text) / 0.86);
}

.dark .address-card__action,
.dark .address-form-panel__cancel {
  border-color: hsl(var(--border) / 0.95);
  background: hsl(var(--background) / 0.7);
  color: hsl(var(--text) / 0.82);
}

.dark .address-card__action--edit:hover,
.dark .address-form-panel__cancel:hover {
  border-color: hsl(var(--primary) / 0.55);
  background: hsl(var(--primary) / 0.14);
  color: hsl(var(--primary) / 0.98);
}

.dark .profile-field {
  border-color: hsl(var(--border) / 0.95);
  background: hsl(var(--background) / 0.48);
}

.dark .profile-field:focus-within {
  border-color: hsl(var(--primary) / 0.85);
  background: hsl(var(--background) / 0.82);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.16);
}

.dark .profile-panel__footer {
  border-top-color: hsl(var(--border) / 0.72);
}

@media (max-width: 639px) {
  .address-card__header,
  .address-form-panel__header {
    flex-direction: column;
  }

  .address-card__actions {
    width: 100%;
  }

  .address-card__action {
    flex: 1;
  }

  .address-card__meta {
    grid-template-columns: 1fr;
  }
}

/* Dark mode specific colors for better contrast */
@media (prefers-color-scheme: dark) {
  @keyframes priceIncreaseAnimation {
    0% {
      color: inherit;
      opacity: 1;
      transform: scale(1);
    }
    30% {
      color: #4ade80;
      opacity: 0.8;
      transform: scale(1.05);
    }
    60% {
      color: #22c55e;
      opacity: 0.6;
      transform: scale(1.02);
    }
    100% {
      color: inherit;
      opacity: 1;
      transform: scale(1);
    }
  }

  @keyframes priceDecreaseAnimation {
    0% {
      color: inherit;
      opacity: 1;
      transform: scale(1);
    }
    30% {
      color: #fca5a5;
      opacity: 0.8;
      transform: scale(1.05);
    }
    60% {
      color: #f87171;
      opacity: 0.6;
      transform: scale(1.02);
    }
    100% {
      color: inherit;
      opacity: 1;
      transform: scale(1);
    }
  }
}
/* Homepage banners keep stable responsive frames for images of any dimensions. */
.home-main-banner {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: rgb(var(--color-background-secondary, 245 245 245));
}

.home-main-banner .swiper-wrapper,
.home-main-banner .swiper-slide,
.home-banner-link {
  width: 100%;
  height: 100%;
}

.home-banner-link {
  display: block;
  overflow: hidden;
}

.home-banner-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-side-banner {
  min-width: 0;
  flex: 1 1 0;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 0.5rem;
}

.home-category-banner {
  display: block;
  width: 100%;
  aspect-ratio: 41 / 15;
  overflow: hidden;
  border-radius: 0.5rem;
}

@media (min-width: 768px) {
  .home-category-banner {
    width: calc(50% - 0.5rem);
  }
}

@media (min-width: 1024px) {
  .home-side-banner {
    aspect-ratio: auto;
    min-height: 0;
  }
}

.invoice-modal {
  background: rgb(15 23 28 / 0%);
  opacity: 0;
  transition: opacity 220ms ease, background-color 220ms ease;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}

.invoice-modal.invoice-modal--open {
  background: rgb(15 23 28 / 56%);
  opacity: 1;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.invoice-modal__panel {
  position: relative;
  max-height: min(90vh, 38rem);
  overflow-y: auto;
  border-radius: 1rem;
  box-shadow: 0 24px 80px rgb(0 0 0 / 24%);
  transform: translateY(1.25rem) scale(0.985);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 220ms ease;
}

.invoice-modal--open .invoice-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.invoice-modal--instant,
.invoice-modal--instant .invoice-modal__panel {
  transition: none !important;
}

.invoice-modal__header {
  border-top: 3px solid hsl(var(--primary));
}

.invoice-modal__mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid hsl(var(--primary) / 0.28);
  border-radius: 0.75rem;
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-size: 1.2rem;
  font-weight: 800;
}

#mobile-menu-drawer-navigation,
#user-account-drawer-navigation {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.shop-filter-indicator:not(.hidden) {
  position: relative;
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border-radius: 9999px;
  background: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.16);
}

.shop-filter-indicator:not(.hidden)::after {
  position: absolute;
  inset: -0.2rem;
  border: 1px solid hsl(var(--primary) / 0.75);
  border-radius: inherit;
  content: "";
  animation: shop-filter-pulse 1.6s ease-out infinite;
}

@keyframes shop-filter-pulse {
  0% {
    opacity: 0.8;
    transform: scale(0.75);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

.shop-price-range__track {
  position: relative;
  height: 1.5rem;
  direction: ltr;
  touch-action: pan-y;
}

.shop-price-range__track::before,
.shop-price-range__fill {
  position: absolute;
  top: 50%;
  height: 0.3rem;
  border-radius: 9999px;
  transform: translateY(-50%);
}

.shop-price-range__track::before {
  right: 0;
  left: 0;
  background: hsl(var(--border));
  content: "";
}

.shop-price-range__fill {
  left: var(--range-start, 0%);
  width: calc(var(--range-end, 100%) - var(--range-start, 0%));
  background: hsl(var(--primary));
}

.shop-price-range__track input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.shop-price-range__track input[type="range"]:focus-visible {
  z-index: 4;
  outline: none;
}

.shop-price-range__track input[type="range"]::-webkit-slider-runnable-track {
  height: 0.3rem;
  background: transparent;
}

.shop-price-range__track input[type="range"]::-moz-range-track {
  height: 0.3rem;
  background: transparent;
}

.shop-price-range__track input[type="range"]::-webkit-slider-thumb {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -0.425rem;
  appearance: none;
  border: 3px solid hsl(var(--background));
  border-radius: 50%;
  background: hsl(var(--primary));
  box-shadow: 0 1px 5px rgb(0 0 0 / 22%);
  cursor: grab;
  pointer-events: auto;
}

.shop-price-range__track input[type="range"]::-moz-range-thumb {
  width: 0.8rem;
  height: 0.8rem;
  border: 3px solid hsl(var(--background));
  border-radius: 50%;
  background: hsl(var(--primary));
  box-shadow: 0 1px 5px rgb(0 0 0 / 22%);
  cursor: grab;
  pointer-events: auto;
}

.shop-price-range__track input[type="range"]:active::-webkit-slider-thumb,
.shop-price-range__track input[type="range"]:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.12);
}

@media (max-width: 480px) {
  .invoice-modal {
    padding: 1rem;
  }

  .invoice-modal__panel {
    max-height: 85dvh;
    border-radius: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .invoice-modal,
  .invoice-modal__panel {
    transition-duration: 0.01ms;
  }
}
