/* ==================================================
   SHEET - MODAL TAMBAH KE KERANJANG & ALAMAT
================================================== */

.sheet,
.address-dialog {
  width: min(440px, calc(100% - 2rem));

  max-height: 90vh;

  overflow: hidden;

  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.28);
}

/* ==================================================
   HEADER
================================================== */

.sheet__header {
  position: relative;

  display: flex;

  gap: 1rem;

  padding: 1.25rem 3.25rem 1.25rem 1.25rem;

  border-bottom: 1px solid var(--line);
}

.sheet__media {
  position: relative;

  flex-shrink: 0;

  width: 4.5rem;
  height: 4.5rem;

  margin: 0;

  background: var(--surface-mute);

  border-radius: var(--r-sm);

  overflow: hidden;
}

.sheet__image {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.sheet__icon {
  display: none;

  color: var(--amber-line);

  font-size: 1.1rem;
}

.sheet__media.is-fallback {
  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--amber-soft);
}

.sheet__media.is-fallback .sheet__image {
  display: none;
}

.sheet__media.is-fallback .sheet__icon {
  display: block;
}

.sheet__title {
  margin-bottom: 0.2rem;

  font-size: 1.05rem;
  font-weight: 700;

  line-height: 1.3;
}

.sheet__store {
  display: flex;
  align-items: center;

  gap: 0.35rem;

  margin-bottom: 0.3rem;

  color: var(--amber-dark);

  font-size: 0.72rem;
  font-weight: 600;
}

.sheet__description {
  margin: 0;

  font-size: 0.75rem;

  line-height: 1.5;
}

.sheet__close {
  position: absolute;

  top: 1rem;
  right: 1rem;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 2rem;
  height: 2rem;

  background: var(--surface-alt);

  border-radius: 50%;

  color: var(--muted);

  font-size: 0.85rem;

  transition:
    background-color var(--t),
    color var(--t);
}

.sheet__close:hover {
  background: var(--surface-mute);
  color: var(--ink);
}

/* ==================================================
   BODY
================================================== */

.sheet__body {
  max-height: 45vh;

  padding: 1.25rem;

  overflow-y: auto;

  overscroll-behavior: contain;
}

.sheet__field {
  margin-bottom: 1.15rem;
}

.sheet__field:last-child {
  margin-bottom: 0;
}

.sheet__label {
  display: block;

  margin-bottom: 0.5rem;

  font-size: 0.82rem;
  font-weight: 600;
}

.sheet__hint {
  display: block;

  margin-top: 0.4rem;

  color: var(--faint);

  font-size: 0.7rem;

  line-height: 1.5;
}

.sheet__qty {
  display: flex;
  align-items: center;

  gap: 1rem;
}

.sheet__textarea,
.sheet__input {
  width: 100%;

  padding: 0.7rem 0.85rem;

  background: var(--surface-alt);

  border: 1px solid var(--line);
  border-radius: var(--r-sm);

  font-size: 0.85rem;

  resize: vertical;
}

.sheet__textarea {
  min-height: 4.5rem;
}

.sheet__textarea::placeholder,
.sheet__input::placeholder {
  color: var(--faint);
}

/* ==================================================
   FOOTER
================================================== */

.sheet__footer {
  display: flex;
  align-items: center;

  gap: 1rem;

  padding: 1rem 1.25rem;

  background: var(--surface-alt);

  border-top: 1px solid var(--line);
}

.sheet__total {
  flex-shrink: 0;
}

.sheet__total span {
  display: block;

  color: var(--faint);

  font-size: 0.65rem;
  font-weight: 700;

  letter-spacing: 0.06em;

  text-transform: uppercase;
}

.sheet__total strong {
  font-size: 1.05rem;
  font-weight: 800;

  font-variant-numeric: tabular-nums;
}

.sheet__footer .btn {
  flex: 1;
}

/* ==================================================
   DIALOG ALAMAT
================================================== */

.address-dialog__body {
  padding: 1.25rem;
}

.address-dialog__title {
  margin-bottom: 0.35rem;

  font-size: 1.05rem;
}

.address-dialog__lead {
  margin-bottom: 1.15rem;

  font-size: 0.8rem;

  line-height: 1.55;
}

.address-dialog__status {
  display: block;

  min-height: 1.2rem;

  margin-top: 0.5rem;

  color: var(--amber-dark);

  font-size: 0.72rem;

  line-height: 1.5;
}

.address-dialog__actions {
  display: grid;

  gap: 0.6rem;

  margin-top: 1.15rem;
}

/* ==================================================
   MOBILE
   768px
================================================== */

@media (max-width: 768px) {
  .sheet,
  .address-dialog {
    width: 100%;
    max-width: 100%;

    margin: auto auto 0;

    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }

  .sheet__footer {
    flex-direction: column;

    align-items: stretch;
  }

  .sheet__footer .btn {
    width: 100%;
  }
}
