/* ===== Fonts ===== */
@font-face {
  font-family: 'Dodder';
  src: url('fonts/Dodder.ttf') format('truetype');
  font-display: swap;
}

/* ===== Design Tokens ===== */
:root {
  --color-bg: #FCF6EF;
  --color-brown: #863B1F;
  --color-blue: #3F52A3;
  --color-white: #FBF9F7;
  --font-heading: 'Dodder', cursive;
  --font-body: 'Courier Prime', monospace;
  --spacing-page-padding: 16px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-brown);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-brown);
}

/* ===== Page Container ===== */
.page {
  width: 100%;
  max-width: 696px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 32px;
}

/* ===== Hero Section ===== */
.hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0;
  margin-bottom: 80px;
}

.hero__logo-container {
  position: relative;
  width: 100%;
  max-width: 695px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__logo-icon {
  width: 270px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  height: auto;
}

.hero__logo-text {
  width: 620px;
  max-width: 100%;
  height: auto;
}

.hero__tagline {
  font-family: var(--font-heading);
  font-size: 26px;
  text-align: center;
  line-height: 1.1;
  margin-top: 8px;
  width: 380px;
  max-width: 100%;
}

.highlight {
  color: var(--color-blue);
}

/* ===== Intro Section ===== */
.intro {
  width: 100%;
  text-align: left;
  padding: 10px var(--spacing-page-padding);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 80px;
}

.intro p {
  line-height: 1.5;
}

/* ===== Order Info Section ===== */
.order-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 80px;
}

.order-info__title {
  font-family: var(--font-heading);
  font-size: 44px;
  color: var(--color-brown);
  padding: 0 var(--spacing-page-padding);
  margin-bottom: 16px;
}

.order-info__grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.order-info__block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 0 16px;
}

.order-info__label {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-brown);
  margin-bottom: 4px;
  line-height: 1.2;
}

.order-info__value {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--color-blue);
  line-height: 1.1;
}

.order-info__value--small {
  font-size: 18px;
  /* Slightly smaller for longer text like location */
}

/* ===== Menu Section ===== */
.menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu__title {
  font-family: var(--font-heading);
  font-size: 44px;
  color: var(--color-brown);
  padding: 0 var(--spacing-page-padding);
}

/* ===== Product Grid ===== */
.product-grid {
  width: 100%;
  border: 2px solid var(--color-brown);
  display: flex;
  flex-direction: column;
}

.product-grid--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.product-grid__loading-text {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--color-brown);
  text-align: center;
  padding: 32px;
}

/* Add separator line between cards */
.product-card {
  border-bottom: 2px solid var(--color-brown);
}

.product-card:last-child {
  border-bottom: none;
}

/* ===== Product Card ===== */
.product-card {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-page-padding);
}

.product-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  position: relative;
  z-index: 1;
}

.product-card__name-group {
  display: flex;
  flex-direction: column;
}

.product-card__name-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.product-card__name {
  font-family: var(--font-heading);
  font-size: 32px;
  color: var(--color-blue);
  line-height: 1;
}

.product-card__allergens {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
}

.product-card__description {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  margin-top: 4px;
  margin-left: 4px;
}

.product-card__price {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  text-align: right;
  flex-shrink: 0;
}

.product-card__image-container {
  position: relative;
  margin: 16px auto;
  width: 100%;
  max-width: 382px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
}

.product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__quantity {
  position: absolute;
  bottom: 14px;
  right: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.product-card__qty-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.product-card__qty-btn:hover {
  transform: scale(1.3);
}

.product-card__qty-btn:active {
  transform: scale(0.95);
}

.product-card__qty-btn img {
  pointer-events: none;
}

.product-card__qty-btn--minus img {
  width: 8px;
  height: 3px;
}

.product-card__qty-btn--plus img {
  width: 14px;
  height: 14px;
}

.product-card__qty-count {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  min-width: 12px;
  text-align: center;
}

.product-card__qty-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.product-card__max-qty {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-brown);
  white-space: nowrap;
  line-height: 1.1;
}

.product-card__low-stock {
  position: absolute;
  bottom: var(--spacing-page-padding);
  left: var(--spacing-page-padding);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-brown);
  line-height: 1.1;
  z-index: 1;
}

/* Sold-out product cards: dim everything except the label */
.product-card--sold-out>*:not(.product-card__low-stock) {
  opacity: 0.3;
}

/* ===== Allergens List ===== */
.allergens {
  padding: 0 16px;
  width: 100%;
  margin-bottom: 40px;
}

.allergens p {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
}

.allergens__notice {
  margin-top: 16px;
}

/* ===== Contact section ===== */
.contact {
  width: 100%;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.contact__left {
  width: 50%;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.1;
}

.contact__right {
  width: 50%;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  text-align: right;
  line-height: 1.1;
}

.contact__right a {
  text-decoration: underline;
}

/* ===== Order Summary ===== */
#orderRecapContainer {
  width: 100%;
}

.order-summary {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.order-summary__separator {
  padding: 8px 16px;
  width: 100%;
  overflow: hidden;
}

.order-summary__separator p {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  max-height: 1.1em;
}

.order-summary__line-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 0;
}

.order-summary__item-name {
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.1;
}

.order-summary__item-dots {
  flex: 1;
  overflow: hidden;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: clip;
}

.order-summary__item-total {
  white-space: nowrap;
  text-align: right;
  flex-shrink: 0;
  line-height: 1.1;
}

.order-summary__total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 0;
  margin-bottom: 32px;
}

.order-summary__total-label {
  line-height: 1.1;
}

.order-summary__total-value {
  text-align: right;
  line-height: 1.1;
}

/* ===== Place Order Section ===== */
.place-order {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 12px;
}

.place-order__info-row {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  width: 100%;
}

.place-order__terms {
  width: 50%;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.1;
}

.place-order__terms a {
  text-decoration: underline;
}

.place-order__collection {
  width: 50%;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  text-align: right;
  line-height: 1.1;
}

.place-order__button {
  width: 100%;
  background-color: var(--color-blue);
  color: var(--color-white);
  border: none;
  padding: var(--spacing-page-padding);
  font-family: var(--font-heading);
  font-size: 32px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  line-height: 1;
  margin-bottom: 32px;
}

.place-order__button:hover:not(:disabled) {
  background-color: #4b5fb5;
}

.place-order__button:active:not(:disabled) {
  transform: scale(0.99);
}

.place-order__button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== Footer ===== */
.footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__follow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
}

.footer__follow-text {
  flex: 1;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.1;
}

.footer__social-icons {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}

.footer__social-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.footer__social-icon:hover {
  transform: scale(1.15);
}

.footer__social-icon img {
  width: 100%;
  height: 100%;
}

.footer__separator {
  padding: 0 16px;
  width: 100%;
  overflow: hidden;
}

.footer__separator p {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  max-height: 1.1em;
}

.footer__bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 0;
}

.footer__copyright {
  line-height: 1.1;
}

.footer__privacy {
  line-height: 1.1;
}

.footer__privacy a {
  text-decoration: underline;
}

/* ===== Utility: Dotted Separator ===== */
.dots-separator {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  max-height: 1.1em;
}

/* ===== Policy Page ===== */
.policy-header {
  width: 100%;
  padding: 48px var(--spacing-page-padding) 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.policy-header__title {
  font-family: var(--font-heading);
  font-size: 44px;
  color: var(--color-brown);
  line-height: 1.1;
  text-align: left;
}

.policy-header__meta {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-brown);
  opacity: 0.7;
}

.policy-separator {
  padding: 0 var(--spacing-page-padding);
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 8px;
}

.policy {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 var(--spacing-page-padding);
  margin-bottom: 32px;
}

.policy__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
}

.policy__section:not(:last-child)::after {
  content: '....................................................................................................................................................................................................................................';
  display: block;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.1;
  margin-top: 4px;
}

.policy__heading {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--color-brown);
  line-height: 1.1;
  margin-top: 8px;
}

.policy__subheading {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--color-brown);
  line-height: 1.2;
  margin-top: 8px;
}

.policy__text {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.6;
}

.policy__list {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-brown);
  line-height: 1.6;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== Mobile Responsiveness ===== */

/* Tablet & Mobile Landscape */
@media (max-width: 768px) {

  /* Add margin to the page container */
  .page {
    width: calc(100% - 32px);
  }

  /* Keep Contact and Follow Us on one line (row) if possible, 
     but ensure they fit. The user requested them to NOT be on two lines. 
     So we remove the flex-direction: column override for contact. */

  /* Place Order Info Row - User didn't complain about this, but let's keep it stacked as it has more content */
  .place-order__info-row {
    flex-direction: column;
    gap: 16px;
  }

  /* Order Info: Stack on mobile/tablet */
  .order-info__grid {
    flex-direction: column;
    gap: 24px;
  }

  .place-order__terms,
  .place-order__collection {
    width: 100%;
    text-align: left;
  }
}

/* Mobile Portrait */
@media (max-width: 480px) {

  /* Hero adjustments */
  .hero__logo-icon {
    width: 180px;
    /* Scale down logo */
    height: auto;
  }

  .hero__tagline {
    font-size: 20px;
    /* Smaller tagline */
    width: 100%;
    padding: 0 16px;
  }

  /* Intro Section */
  .intro {
    padding: 10px 16px;
    margin-bottom: 40px;
    /* Reduce bottom margin */
    text-align: left;
    /* Left align paragraphs */
  }

  /* Order Info Adjustments */
  .order-info__block {
    padding: 0 16px;
  }

  /* Contact Adjustments for mobile */
  .contact {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .contact__left,
  .contact__right {
    width: 100%;
    padding: 0 16px;
    text-align: left;
  }

  .contact__left {
    white-space: normal;
  }

  .contact__right {
    white-space: normal;
  }

  /* Menu & Order Info Title */
  .menu__title,
  .order-info__title {
    font-size: 32px;
    /* Smaller title */
  }

  /* Footer adjustments */
  /* Remove flex-direction: column for follow-row to keep on one line */
  .footer__follow-row {
    gap: 12px;
  }

  .footer__social-icons {
    /* Adjust width/justify if necessary to fit next to 'Follow us' */
    justify-content: flex-end;
  }

  .footer__social-icon {
    width: 16px;
    height: 16px;
  }

  .footer__bottom-row {
    /* Use column-reverse to put Privacy (2nd item) above Copyright (1st item) */
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 12px;
  }

  .footer__bottom-row span {
    line-height: 1.3;
  }

  /* Product Card adjustments */
  .product-card {
    aspect-ratio: 4/3;
    /* 4:3 aspect ratio on mobile */
  }

  .product-card__name {
    font-size: 26px;
    white-space: nowrap;
  }

  .product-card__name-row {
    flex-wrap: wrap;
  }

  .product-card__image-container {
    /* Make image slightly smaller on very small screens if needed */
    width: 150px;
    height: 150px;
  }
}