/* ==========================================================================
   The Vespertines Storefront Styles (Scoped to .store-shell & .store-dialog)
   ========================================================================== */

.store-shell {
  font-family: 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #262626;
  max-width: 1120px;
  margin: 0.5rem auto 4rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.store-shell *,
.store-shell *::before,
.store-shell *::after,
.store-dialog *,
.store-dialog *::before,
.store-dialog *::after {
  box-sizing: border-box;
}

.store-shell p,
.store-dialog p {
  font-family: 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.store-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid #e6e6e6;
}

.store-title {
  font-family: 'Inika', Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.2;
}

.store-subtitle {
  color: #666;
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.store-cart-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #1a1a1a;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font-family: 'Muli', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.store-cart-trigger:hover {
  background: #333;
}

.store-cart-trigger:focus-visible,
.store-btn:focus-visible,
.store-chip:focus-visible,
.store-icon-btn:focus-visible,
.store-card-btn:focus-visible,
.store-qty-btn:focus-visible {
  outline: 2px solid #cc3433;
  outline-offset: 2px;
}

.store-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #cc3433;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Status Banners */
.store-banner {
  border-radius: 8px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.75rem;
  border: 1px solid #e0e0e0;
  background: #fafafa;
}

.store-banner[hidden] {
  display: none;
}

.store-banner--success {
  background: #f3faf5;
  border-color: #b7dfc3;
  color: #164b26;
}

.store-banner--info {
  background: #f8f8fa;
  border-color: #d6d6de;
  color: #313131;
}

.store-banner--warning {
  background: #fff9f0;
  border-color: #f0d3a8;
  color: #6b4510;
}

.store-banner--error {
  background: #fdf3f3;
  border-color: #ebc2c2;
  color: #8f1d1c;
}

.store-banner__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.store-banner__title {
  font-family: 'Inika', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: inherit;
}

.store-banner__list {
  margin: 0.65rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.store-banner__list li {
  margin-bottom: 0.25rem;
}

/* Product Grid */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1.75rem;
}

.store-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.store-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
  border-color: #d6d6d6;
}

.store-card-btn {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

.store-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f6f6f6;
  overflow: hidden;
}

.store-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.15rem;
  flex: 1 1 auto;
}

.store-card__title {
  font-family: 'Inika', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

.store-card__meta {
  font-size: 0.85rem;
  color: #6f6f6f;
}

.store-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.65rem;
}

.store-card__price {
  font-weight: 700;
  font-size: 1rem;
  color: #1a1a1a;
}

.store-card__cta {
  font-size: 0.85rem;
  font-weight: 700;
  color: #cc3433;
}

/* Loading Skeletons */
.store-skeleton {
  border-radius: 10px;
  border: 1px solid #eeeeee;
  overflow: hidden;
  background: #fff;
}

.store-skeleton__img {
  aspect-ratio: 1 / 1;
  background: linear-gradient(90deg, #f3f3f3 25%, #e8e8e8 50%, #f3f3f3 75%);
  background-size: 200% 100%;
  animation: store-shimmer 1.3s infinite linear;
}

.store-skeleton__line {
  height: 0.9rem;
  margin: 0.85rem 1rem;
  border-radius: 4px;
  background: #efefef;
}

.store-skeleton__line--short {
  width: 45%;
  margin-top: 0;
  margin-bottom: 1.1rem;
}

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

.store-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px dashed #d8d8d8;
  border-radius: 10px;
  color: #666;
}

/* Buttons & Controls */
.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: 'Muli', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.store-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.store-btn--primary {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.store-btn--primary:hover:not(:disabled) {
  background: #cc3433;
  border-color: #cc3433;
}

.store-btn--secondary {
  background: #fff;
  color: #1a1a1a;
  border-color: #c8c8c8;
}

.store-btn--secondary:hover:not(:disabled) {
  border-color: #1a1a1a;
  background: #f7f7f7;
}

.store-btn--block {
  width: 100%;
}

.store-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #333;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.store-icon-btn:hover {
  background: #f2f2f2;
  border-color: #bbb;
}

/* ==========================================================================
   Top-Layer Dialogs (Modal Product Picker & Slide-Out Cart Drawer)
   ========================================================================== */

dialog.store-dialog {
  font-family: 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #262626;
  border: 0;
  padding: 0;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog.store-dialog:modal {
  overscroll-behavior: contain;
}

dialog.store-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgb(0 0 0 / 0);
  transition-property: background-color, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

/* Product Modal Geometry */
dialog.store-modal {
  margin: auto;
  width: calc(100% - 2rem);
  max-width: 820px;
  max-height: calc(100dvh - 2rem);
  border-radius: 12px;
}

dialog.store-modal[open] {
  display: flex;
  flex-direction: column;
}

/* Cart Drawer Geometry */
dialog.store-drawer {
  margin: 0 0 0 auto;
  width: min(440px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}

dialog.store-drawer[open] {
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.store-modal {
    transform: scale(0.96);
  }
  dialog.store-drawer {
    transform: translateX(100%);
  }
}

/* Open state + Top-Layer Entry & Exit Fallback */
:is(dialog.store-dialog[open]):where(:not([data-closing])) {
  opacity: 1;
}

@starting-style {
  :is(dialog.store-dialog[open]):where(:not([data-closing])) {
    opacity: 0;
  }
}

:is(dialog.store-dialog[open]):where(:not([data-closing]))::backdrop {
  background-color: rgb(0 0 0 / 0.52);
}

@starting-style {
  :is(dialog.store-dialog[open]):where(:not([data-closing]))::backdrop {
    background-color: rgb(0 0 0 / 0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(dialog.store-modal[open]):where(:not([data-closing])) {
    transform: scale(1);
  }
  @starting-style {
    :is(dialog.store-modal[open]):where(:not([data-closing])) {
      transform: scale(0.96);
    }
  }

  :is(dialog.store-drawer[open]):where(:not([data-closing])) {
    transform: translateX(0);
  }
  @starting-style {
    :is(dialog.store-drawer[open]):where(:not([data-closing])) {
      transform: translateX(100%);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.store-dialog,
  dialog.store-dialog::backdrop {
    transition-duration: 0.1s;
  }
}

/* Product Modal Inner Layout */
.store-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid #ebebeb;
}

.store-dialog__title {
  font-family: 'Inika', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #1a1a1a;
  line-height: 1.3;
}

.store-modal__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.35rem;
  overflow-y: auto;
}

@media (max-width: 720px) {
  .store-modal__body {
    grid-template-columns: 1fr;
  }
}

.store-modal__media {
  background: #f6f6f6;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-modal__details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.store-modal__price {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
}

.store-modal__stock {
  font-size: 0.85rem;
  font-weight: 700;
}

.store-modal__stock--in {
  color: #1d6b38;
}

.store-modal__stock--out {
  color: #b42318;
}

.store-option-group__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 0.45rem;
}

.store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.store-chip {
  padding: 0.42rem 0.78rem;
  border-radius: 6px;
  border: 1px solid #d4d4d4;
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.store-chip:hover:not(:disabled) {
  border-color: #1a1a1a;
}

.store-chip[aria-pressed='true'] {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.store-chip:disabled {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}

.store-qty-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.store-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  overflow: hidden;
}

.store-qty-btn {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: #f7f7f7;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.store-qty-btn:hover:not(:disabled) {
  background: #eaeaea;
}

.store-qty-val {
  min-width: 2.2rem;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
}

/* Cart Drawer Inner Layout */
.store-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #ebebeb;
  flex-shrink: 0;
}

.store-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.store-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.store-cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.85rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

.store-cart-item__img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: #f6f6f6;
}

.store-cart-item__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
}

.store-cart-item__variant {
  font-size: 0.82rem;
  color: #666;
  margin-top: 0.1rem;
}

.store-cart-item__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.store-cart-item__price {
  font-weight: 700;
  font-size: 0.92rem;
}

.store-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #777;
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.store-link-btn:hover {
  color: #cc3433;
}

/* Shipping Estimator Form */
.store-ship-box {
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 1rem;
}

.store-ship-box__title {
  font-family: 'Inika', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #1a1a1a;
}

.store-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.store-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.store-field--full {
  grid-column: 1 / -1;
}

.store-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #444;
}

.store-field input,
.store-field select {
  width: 100%;
  padding: 0.52rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.9rem;
}

.store-field input:focus,
.store-field select:focus {
  outline: 2px solid #cc3433;
  outline-offset: 1px;
  border-color: #cc3433;
}

.store-ship-actions {
  margin-top: 0.75rem;
}

.store-rates {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.store-rate-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.88rem;
}

.store-rate-option:has(input:checked) {
  border-color: #1a1a1a;
  background: #f5f5f5;
}

.store-rate-option__left {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.store-rate-option__eta {
  display: block;
  font-size: 0.78rem;
  color: #666;
}

.store-rate-option__price {
  font-weight: 700;
  white-space: nowrap;
}

.store-error-text {
  color: #b42318;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.store-drawer__footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #ebebeb;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.store-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  color: #555;
}

.store-summary-row--total {
  font-size: 1.08rem;
  font-weight: 700;
  color: #1a1a1a;
  padding-top: 0.35rem;
  border-top: 1px solid #f0f0f0;
}

.store-note {
  font-size: 0.78rem;
  color: #777;
  text-align: center;
}

/* ==========================================================================
   Thank You Page
   ========================================================================== */

.store-thankyou {
  max-width: 660px;
  margin: 1.5rem auto 3rem;
  padding: 2rem 2.25rem;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

@media (max-width: 600px) {
  .store-thankyou {
    padding: 1.35rem 1.2rem;
  }
}

.store-thankyou__badge {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: #f3faf5;
  border: 1px solid #b7dfc3;
  color: #164b26;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
}

.store-thankyou__title {
  font-family: 'Inika', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.store-thankyou__lead {
  color: #4a4a4a;
  margin-bottom: 1.5rem;
}

.store-thankyou__box {
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
}

.store-thankyou__status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid #e6e6e6;
  font-size: 0.9rem;
  color: #555;
}

.store-thankyou__status strong {
  color: #164b26;
}

.store-thankyou__items {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.store-thankyou__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  color: #262626;
}

.store-thankyou__totals {
  border-top: 1px solid #e6e6e6;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.store-thankyou__contact {
  background: #fdf6f6;
  border: 1px solid #f0d0d0;
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
}

.store-thankyou__contact a {
  color: #cc3433;
  font-weight: 700;
  text-decoration: underline;
}

.store-thankyou__contact a:hover {
  color: #a82827;
}

.store-thankyou__actions {
  display: flex;
  justify-content: flex-start;
}

.store-thankyou__actions a {
  text-decoration: none;
}
