/* Custom brand color utilities */
.bg-espresso {
  background-color: #1b1a17 !important;
}
.bg-espresso-light {
  background-color: #252320 !important;
}
.bg-charcoal {
  background-color: #54575a !important;
}
.bg-deshojo {
  background-color: #ff4040 !important;
}
.bg-cream {
  background-color: #f6f1eb !important;
}
.bg-coffee-brown {
  background-color: #4a2f27 !important;
}
.bg-moss {
  background-color: #78866b !important;
}

.text-espresso {
  color: #1b1a17 !important;
}
.text-charcoal {
  color: #54575a !important;
}
.text-deshojo {
  color: #ff4040 !important;
}
.text-cream {
  color: #f6f1eb !important;
}
.text-coffee-brown {
  color: #4a2f27 !important;
}
.text-moss {
  color: #78866b !important;
}

.border-espresso {
  border-color: #1b1a17 !important;
}
.border-charcoal {
  border-color: #54575a !important;
}
.border-deshojo {
  border-color: #ff4040 !important;
}
.border-cream {
  border-color: #f6f1eb !important;
}
.border-coffee-brown {
  border-color: #4a2f27 !important;
}
.border-l-coffee-brown {
  border-left-color: #4a2f27 !important;
}
.border-moss {
  border-color: #78866b !important;
}

/* Brand color opacity variants */
.bg-espresso-light\/80 {
  background-color: rgb(37 35 32 / 0.8) !important;
}
.bg-deshojo\/20 {
  background-color: rgb(255 64 64 / 0.2) !important;
}
.bg-moss\/20 {
  background-color: rgb(120 134 107 / 0.2) !important;
}

.text-cream\/70 {
  color: rgb(246 241 235 / 0.7) !important;
}
.text-cream\/85 {
  color: rgb(246 241 235 / 0.85) !important;
}
.text-cream\/50 {
  color: rgb(246 241 235 / 0.5) !important;
}

.border-cream\/10 {
  border-color: rgb(246 241 235 / 0.1) !important;
}
.border-cream\/20 {
  border-color: rgb(246 241 235 / 0.2) !important;
}
.border-cream\/30 {
  border-color: rgb(246 241 235 / 0.3) !important;
}

/* Focus variants */
.focus\:ring-deshojo:focus {
  --tw-ring-color: #ff4040 !important;
}
.focus\:ring-coffee-brown:focus {
  --tw-ring-color: #4a2f27 !important;
}
.focus\:ring-coffee-brown\/20:focus {
  --tw-ring-color: rgb(74 47 39 / 0.2) !important;
}
.focus\:border-coffee-brown:focus {
  border-color: #4a2f27 !important;
}
.peer:checked ~ .peer-checked\:border-coffee-brown {
  border-color: #4a2f27 !important;
}
.peer:checked ~ .peer-checked\:bg-gray-50 {
  background-color: #fafafa !important;
}

/* Border radius brand values */
.rounded-brand {
  border-radius: 6px !important;
}
.rounded-card {
  border-radius: 8px !important;
}

:root {
  --color-espresso: #1b1a17;
  --color-espresso-light: #252320;
  --color-charcoal: #54575a;
  --color-deshojo: #ff4040;
  --color-cream: #f6f1eb;
  --color-coffee-brown: #4a2f27;
  --color-moss: #78866b;

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: Inter, system-ui, sans-serif;

  --radius-brand: 6px;
  --radius-card: 8px;
}

.journal-entry__hero {
  box-sizing: border-box;
  width: 100%;
  max-width: 810px;
  margin-inline: auto;
  padding-inline: 1rem;
}

.journal-entry__hero-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 440px;
  margin-inline: auto;
  border-radius: var(--radius-card);
}

@media (min-width: 640px) {
  .journal-entry__hero {
    padding-inline: 1.5rem;
  }

  .journal-entry__hero-image {
    max-height: 480px;
  }
}

@media (min-width: 900px) {
  .journal-entry__hero {
    max-width: 760px;
    padding-inline: 0;
  }

  .journal-entry__hero-image {
    max-height: 480px;
  }
}

@layer base {
  html {
    font-family: var(--font-sans);
  }

  body {
    font-family: var(--font-sans);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-serif);
  }

  p {
  }

  small,
  .meta {
    font-size: 0.875rem;
  }
}

.checkout-cart-thumb {
  width: 10rem;
  height: 10rem;
  min-width: 10rem;
  max-width: 10rem;
  min-height: 10rem;
  max-height: 10rem;
  aspect-ratio: 1 / 1;
}

@media (min-width: 640px) {
  .checkout-cart-thumb {
    width: 6rem;
    height: 6rem;
    min-width: 6rem;
    max-width: 6rem;
    min-height: 6rem;
    max-height: 6rem;
  }
}

.checkout-cart-thumb-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  display: block;
}

.storefront-gallery-frame {
  min-height: 300px;
}

@media (min-width: 640px) {
  .storefront-gallery-frame {
    min-height: 420px;
  }
}

@media (min-width: 1280px) {
  .storefront-gallery-frame {
    aspect-ratio: 4 / 3;
    align-self: flex-start;
    min-height: 0;
  }
}

.bagging-sheet-print-only {
  display: none;
}

@media print {
  nav,
  .bagging-sheet-print-hidden {
    display: none !important;
  }

  body {
    background: #ffffff !important;
  }

  main {
    max-width: none !important;
    padding: 0 !important;
  }

  .bagging-sheet {
    color: #111827 !important;
  }

  .bagging-sheet-print-only {
    display: block !important;
  }

  .bagging-sheet-card {
    break-inside: avoid;
    box-shadow: none !important;
  }

  .bagging-sheet table {
    break-inside: auto;
  }

  .bagging-sheet tr {
    break-inside: avoid;
  }

  .bagging-sheet a[href]::after {
    content: "" !important;
  }
}

.pagy.series-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pagy.series-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-brand);
  background-color: #ffffff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pagy.series-nav a[href]:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
  color: #111827;
}

.pagy.series-nav a[href]:focus-visible {
  outline: 2px solid var(--color-coffee-brown);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(74 47 39 / 0.18);
}

.pagy.series-nav a[aria-current="page"] {
  border-color: var(--color-coffee-brown);
  background-color: var(--color-coffee-brown);
  color: #ffffff;
  cursor: default;
}

.pagy.series-nav a[aria-disabled="true"]:not([aria-current="page"]) {
  border-color: #e5e7eb;
  background-color: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

.orders-results-anchor {
  scroll-margin-top: 1.5rem;
}

/* Gift action dialogs intentionally use explicit sizing and positioning so
   native dialog defaults cannot make them feel like a full-screen sheet. */
.gift-action-dialog {
  position: fixed;
  inset: 0;
  width: min(30rem, calc(100vw - 2rem));
  max-width: 30rem;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-cream);
  color: var(--color-charcoal);
  box-shadow:
    0 30px 70px rgb(0 0 0 / 0.28),
    0 0 0 1px rgb(255 255 255 / 0.7);
}

.gift-action-dialog::backdrop {
  background: rgb(0 0 0 / 0.52);
  backdrop-filter: blur(4px);
}

.gift-action-dialog:focus {
  outline: none;
}

.gift-action-dialog button:focus-visible {
  outline: 2px solid var(--color-coffee-brown);
  outline-offset: 3px;
}

@media (max-width: 639px) {
  .pagy.series-nav {
    gap: 0.375rem;
  }

  .pagy.series-nav a {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
  }
}



@layer components {
  /* Buttons - Hero CTAs (high contrast over imagery) */
  .btn-hero-primary,
  .btn-hero-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.6rem 1.1rem !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: inherit !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    background-color: transparent !important;
    color: #f6f1eb !important;
    border: 1px solid #f6f1eb !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    white-space: nowrap !important;
  }

  @media (min-width: 360px) {
    .btn-hero-primary,
    .btn-hero-secondary {
      padding: 0.65rem 1.25rem !important;
    }
  }

  @media (min-width: 640px) {
    .btn-hero-primary,
    .btn-hero-secondary {
      padding: 0.75rem 1.5rem !important;
    }
  }

  #home-hero-ctas a.btn-hero-primary,
  #home-hero-ctas a.btn-hero-secondary {
    padding: 0.6rem 1.1rem !important;
    font-weight: 500 !important;
    border: 1px solid #f6f1eb !important;
  }

  @media (min-width: 360px) {
    #home-hero-ctas a.btn-hero-primary,
    #home-hero-ctas a.btn-hero-secondary {
      padding: 0.65rem 1.25rem !important;
    }
  }

  @media (min-width: 640px) {
    #home-hero-ctas a.btn-hero-primary,
    #home-hero-ctas a.btn-hero-secondary {
      padding: 0.75rem 1.5rem !important;
    }
  }

  .btn-hero-primary:hover,
  .btn-hero-secondary:hover {
    transform: translateY(-2px) !important;
    background-color: #f6f1eb !important;
    border-color: #f6f1eb !important;
    color: #1b1a17 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35) !important;
  }

  .btn-hero-primary:active,
  .btn-hero-secondary:active {
    transform: scale(0.98) !important;
    background-color: #f6f1eb !important;
    border-color: #f6f1eb !important;
    color: #1b1a17 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }

  .btn-hero-primary:focus-visible,
  .btn-hero-secondary:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 3px !important;
  }

  /* Header Logo - make wordmark less wispy on larger screens */
  @media (min-width: 768px) {
    .acer-wordmark path {
      stroke: currentColor;
      stroke-width: 1.25px;
      vector-effect: non-scaling-stroke;
      paint-order: stroke fill;
      stroke-linejoin: round;
      stroke-linecap: round;
    }

    .acer-wordmark path[fill="#b91819"] {
      stroke: #b91819;
    }
  }

  /* Buttons - Light Theme */
  .btn-primary {
    display: inline-block;
    background-color: #ff4040 !important;
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid #ff4040 !important;
  }

  .btn-primary:hover {
    background-color: rgb(255 64 64 / 0.9) !important;
    border-color: rgb(255 64 64 / 0.9) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 64, 64, 0.3);
  }

  .btn-secondary {
    display: inline-block;
    background-color: #4a2f27 !important;
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    border: 2px solid #4a2f27 !important;
  }

  .btn-secondary:hover {
    background-color: rgb(74 47 39 / 0.9) !important;
    border-color: rgb(74 47 39 / 0.9) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 47, 39, 0.3);
  }

  .btn-tertiary {
    display: inline-block;
    background-color: transparent;
    border: 2px solid #ff4040 !important;
    color: #ff4040 !important;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
  }

  .btn-tertiary:hover {
    background-color: #ff4040 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 64, 64, 0.3);
  }

  /* Cards */
  .card {
    background-color: white;
    border: 1px solid rgb(229 231 235);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    transition: box-shadow 0.2s;
  }

  .card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  }

  .card-elevated {
    background-color: white;
    border: 1px solid rgb(229 231 235);
    border-radius: var(--radius-card);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  }

  /* Inputs */
  .input-field {
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: white;
    border: 2px solid rgb(209 213 219);
    border-radius: var(--radius-brand);
    color: rgb(17 24 39);
    transition: all 0.2s;
  }

  .input-field::placeholder {
    color: rgb(107 114 128);
  }

  .input-field:focus {
    outline: none;
    border-color: rgb(17 24 39);
    box-shadow: 0 0 0 2px rgb(17 24 39 / 0.1);
  }

  /* Navigation Links */
  .nav-link {
    position: relative;
    display: inline-block;
    color: var(--color-charcoal);
    font-family: var(--font-sans);
    text-transform: none;
    letter-spacing: 0.025em;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1;
    padding-bottom: 0.55rem;
    transition: color 0.2s, transform 0.2s;
    text-decoration: none;
  }

  .nav-link::after {
    content: "";
    position: absolute;
    left: 0.2em;
    right: 0.2em;
    bottom: 0.1rem;
    height: 1px;
    background-color: var(--color-deshojo);
    border-radius: 9999px;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .nav-link:hover {
    color: var(--color-deshojo);
    transform: translateY(-1px);
  }

  .nav-link:hover::after {
    opacity: 0.65;
  }

  .nav-link--active {
    color: var(--color-deshojo);
  }

  .nav-link--active::after {
    height: 2px;
    opacity: 1;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  }

  /* Mobile nav: keep spacing and readability */
  .nav-link--mobile {
    display: block;
    padding-bottom: 0;
  }
}

@layer utilities {
  /* Background Colors */
  .bg-espresso {
    background-color: var(--color-espresso);
  }
  .bg-espresso-light {
    background-color: var(--color-espresso-light);
  }
  .bg-charcoal {
    background-color: var(--color-charcoal);
  }
  .bg-deshojo {
    background-color: var(--color-deshojo);
  }
  .bg-cream {
    background-color: var(--color-cream);
  }
  .bg-coffee-brown {
    background-color: var(--color-coffee-brown);
  }
  .bg-moss {
    background-color: var(--color-moss);
  }

  /* Text Colors */
  .text-espresso {
    color: var(--color-espresso);
  }
  .text-charcoal {
    color: var(--color-charcoal);
  }
  .text-deshojo {
    color: var(--color-deshojo);
  }
  .text-cream {
    color: var(--color-cream);
  }
  .text-coffee-brown {
    color: var(--color-coffee-brown);
  }
  .text-moss {
    color: var(--color-moss);
  }

  /* Border Colors */
  .border-espresso {
    border-color: var(--color-espresso);
  }
  .border-charcoal {
    border-color: var(--color-charcoal);
  }
  .border-deshojo {
    border-color: var(--color-deshojo);
  }
  .border-cream {
    border-color: var(--color-cream);
  }
  .border-coffee-brown {
    border-color: var(--color-coffee-brown);
  }
  .border-l-coffee-brown {
    border-left-color: var(--color-coffee-brown);
  }
  .border-moss {
    border-color: var(--color-moss);
  }

  /* Ring Colors */
  .ring-deshojo {
    --tw-ring-color: var(--color-deshojo);
  }
  .focus\:ring-deshojo:focus {
    --tw-ring-color: var(--color-deshojo);
  }

  /* Border Radius */
  .rounded-brand {
    border-radius: var(--radius-brand);
  }
  .rounded-card {
    border-radius: var(--radius-card);
  }
}
