:root {
  /* Heron Coffee Palette */
  --espresso: #2d1b14;
  --cream: #f5e6d3;
  --cream-dark: #e8d5bf;
  --copper: #b8763a;
  --copper-hover: #9c622e;
  --teal-dark: #0c4a4a;
  --teal-light: #2b7a7a;
  --white: #ffffff;
  --error: #d94a4a;
  --gray: #8a807a;
  
  /* Fonts */
  --font-heading: 'Zilla Slab', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--cream);
  color: var(--espresso);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 900px) {
  .app-container {
    flex-direction: row;
  }
}

/* --- Hero Column --- */
.hero-column {
  background-color: var(--teal-dark);
  color: var(--cream);
  padding: 3rem 2rem;
  position: relative;
  display: flex;
  justify-content: center;
}

@media (min-width: 900px) {
  .hero-column {
    flex: 0 0 45%;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 4rem;
    overflow-y: auto;
  }
}

.hero-content {
  max-width: 480px;
  width: 100%;
}

.brand-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--copper);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(184, 118, 58, 0.5);
  padding: 0.4rem 1rem;
  border-radius: 999px;
}

h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--white);
}

@media (min-width: 900px) {
  h1 { font-size: 3.5rem; }
}

.subtitle {
  font-size: 1.125rem;
  color: rgba(245, 230, 211, 0.8);
  margin-bottom: 2.5rem;
}

.hero-image-wrapper {
  margin-bottom: 2.5rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  aspect-ratio: 3/4;
}

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

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

.perk {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--cream);
}

.perk svg {
  color: var(--copper);
}

/* --- Main Form Column --- */
.main-column {
  flex: 1;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (min-width: 900px) {
  .main-column {
    padding: 4rem;
  }
}

.order-form, #thank-you-screen, .status-card {
  width: 100%;
  max-width: 600px;
}

.status-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 2rem;
  border: 1px solid var(--cream-dark);
}

.status-card h2 {
  font-family: var(--font-heading);
  color: var(--teal-dark);
}

fieldset.form-section {
  border: none;
  margin-bottom: 3rem;
}

legend {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--espresso);
  margin-bottom: 1.25rem;
  width: 100%;
}

/* Grid Layouts */
.grid-radios {
  display: grid;
  gap: 1rem;
}

.grid-radios.cols-3 {
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 500px) {
  .grid-radios.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.form-row.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .form-row.grid-2 { grid-template-columns: 1fr 1fr; }
}

.form-row.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .form-row.grid-3 { grid-template-columns: 2fr 1fr 1fr; }
}

.span-2 {
  grid-column: span 2;
}
@media (min-width: 600px) {
  .span-2 { grid-column: span 1; }
}

.mt-3 { margin-top: 1.5rem; }

/* Radio Cards */
.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-card label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
}

.radio-card input:hover + label {
  border-color: var(--copper);
}

.radio-card input:checked + label {
  border-color: var(--copper);
  background: rgba(184, 118, 58, 0.05);
  box-shadow: 0 4px 12px rgba(184, 118, 58, 0.15);
}

.bean-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--espresso);
}

.light-bean { opacity: 0.5; }
.medium-bean { opacity: 0.8; }
.dark-bean { opacity: 1; }

.card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.4;
}

.radio-card.small-card label {
  padding: 1rem;
}

.card-price {
  font-family: var(--font-mono);
  color: var(--copper);
  margin-top: 0.5rem;
  font-weight: 700;
}

.radio-card.text-only label {
  padding: 1rem;
  font-weight: 500;
}

/* Inputs & Selects */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--espresso);
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--espresso);
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(184, 118, 58, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: #b5b0ab;
}

/* Custom Select */
.select-wrapper {
  position: relative;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

.select-wrapper::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232d1b14' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #d1c7bd;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--copper);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.toggle-label {
  font-weight: 600;
  cursor: pointer;
}

/* Paper Texture Utility */
.paper-texture {
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Order Summary Sticky Panel */
.order-summary {
  position: sticky;
  bottom: 2rem;
  margin-top: 3rem;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--cream-dark);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  z-index: 10;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--cream-dark);
}

.summary-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
}

.badge {
  background: var(--teal-light);
  color: var(--white);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.line-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.line-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.item-desc {
  display: flex;
  flex-direction: column;
}

.item-desc strong {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.item-desc span {
  font-size: 0.85rem;
  color: var(--gray);
}

.item-price {
  font-weight: 700;
}

.line-item.shipping {
  color: var(--gray);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cream-dark);
  margin-bottom: 2rem;
  font-weight: 600;
  font-size: 1.125rem;
}

.mono {
  font-family: var(--font-mono);
}

.mono.large {
  font-size: 1.5rem;
  color: var(--teal-dark);
}

/* Button */
.btn-primary {
  width: 100%;
  background: var(--copper);
  color: var(--white);
  border: none;
  padding: 1.25rem;
  font-size: 1.125rem;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--copper-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(184, 118, 58, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--gray);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-error {
  color: var(--error);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(217, 74, 74, 0.1);
  border-radius: 8px;
}

/* Receipt Screen */
.receipt-card {
  padding: 3rem 2rem;
  border-radius: 16px;
  border: 1px solid var(--cream-dark);
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.receipt-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed var(--cream-dark);
}

.receipt-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--teal-dark);
  margin-bottom: 0.5rem;
}

.receipt-body p {
  text-align: center;
  color: var(--gray);
  margin-bottom: 2rem;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--cream);
}

.receipt-item.total {
  border-bottom: none;
  border-top: 2px solid var(--cream-dark);
  margin-top: 1rem;
  padding-top: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Powered By */
#wbx-powered-by-slot {
  margin-top: 4rem;
  width: 100%;
}
