/* ---------- Cannoli Cart page ----------
   Builds on style.css tokens; only loaded by cannoli-cart.html. */

:root {
  --font-script: 'Great Vibes', 'Snell Roundhand', 'Brush Script MT', cursive;
  --muted: #4A4A4A;
  --error: #A3192B;
}

/* Section anchors land below the sticky header */
.cart-packages, .cart-estimate, .cart-inquiry { scroll-margin-top: 92px; }

.script-sub,
.script-accent {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1.2;
}

.btn-cream {
  background: var(--cream);
  color: var(--burgundy-dark);
}
.btn-cream:hover { background: var(--white); }

.btn:focus-visible,
.stepper-btn:focus-visible,
.pkg-option input:focus-visible + span {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
}
.cart-hero .btn:focus-visible { outline-color: var(--cream); }

/* ---------- Hero ---------- */
.cart-hero {
  background:
    radial-gradient(ellipse at 15% 10%, rgba(255,255,255,0.06), transparent 55%),
    var(--burgundy-dark);
  color: var(--white);
  padding: 72px 0 80px;
  overflow: hidden;
}

.cart-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.cart-hero .eyebrow { color: var(--tan); }

.cart-hero h1 {
  color: var(--white);
  font-size: clamp(40px, 6vw, 64px);
  margin-bottom: 8px;
}

.cart-hero .script-sub {
  font-size: clamp(28px, 3vw, 36px);
  text-wrap: balance;
  color: var(--tan);
  margin-bottom: 24px;
}

.cart-hero-desc {
  font-size: 17px;
  color: var(--tan-light);
  max-width: 500px;
  margin-bottom: 36px;
}

.cart-hero-image {
  position: relative;
  margin: 0;
}
.cart-hero-image::before {
  content: "";
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 1px solid rgba(232,223,211,0.45);
  border-radius: 4px;
}
.cart-hero-image {
  max-width: 420px;
  justify-self: center;
  width: 100%;
}
.cart-hero-image img {
  position: relative;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.28);
}

/* ---------- Packages ---------- */
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--tan);
  border-radius: 4px;
  padding: 40px 32px 32px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.package-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(26,26,26,0.08);
}

.package-card.is-featured {
  border: 2px solid var(--burgundy);
  box-shadow: 0 16px 32px rgba(110,30,43,0.12);
}

.package-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--burgundy);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.package-card h3 {
  font-size: 24px;
  margin-bottom: 16px;
}

.package-price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  color: var(--burgundy);
}
.package-price .amount {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
}
.package-price .unit { font-size: 15px; font-weight: 500; }

.package-fee {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.package-summary {
  color: var(--muted);
  margin: 20px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tan);
}

.package-features {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 15px;
}
.package-features li {
  position: relative;
  padding-left: 26px;
}
.package-features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--burgundy);
  border-bottom: 2px solid var(--burgundy);
  transform: rotate(-45deg);
}

.package-card .btn {
  margin-top: auto;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-body);
}
.package-card .btn-outline-dark:not(:hover) { background: transparent; }

.package-terms {
  max-width: 680px;
  margin: 40px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.package-terms-lead {
  color: var(--black);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
}

/* ---------- What's included ---------- */
.cart-included { background: var(--white); }

.included-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 40px;
  margin-top: 48px;
}
.included-grid li { text-align: center; }
.included-grid h3 { font-size: 19px; margin-bottom: 6px; }
.included-grid p { color: var(--muted); font-size: 15px; max-width: 300px; margin: 0 auto; }

.included-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: block;
  fill: none;
  stroke: var(--burgundy);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Estimator ---------- */
.cart-estimate { background: var(--tan-light); }

.estimator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(26,26,26,0.06);
  max-width: 920px;
  margin: 0 auto;
}

.estimator-inputs { padding: 40px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--tan);
  border-radius: 2px;
  background: var(--cream);
  max-width: 240px;
}
.stepper:focus-within { border-color: var(--burgundy); }
.stepper input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  padding: 10px 4px;
  color: var(--black);
  -moz-appearance: textfield;
}
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  width: 52px;
  border: none;
  background: transparent;
  color: var(--burgundy);
  font-size: 24px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.stepper-btn:hover { background: var(--tan-light); }

.field-hint {
  font-size: 13px;
  color: #6A6A6A;
  margin-top: 8px;
}

.pkg-fieldset {
  border: none;
  margin-top: 28px;
}
.pkg-fieldset legend { padding: 0; }

.pkg-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pkg-option { display: block; cursor: pointer; }
.pkg-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.pkg-option span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--tan);
  border-radius: 2px;
  background: var(--cream);
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pkg-option small {
  font-size: 13px;
  font-weight: 500;
  color: var(--burgundy);
  white-space: nowrap;
}
.pkg-option:hover span { border-color: var(--burgundy); }
.pkg-option input:checked + span {
  border-color: var(--burgundy);
  background: var(--burgundy);
  color: var(--white);
}
.pkg-option input:checked + span small { color: var(--tan-light); }

.estimator-result {
  background: var(--black);
  color: var(--tan-light);
  padding: 40px;
  display: flex;
  flex-direction: column;
}

.est-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tan);
  font-weight: 600;
}
.est-total {
  font-family: var(--font-heading);
  font-size: clamp(44px, 6vw, 56px);
  color: var(--white);
  line-height: 1.1;
  margin: 6px 0 24px;
}
.est-lines {
  list-style: none;
  font-size: 14px;
  border-top: 1px solid rgba(232,223,211,0.2);
}
.est-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(232,223,211,0.2);
}
.est-lines li span:last-child { color: var(--white); white-space: nowrap; }

.est-message {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--white);
  line-height: 1.35;
}
.est-message-sub { font-size: 14px; margin-top: 10px; }

.estimator-cta {
  margin-top: 28px;
  cursor: pointer;
  font-family: var(--font-body);
  align-self: stretch;
  text-align: center;
}
.estimator-result .btn-primary:focus-visible { outline-color: var(--tan); }

.estimator-disclaimer {
  font-size: 12px;
  color: #BDB4A8;
  margin-top: 14px;
}

/* ---------- Toppings ---------- */
.topping-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}
.topping-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.topping-name {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 500;
}

.topping-photo {
  width: 100%;
  max-width: 150px;
  height: auto;
  aspect-ratio: 1/1;
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: 0 0 0 1px var(--tan), 0 8px 18px rgba(26,26,26,0.08);
}

/* ---------- Events ---------- */
.cart-events { background: var(--white); }

.cart-events-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.cart-events-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  border-radius: 4px;
}
.cart-events-text .script-accent {
  font-size: 40px;
  color: var(--burgundy);
  margin-bottom: 0;
}
.cart-events-text > p { color: var(--muted); }

.event-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
  margin: 24px 0;
}
.event-list li {
  font-family: var(--font-heading);
  font-size: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tan);
}

.events-note {
  font-size: 14px;
  font-style: italic;
}

/* ---------- Inquiry form ---------- */
.cart-inquiry { background: var(--tan-light); }

.cart-inquiry-inner { max-width: 820px; }

.cart-form,
.form-success {
  background: var(--white);
  padding: 40px;
  border-radius: 4px;
}

.form-estimate {
  background: var(--cream);
  border-left: 3px solid var(--burgundy);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}
.form-field { display: flex; flex-direction: column; }
.form-field-full { grid-column: 1 / -1; }

.form-field label {
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}
.optional { font-weight: 400; color: #6A6A6A; }

.cart-form input:not([type="hidden"]),
.cart-form select,
.cart-form textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--black);
  padding: 12px 14px;
  border: 1px solid var(--tan);
  border-radius: 2px;
  background: var(--cream);
  width: 100%;
  min-height: 48px;
}
.cart-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--burgundy) 50%), linear-gradient(135deg, var(--burgundy) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.cart-form input:focus,
.cart-form select:focus,
.cart-form textarea:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px rgba(110,30,43,0.12);
}
.cart-form [aria-invalid="true"] { border-color: var(--error); }

.field-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 6px;
}
.field-error:empty { display: none; }

.g-recaptcha { margin-top: 24px; }

.form-status {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 2px;
  background: #FBECEE;
  color: var(--error);
  font-size: 14px;
}

.cart-submit {
  margin-top: 24px;
  cursor: pointer;
  font-family: var(--font-body);
  min-width: 220px;
}
.cart-submit[disabled] { opacity: 0.7; cursor: progress; }

.form-success { text-align: center; }
.form-success:focus { outline: none; }
.form-success .script-accent { font-size: 48px; color: var(--burgundy); }
.form-success h3 { font-size: 26px; margin-bottom: 12px; }
.form-success p { color: var(--muted); max-width: 520px; margin: 0 auto; }
.form-success .form-note { margin-top: 20px; }
.form-success a { color: var(--burgundy); font-weight: 600; }

.cart-back { padding: 56px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .package-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; gap: 32px; }
  .topping-grid { grid-template-columns: repeat(3, 1fr); gap: 36px 24px; }
}

@media (max-width: 900px) {
  .cart-hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .cart-hero-image { max-width: 340px; }
  .included-grid { grid-template-columns: repeat(2, 1fr); }
  .estimator { grid-template-columns: minmax(0, 1fr); }
  .cart-events-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  .cart-hero { padding: 48px 0 64px; }
  .cart-hero-image::before { inset: 12px -12px -12px 12px; }
  .cart-hero-image { margin-right: 12px; }
  .cart-packages, .cart-estimate, .cart-inquiry { scroll-margin-top: 80px; }
  .estimator-inputs, .estimator-result { padding: 28px 24px; }
  .cart-form, .form-success { padding: 28px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .cart-submit { width: 100%; }
}

@media (max-width: 480px) {
  .included-grid { grid-template-columns: 1fr; gap: 36px; }
  .topping-grid { grid-template-columns: repeat(2, 1fr); }
  .topping-photo { max-width: 130px; }
  .event-list { grid-template-columns: 1fr; }
  .stepper { max-width: none; }
}

/* reCAPTCHA renders at a fixed 304px; shrink it to fit narrow phones */
@media (max-width: 400px) {
  .g-recaptcha { transform: scale(0.86); transform-origin: 0 0; height: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .package-card, .btn, .stepper-btn, .pkg-option span { transition: none; }
  .package-card:hover { transform: none; }
}
