/* ==========================================================================
   FRZE — components
   Buttons, form controls, product cards, selectors, feedback states,
   overlays (drawer, dialog, toast) and accordion.
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--btn-h);
  padding: 0 var(--s-6);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-hover); }

.btn--secondary { background: #fff; color: var(--c-primary); border-color: var(--c-primary); }
.btn--secondary:hover { background: var(--c-primary); color: #fff; }

.btn--outline { background: transparent; color: var(--c-primary); border-color: var(--c-border-strong); }
.btn--outline:hover { border-color: var(--c-primary); }

.btn--light { background: #fff; color: var(--c-primary); }
.btn--light:hover { background: #ececea; }

.btn--ghost {
  min-height: auto;
  padding: var(--s-1) 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--c-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 700;
}
.btn--ghost:hover { color: var(--c-accent); }
.btn--ghost.is-danger:hover { color: var(--c-error); }

.btn--sm { --btn-h: 38px; padding-inline: var(--s-4); font-size: var(--fs-xs); }
.btn--lg { --btn-h: 56px; padding-inline: var(--s-7); font-size: var(--fs-base); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--btn-h); }

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

/* Loading state: keeps width, swaps label for a spinner */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-color: #fff #fff transparent transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.btn--secondary.is-loading::after,
.btn--outline.is-loading::after,
.btn--light.is-loading::after { border-color: var(--c-primary) var(--c-primary) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--t-base) var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Form controls ---------- */
.field { display: grid; gap: var(--s-2); min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: 700; }
.field__label .optional { font-weight: 500; color: var(--c-muted); }
.field__label .req { color: var(--c-accent); }
.field__hint { font-size: var(--fs-xs); color: var(--c-muted); }
.field__error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-error);
}
.field__error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  flex: none;
}
.newsletter .field__error::before { color: #ffb4a6; }
.field.is-invalid .field__error { display: flex; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: #fff;
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}
.textarea { min-height: 140px; padding-block: var(--s-3); resize: vertical; line-height: 1.5; }
.select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23111' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
}
.input::placeholder, .textarea::placeholder { color: #9c9c98; }
.input:hover, .select:hover, .textarea:hover { border-color: #a9a9a5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1);
}
.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea { border-color: var(--c-error); background-color: #fffafa; }
.field.is-invalid .input:focus,
.field.is-invalid .select:focus,
.field.is-invalid .textarea:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14); }
.field.is-valid .input { border-color: #8fb79a; }

.input-group { display: flex; }
.input-group__addon {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--s-3);
  border: 1px solid var(--c-border-strong);
  border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--c-bg-alt);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.input-group .input { border-radius: 0 var(--r-md) var(--r-md) 0; }

.char-count { font-size: var(--fs-xs); color: var(--c-muted); justify-self: end; }

/* Checkbox */
.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 32px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.check input {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
}
.check__box {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--c-border-strong);
  border-radius: 5px;
  background: #fff;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.check input:checked + .check__box {
  border-color: var(--c-primary);
  background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.check input:focus-visible + .check__box { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.check:hover .check__box { border-color: var(--c-primary); }
.check__count { margin-left: auto; color: var(--c-muted); font-weight: 500; font-size: var(--fs-xs); }

/* Payment / option cards (radio) */
.option-cards { display: grid; gap: var(--s-3); }
.option-card {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: start;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.option-card:hover { border-color: #a9a9a5; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card__radio {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid var(--c-border-strong);
  border-radius: 50%;
  background: #fff;
  transition: border var(--t-fast);
}
.option-card__title { display: block; font-weight: 700; font-size: var(--fs-sm); }
.option-card__desc { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--c-muted); }
.option-card__icons { display: flex; gap: 4px; color: var(--c-muted); }
.option-card__icons svg { width: 22px; height: 22px; }
.option-card:has(input:checked) {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 1px var(--c-primary);
  background: #fcfcfb;
}
.option-card:has(input:checked) .option-card__radio { border: 6px solid var(--c-primary); }
.option-card:has(input:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.option-cards.is-invalid .option-card { border-color: var(--c-error); }

/* Dual range slider (price) */
.range {
  position: relative;
  height: 28px;
  margin-top: var(--s-2);
}
.range__track,
.range__fill {
  position: absolute;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: var(--r-pill);
}
.range__track { left: 0; right: 0; background: var(--c-border); }
.range__fill { background: var(--c-primary); }
.range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--c-primary);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--c-primary);
  cursor: grab;
}
.range input[type="range"]::-moz-range-track { background: none; }
.range input[type="range"]:focus-visible { outline: none; }
.range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.2); }
.range input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.2); }
.range-values { display: flex; justify-content: space-between; margin-top: var(--s-2); font-size: var(--fs-sm); font-weight: 700; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: 0 var(--s-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  background: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.chip:hover { border-color: var(--c-primary); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.chip svg { width: 14px; height: 14px; }
.chip--removable { background: var(--c-bg-alt); border-color: transparent; padding-right: var(--s-3); }
.chip--removable:hover { border-color: var(--c-primary); }

/* ---------- Size pills ---------- */
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: var(--s-2); }
.size-pill {
  position: relative;
  min-height: 48px;
  padding: 0 var(--s-2);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}
.size-pill:hover:not(:disabled) { border-color: var(--c-primary); }
.size-pill[aria-pressed="true"],
.size-pill[aria-checked="true"] { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.size-pill:disabled {
  cursor: not-allowed;
  color: #b3b3af;
  background: linear-gradient(to top left, transparent calc(50% - 0.5px), #d6d6d2 50%, transparent calc(50% + 0.5px)) #fafaf9;
}
.size-pill--sm { min-height: 36px; font-size: var(--fs-xs); }

/* Radio-based variant (product page): <label class="size-pill"><input class="size-radio">… */
label.size-pill { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.size-radio, .color-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.size-pill:has(.size-radio:checked) { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.size-pill:has(.size-radio:focus-visible),
.color-option:has(.color-radio:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.size-pill:has(.size-radio:disabled) {
  cursor: not-allowed;
  color: #b3b3af;
  border-color: var(--c-border);
  background: linear-gradient(to top left, transparent calc(50% - 0.5px), #d6d6d2 50%, transparent calc(50% + 0.5px)) #fafaf9;
}
.size-pill:has(.size-radio:disabled):hover { border-color: var(--c-border); }
.sizes.is-invalid .size-pill:not(:disabled) { border-color: var(--c-error); }
.sizes.is-shake { animation: shake 400ms var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ---------- Colour swatches ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--c-border-strong);
  border-radius: 50%;
  background: var(--sw, #ddd);
  cursor: pointer;
  transition: box-shadow var(--t-fast);
}
.swatch::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color var(--t-fast);
}
.swatch:hover::after { border-color: var(--c-border-strong); }
.swatch[aria-pressed="true"]::after,
.swatch[aria-checked="true"]::after { border-color: var(--c-primary); }
.swatch--sm { width: 18px; height: 18px; }
.swatch--sm::after { inset: -4px; border-width: 1.5px; }
.swatch-more { font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); align-self: center; }

/* PDP colour options show a thumbnail of the colourway */
.color-options { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.color-option {
  position: relative;
  display: block;
  cursor: pointer;
  width: 64px;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-bg-alt);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.color-option img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.color-option:hover { border-color: var(--c-border-strong); }
.color-option[aria-checked="true"],
.color-option:has(.color-radio:checked) { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary); }

/* ---------- Quantity stepper ---------- */
.qty {
  display: inline-grid;
  grid-template-columns: 40px 44px 40px;
  align-items: center;
  height: 48px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-pill);
  background: #fff;
}
.qty--sm { grid-template-columns: 34px 34px 34px; height: 38px; }
.qty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 0;
  background: none;
  border-radius: var(--r-pill);
  color: var(--c-primary);
}
.qty button:hover:not(:disabled) { background: var(--c-bg-alt); }
.qty button:disabled { color: #c2c2bf; cursor: not-allowed; }
.qty button svg { width: 16px; height: 16px; }
.qty input,
.qty output {
  width: 100%;
  height: 100%;
  border: 0;
  background: none;
  text-align: center;
  font-weight: 800;
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Badges & price ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--s-2);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--c-primary);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.badge--dark { background: var(--c-primary); color: #fff; }
.badge--accent { background: var(--c-accent); color: #fff; }
.badge--muted { background: #ececea; color: var(--c-muted); box-shadow: none; }

.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); }
.price__now { font-weight: 800; color: var(--c-primary); }
.price__mrp { color: var(--c-muted); text-decoration: line-through; font-size: 0.875em; font-weight: 500; }
.price__off { color: var(--c-accent); font-weight: 800; font-size: 0.875em; }

/* ---------- Product card ---------- */
.p-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.p-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-bg-alt);
}
.p-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 400ms var(--ease), transform 700ms var(--ease);
}
.p-card__img-alt { opacity: 0; }
.p-card:hover .p-card__media img { transform: scale(1.03); }
.p-card.has-alt:hover .p-card__img-alt { opacity: 1; }
.p-card__badges { position: absolute; top: var(--s-3); left: var(--s-3); z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); }

.wish-btn {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease), color var(--t-fast);
}
.wish-btn:hover { transform: scale(1.08); }
.wish-btn svg { width: 18px; height: 18px; }
.wish-btn[aria-pressed="true"] { color: var(--c-accent); }
.wish-btn[aria-pressed="true"] svg { fill: currentColor; }
.wish-btn.is-pop { animation: pop 380ms var(--ease); }
@keyframes pop { 50% { transform: scale(1.25); } }

.quick-add-btn {
  position: absolute;
  right: var(--s-2);
  bottom: var(--s-2);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 38px;
  width: 38px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--c-primary);
  font-size: var(--fs-xs);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--t-fast), color var(--t-fast), opacity var(--t-base), transform var(--t-base) var(--ease);
}
.quick-add-btn svg { width: 18px; height: 18px; }
.quick-add-btn:hover { background: var(--c-primary); color: #fff; }
.quick-add-btn__label { display: none; }

.quick-add {
  position: absolute;
  left: var(--s-2);
  right: var(--s-2);
  bottom: var(--s-2);
  z-index: 4;
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility 0s linear var(--t-base);
}
.quick-add.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease), visibility 0s; }
.quick-add__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-2); font-size: var(--fs-xs); font-weight: 800; }
.quick-add__close { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; display: inline-flex; align-items: center; justify-content: center; }
.quick-add__close:hover { background: var(--c-bg-alt); }
.quick-add__close svg { width: 14px; height: 14px; }
.quick-add .sizes { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }

.p-card__body { display: grid; gap: 2px; padding-top: var(--s-3); }
.p-card__brand { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted); }
.p-card__name {
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  color: var(--c-text);
}
.p-card__name::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.p-card__name:focus-visible { outline: none; }
.p-card:has(.p-card__name:focus-visible) .p-card__media { outline: 2px solid var(--c-primary); outline-offset: 3px; }
.p-card__meta { font-size: var(--fs-xs); color: var(--c-muted); }
.p-card__price { margin-top: 2px; font-size: var(--fs-sm); }
.p-card__swatches { position: relative; z-index: 2; display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }

/* ---------- Notices, empty & loading states ---------- */
.notice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg-alt);
  font-size: var(--fs-sm);
}
.notice svg { width: 20px; height: 20px; margin-top: 1px; }
.notice strong { display: block; }
.notice p + p { margin-top: var(--s-2); }
.notice--success { background: var(--c-success-soft); border-color: #cfe3d4; }
.notice--success svg { color: var(--c-success); }
.notice--error { background: var(--c-error-soft); border-color: #f5c9c4; }
.notice--error svg { color: var(--c-error); }
.notice--info { background: var(--c-warning-soft); border-color: #efe0b8; }
.notice__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); }

.form-note { font-size: var(--fs-xs); color: var(--c-muted); }

.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-4);
  text-align: center;
  border: 1px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
}
.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--c-bg-alt);
}
.empty-state__icon svg { width: 30px; height: 30px; }
.empty-state h2, .empty-state h3 { font-size: var(--fs-lg); }
.empty-state p { max-width: 28rem; color: var(--c-muted); }
.empty-state .btn { margin-top: var(--s-3); }

.skeleton {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, #f1f1ef 25%, #e8e8e5 37%, #f1f1ef 63%) 0 0 / 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skeleton--card { aspect-ratio: 4 / 5; }
.skeleton--line { height: 12px; margin-top: var(--s-3); border-radius: var(--r-pill); }
.skeleton--line.short { width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Image fallback when a photo fails to load */
.img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  background: var(--c-bg-alt);
  color: #a3a3a0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.img-fallback svg { width: 40%; max-width: 120px; height: auto; }
img.is-broken { opacity: 0 !important; }

/* ---------- Overlay, drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--c-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility 0s linear var(--t-base);
}
.overlay.is-open { opacity: 1; visibility: visible; transition: opacity var(--t-base) var(--ease), visibility 0s; }

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 85;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: var(--shadow-lg);
  visibility: hidden;
  transition: transform 320ms var(--ease), visibility 0s linear 320ms;
}
.drawer--left { left: 0; transform: translateX(-100%); }
.drawer--right { right: 0; transform: translateX(100%); }
.drawer.is-open { transform: none; visibility: visible; transition: transform 320ms var(--ease), visibility 0s; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: var(--header-h);
  padding: 0 var(--s-4) 0 var(--s-5);
  border-bottom: 1px solid var(--c-border);
}
.drawer__title { font-size: var(--fs-md); font-weight: 800; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--s-5); overscroll-behavior: contain; }
.drawer__foot { display: flex; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--c-border); }
.drawer__foot .btn { flex: 1; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  color: var(--c-text);
}
.dialog--wide { width: min(760px, calc(100vw - 2rem)); }
.dialog::backdrop { background: var(--c-overlay); }
.dialog[open] { animation: dialog-in 260ms var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.dialog__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-border);
  background: #fff;
}
.dialog__head h2 { font-size: var(--fs-md); }
.dialog__body { padding: var(--s-5); }
.dialog__body > * + * { margin-top: var(--s-4); }
.dialog__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-3); padding: 0 var(--s-5) var(--s-5); }

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed;
  left: var(--s-3);
  right: var(--s-3);
  bottom: var(--s-3);
  z-index: 120;
  display: grid;
  gap: var(--s-2);
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--c-primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  pointer-events: auto;
  animation: toast-in 300ms var(--ease);
}
.toast.is-leaving { animation: toast-out 220ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.toast__icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: #2b2b2b; }
.toast__icon svg { width: 14px; height: 14px; }
.toast--success .toast__icon { background: var(--c-success); }
.toast--error .toast__icon { background: var(--c-error); }
.toast__thumb { width: 44px; height: 55px; border-radius: var(--r-sm); object-fit: cover; background: #2b2b2b; }
.toast__text strong { display: block; font-weight: 800; }
.toast__text span { display: block; color: #c9c9c5; font-size: var(--fs-xs); margin-top: 1px; }
.toast__actions { display: flex; align-items: center; gap: var(--s-1); }
.toast__action { color: #fff; font-weight: 800; font-size: var(--fs-xs); padding: var(--s-2); white-space: nowrap; }
.toast__close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: #c9c9c5; display: inline-flex; align-items: center; justify-content: center; }
.toast__close:hover { background: #2b2b2b; color: #fff; }
.toast__close svg { width: 14px; height: 14px; }
.toast :focus-visible { outline-color: #fff; }

/* ---------- Accordion ---------- */
.accordion { border-top: 1px solid var(--c-border); }
.accordion__item { border-bottom: 1px solid var(--c-border); }
.accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: 100%;
  min-height: 60px;
  padding: var(--s-4) 0;
  border: 0;
  background: none;
  text-align: left;
  font-size: var(--fs-base);
  font-weight: 700;
}
.accordion__trigger:hover { color: var(--c-accent); }
.accordion__icon {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
}
.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t-base) var(--ease);
}
.accordion__icon::after { transform: rotate(90deg); }
.accordion__trigger[aria-expanded="true"] .accordion__icon::after { transform: rotate(0deg); }
.accordion__panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 300ms var(--ease), visibility 0s linear 300ms;
}
.accordion__panel.is-open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 300ms var(--ease), visibility 0s;
}
.accordion__inner { overflow: hidden; }
.accordion__content { padding-bottom: var(--s-5); color: #3b3b3b; font-size: var(--fs-sm); line-height: 1.7; }
.accordion__content > * + * { margin-top: var(--s-3); }
.accordion__content ul { padding-left: 1.2rem; }

/* ---------- Size guide table ---------- */
.size-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); text-align: center; }
.size-table th, .size-table td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--c-border); }
.size-table thead th { background: var(--c-bg-alt); font-weight: 800; }
.size-table tbody th { font-weight: 800; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--c-border); border: 0; margin: var(--s-6) 0; }
.pill-note {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--c-bg-alt);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.pill-note svg { width: 14px; height: 14px; }
