/* ===========================================
   Calculator Design System — Lotwood
   Mobile-first, scoped to .calc
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --calc-accent: #f0541e;
  --calc-accent-hover: #d94a18;
  --calc-blue: #2d3f53;
  --calc-blue-light: #3a5068;
  --calc-bg: #f6f4f2;
  --calc-white: #ffffff;
  --calc-text: #1a1a1a;
  --calc-text-muted: #6b7280;
  --calc-border: #e5e2de;
  --calc-green: #5C7A3A;
  --calc-radius: 12px;
  --calc-radius-sm: 8px;
}

/* --- Container --- */
.calc-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 32px 32px;
  font-family: 'Inter', sans-serif;
  color: var(--calc-text);
  background: var(--calc-bg);
  border-radius: var(--calc-radius);
}

/* --- Page heading --- */
.calc h1 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin: 0 auto 20px;
  padding: 24px 16px 0;
  color: var(--calc-text);
  text-transform: none;
  max-width: 1024px;
}

/* --- Progress Bar --- */
.calc-progress {
  padding: 16px 0 24px;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  background: var(--calc-border);
  color: var(--calc-text-muted);
  transition: all 0.3s ease;
}

.progress-step.active .step-num {
  background: var(--calc-accent);
  color: #fff;
}

.progress-step.done .step-num {
  background: var(--calc-blue);
  color: #fff;
}

.step-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--calc-text-muted);
  white-space: nowrap;
}

.progress-step.active .step-label {
  color: var(--calc-accent);
  font-weight: 600;
}

.progress-step.done .step-label {
  color: var(--calc-blue);
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--calc-border);
  min-width: 12px;
  max-width: 40px;
  margin: 0 2px;
  margin-bottom: 18px;
  transition: background 0.3s ease;
}

.progress-line.filled {
  background: var(--calc-blue);
}

/* --- Steps common --- */
.calc-step {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.calc-step h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
  text-transform: none;
  text-align: center;
  color: var(--calc-text);
}

.calc-step h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
  text-transform: none;
  text-align: center;
}

.calc-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--calc-text-muted);
  background: var(--calc-bg);
  border-radius: var(--calc-radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.calc-hint i {
  font-size: 18px;
  color: var(--calc-blue);
  flex-shrink: 0;
  margin-top: 1px;
}

/* --- Step 1: Dimensions --- */
.dimensions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.dimension-card {
  background: var(--calc-white);
  border: 2px solid var(--calc-border);
  border-radius: var(--calc-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.dimension-card:focus-within {
  border-color: var(--calc-accent);
}

.dimension-icon {
  width: 48px;
  height: 48px;
}

.dimension-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dimension-card label {
  font-size: 14px;
  font-weight: 600;
  color: var(--calc-text);
}

.dimension-card input {
  width: 100%;
  max-width: 200px;
  height: 48px;
  border: 2px solid var(--calc-border);
  border-radius: var(--calc-radius-sm);
  padding: 0 16px;
  font-size: 18px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-align: center;
  color: var(--calc-text);
  background: var(--calc-bg);
  transition: border-color 0.2s ease;
  -moz-appearance: textfield;
}

.dimension-card input::-webkit-outer-spin-button,
.dimension-card input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dimension-card input:focus {
  outline: none;
  border-color: var(--calc-accent);
  background: var(--calc-white);
}

/* --- Step 2: Design Grid --- */
.design-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.design-card {
  background: var(--calc-white);
  border: 2px solid var(--calc-border);
  border-radius: var(--calc-radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.design-card:hover {
  border-color: var(--calc-blue);
}

.design-card.selected {
  border-color: var(--calc-accent);
  box-shadow: 0 0 0 2px rgba(240, 84, 30, 0.2);
}

.design-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: #fafafa;
}

.design-card-info {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.design-id {
  font-size: 12px;
  font-weight: 500;
  color: var(--calc-text-muted);
}

.design-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--calc-accent);
}

.design-card-custom-icon {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  font-size: 48px;
  color: var(--calc-text-muted);
}

.design-card-custom.selected .design-card-custom-icon {
  color: var(--calc-accent);
}

/* --- Step 3: Addons Grid --- */
.addon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.addon-card {
  background: var(--calc-white);
  border: 2px solid var(--calc-border);
  border-radius: var(--calc-radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease;
}

.addon-card:hover {
  border-color: var(--calc-blue);
}

.addon-card.selected {
  border-color: var(--calc-accent);
}

.addon-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.addon-card-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.addon-name {
  font-size: 12px;
  line-height: 1.4;
  color: var(--calc-text);
}

.addon-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.addon-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--calc-accent);
}

.addon-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.addon-qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--calc-border);
  background: var(--calc-white);
  font-size: 16px;
  font-weight: 700;
  color: var(--calc-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}

.addon-qty button:hover {
  border-color: var(--calc-accent);
}

.addon-qty span {
  font-size: 14px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.addon-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--calc-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* --- Step 4: Color Grid --- */
.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.color-card {
  background: var(--calc-white);
  border: 2px solid var(--calc-border);
  border-radius: var(--calc-radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.color-card:hover {
  border-color: var(--calc-blue);
}

.color-card.selected {
  border-color: var(--calc-accent);
}

.color-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.color-card-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.color-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--calc-text);
}

.color-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--calc-green);
  color: #fff;
}

.color-badge.toning {
  background: var(--calc-blue);
}

/* --- Step 5: Summary --- */
.summary-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.summary-preview {
  border-radius: var(--calc-radius);
  overflow: hidden;
  background: #fafafa;
}

.summary-preview img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--calc-border);
}

.summary-label {
  font-size: 14px;
  color: var(--calc-text-muted);
  flex-shrink: 0;
}

.summary-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--calc-text);
  text-align: right;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--calc-blue);
  border-radius: var(--calc-radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.total-price {
  font-size: 24px;
  font-weight: 700;
}

.total-price--custom {
  font-size: 16px;
}

/* --- Order Form --- */
.order-form {
  background: var(--calc-bg);
  border-radius: var(--calc-radius);
  padding: 20px;
  margin-bottom: 20px;
}

.order-form form,
.order-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--calc-text-muted);
  margin-bottom: 4px;
}

.order-form input[type="text"],
.order-form input[type="tel"] {
  width: 100%;
  height: 48px;
  border: 2px solid var(--calc-border);
  border-radius: var(--calc-radius-sm);
  padding: 0 16px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  color: var(--calc-text);
  background: var(--calc-white);
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.order-form input[type="text"]:focus,
.order-form input[type="tel"]:focus {
  outline: none;
  border-color: var(--calc-accent);
}

/* --- Navigation --- */
.calc-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.btn-next,
.btn-back,
.btn-order {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--calc-radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s ease;
}

.btn-next {
  background: var(--calc-accent);
  color: #fff;
}

.btn-next:hover {
  background: var(--calc-accent-hover);
}

.btn-next:disabled {
  background: var(--calc-border);
  color: var(--calc-text-muted);
  cursor: not-allowed;
}

.btn-back {
  background: transparent;
  color: var(--calc-text-muted);
  border: 2px solid var(--calc-border);
}

.calc .btn-back:hover {
  border-color: var(--calc-blue);
  color: var(--calc-blue);
  background: transparent;
}

.btn-order {
  background: var(--calc-accent);
  color: #fff;
  justify-content: center;
}

.btn-order:hover {
  background: var(--calc-accent-hover);
}

.btn-order:disabled {
  background: var(--calc-border);
  color: var(--calc-text-muted);
  cursor: not-allowed;
}

/* --- Mobile bottom bar --- */
.calc-mobile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: var(--calc-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
}

.mobile-bar-price {
  font-size: 18px;
  font-weight: 700;
}

/* --- Sections below stepper --- */
.calc-section {
  padding: 40px 16px;
  font-family: 'Inter', sans-serif;
}

.calc-section:nth-child(odd) {
  background: var(--calc-bg);
}

.calc-section-inner {
  max-width: 1024px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 28px;
  color: var(--calc-text);
  text-transform: none;
}

/* --- Gallery --- */
#gallery-slider .splide__slide img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--calc-radius);
  display: block;
}

#gallery-slider .splide__arrow {
  background: var(--calc-blue);
  opacity: 0.9;
  width: 36px;
  height: 36px;
}

#gallery-slider .splide__arrow svg {
  fill: #fff;
  width: 16px;
  height: 16px;
}

/* --- How it works --- */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.how-step {
  background: var(--calc-white);
  border: 1px solid var(--calc-border);
  border-radius: var(--calc-radius);
  padding: 24px 20px;
  text-align: center;
}

.how-step-icon {
  font-size: 32px;
  color: var(--calc-accent);
  margin-bottom: 12px;
}

.how-step h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  text-transform: none;
  text-align: center;
  color: var(--calc-text);
}

.how-step p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--calc-text-muted);
  margin: 0;
}

.how-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.how-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--calc-blue);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.how-links a:hover {
  border-bottom-color: var(--calc-blue);
}

/* --- SEO text --- */
.calc-seo {
  font-size: 15px;
  line-height: 1.7;
  color: var(--calc-text);
}

.calc-seo h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px;
  text-transform: none;
  text-align: left;
  color: var(--calc-text);
}

.calc-seo h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
  text-transform: none;
  text-align: left;
  color: var(--calc-text);
}

.calc-seo p {
  margin: 0 0 16px;
}

.calc-seo ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.calc-seo ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  line-height: 1.7;
}

.calc-seo ul li::before {
  content: "\2022";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--calc-accent);
  font-size: 18px;
  line-height: 1;
}

/* --- FAQ (same design as blog) --- */
.calc-faq details {
  border: 1px solid var(--calc-border);
  border-radius: var(--calc-radius);
  margin-bottom: 8px;
  background: var(--calc-white);
  overflow: hidden;
  transition: border-color 0.4s ease;
}

.calc-faq details[open] {
  border-color: var(--calc-accent);
}

.calc-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  color: var(--calc-text);
  line-height: 1.4;
  list-style: none;
  transition: background-color 0.2s ease;
}

.calc-faq summary:hover {
  background-color: rgba(240, 84, 30, 0.04);
}

.calc-faq summary::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-left: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23f0541e' viewBox='0 0 256 256'%3E%3Cpath d='M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.4s ease;
}

.calc-faq details[open] summary::after {
  transform: rotate(45deg);
}

.calc-faq summary::-webkit-details-marker {
  display: none;
}

.calc-faq details > div {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.calc-faq details[open] > div {
  grid-template-rows: 1fr;
  opacity: 1;
}

.calc-faq details > div > * {
  overflow: hidden;
}

.calc-faq details > div > p {
  padding: 0 16px 16px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--calc-text-muted);
  margin: 0;
}

/* --- Breadcrumbs (reuse from blog) --- */
.calc .breadcrumb {
  display: flex;
  list-style: none;
  padding: 16px 0;
  margin: 0;
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.calc .breadcrumb li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--calc-text-muted);
}

.calc .breadcrumb a {
  color: var(--calc-text-muted);
  text-decoration: none;
}

.calc .breadcrumb li:last-child a {
  color: var(--calc-text);
  font-weight: 500;
}

/* ===========================================
   Tablet — 600px+
   =========================================== */
@media (min-width: 600px) {
  .calc-container {
    padding: 32px;
  }

  .dimensions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .color-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .step-num {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .step-label {
    font-size: 11px;
  }

  .progress-line {
    min-width: 24px;
    max-width: 60px;
    margin: 0 4px;
    margin-bottom: 22px;
  }

  .calc h1 {
    font-size: 30px;
  }

  .calc-step h2 {
    font-size: 28px;
  }

  .how-links {
    flex-direction: row;
    gap: 24px;
  }

  .calc-mobile-bar {
    display: none;
  }

  .summary-layout {
    flex-direction: row;
  }

  .summary-preview {
    flex: 0 0 280px;
  }

  .summary-details {
    flex: 1;
  }

  .calc-section {
    padding: 48px 24px;
  }

  .section-title {
    font-size: 30px;
  }

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

/* ===========================================
   Desktop — 960px+
   =========================================== */
@media (min-width: 960px) {
  .calc-container {
    padding: 40px;
  }

  .design-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .addon-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .color-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .calc h1 {
    font-size: 36px;
  }

  .summary-preview {
    flex: 0 0 360px;
  }

  .summary-preview img {
    max-height: 400px;
  }

  .calc-section {
    padding: 56px 40px;
  }

  .section-title {
    font-size: 34px;
  }
}
