﻿:root {
  --bg: #fcfcf9;
  --surface: #ffffff;
  --surface-soft: #fafbe9;
  --text: #3f3d38;
  --muted: #6f6d68;
  --brand: #f8d9d2;
  --brand-dark: #e8c2ba;
  --accent: #7f9dab;
  --accent-strong: #849880;
  --button-text: #333333;
  --border: #e5e3df;
  --shadow: 0 18px 45px rgba(63, 61, 56, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hero {
  background:
    linear-gradient(90deg, rgba(63, 61, 56, 0.82), rgba(127, 157, 171, 0.44)),
    url("imagens/hero-enxoval.svg") center/cover;
  color: white;
  min-height: 430px;
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
}

.topbar a {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: white;
  padding: 10px 16px;
  text-decoration: none;
}

.hero-content {
  margin: 96px auto 0;
  max-width: 1120px;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  letter-spacing: 0;
  line-height: 0.98;
  margin: 12px 0 18px;
  max-width: 820px;
}

.hero-content p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
  line-height: 1.7;
  max-width: 680px;
}

main {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-areas:
    "cliente cliente"
    "catalogo lateral";
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  margin: -54px auto 64px;
  max-width: 1240px;
  padding: 0 24px;
}

.panel,
.product-card,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel,
.empty-state {
  padding: 24px;
}

.customer-panel {
  display: grid;
  gap: 24px;
  grid-area: cliente;
  grid-template-columns: 0.75fr 1.25fr;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h2,
h3,
h4,
p {
  margin-top: 0;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  color: var(--text);
  display: grid;
  font-weight: 700;
  gap: 8px;
}

input,
select,
textarea {
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  min-height: 46px;
  padding: 11px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  outline: 3px solid rgba(127, 157, 171, 0.2);
}

textarea {
  min-height: 138px;
  resize: vertical;
}

.catalog-section {
  grid-area: catalogo;
  margin-top: 14px;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.tabs {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px;
}

.tab-button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 12px 18px;
  width: auto;
}

.tab-button.active {
  background: var(--brand);
}

.tab-panel[hidden] {
  display: none;
}

.product-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.product-summary {
  display: grid;
  grid-template-columns: 220px 1fr;
}

.product-media {
  aspect-ratio: 4 / 3;
  background: var(--surface-soft);
  display: grid;
  overflow: hidden;
  place-items: center;
}

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

.product-body {
  align-content: start;
  display: grid;
  gap: 14px 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px;
}

.product-title {
  display: grid;
  gap: 10px;
  grid-column: 1;
}

.product-title h3 {
  font-size: 1.06rem;
  line-height: 1.35;
  margin-bottom: 0;
}

.product-code,
.category-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  width: max-content;
}

.product-code {
  background: var(--surface-soft);
  color: var(--accent-strong);
  margin-bottom: 8px;
}

.category-badge {
  background: rgba(127, 157, 171, 0.15);
  color: var(--text);
}

button {
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  color: var(--button-text);
  cursor: pointer;
  font-weight: 800;
  padding: 15px 18px;
  width: 100%;
}

button:hover {
  background: var(--accent-strong);
  color: white;
}

.product-total {
  align-self: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 92px;
  padding: 14px 18px;
  place-items: center;
  text-align: center;
}

.product-total span {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 900;
}

.product-total strong {
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
}

.toggle-fabrics {
  grid-column: 1;
}

.toggle-fabrics,
.clear-product {
  width: max-content;
}

.toggle-fabrics[aria-expanded="true"] {
  background: var(--accent-strong);
  color: white;
}

.fabric-panel {
  border-top: 1px solid var(--border);
  padding: 16px;
}

.fabric-panel[hidden] {
  display: none;
}

.fabric-panel-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.fabric-panel-heading h4 {
  font-size: 1rem;
  margin: 0;
}

.clear-product {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
}

.clear-product:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.fabric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.fabric-option {
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  padding: 8px;
  position: relative;
}

.fabric-option:has(.fabric-checkbox:checked) {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(127, 157, 171, 0.18);
}

.fabric-option img {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.fabric-option span {
  font-size: 0.86rem;
  font-weight: 800;
}

.fabric-option-unavailable {
  background: #f7f4ee;
  cursor: not-allowed;
}

.fabric-option-unavailable img {
  filter: grayscale(0.65);
  opacity: 0.48;
}

.fabric-option-unavailable .fabric-image-button {
  cursor: zoom-in;
}

.fabric-option-unavailable .fabric-checkbox {
  cursor: not-allowed;
}

.availability-badge {
  background: rgba(63, 61, 56, 0.82);
  border-radius: 999px;
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  justify-self: start;
  letter-spacing: 0.05em;
  padding: 5px 8px;
  text-transform: uppercase;
}

.fabric-checkbox {
  min-height: auto;
  width: auto;
}

.fabric-quantity {
  min-height: 40px;
}

.fabric-quantity:disabled {
  background: #f1eee8;
  color: var(--muted);
  cursor: not-allowed;
}

.checkout-grid {
  align-self: start;
  display: grid;
  gap: 18px;
  grid-area: lateral;
  grid-template-columns: 1fr;
  margin-top: 14px;
  position: sticky;
  top: 18px;
}

.summary-card {
  align-self: start;
}

.summary-list {
  color: var(--muted);
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.summary-item {
  background: var(--surface-soft);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
}

.summary-item span {
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
  margin-top: 4px;
}

.hint,
.empty-state p:last-child {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 14px 0 0;
}


body.modal-open {
  overflow: hidden;
}

.fabric-image-button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

.fabric-image-button:hover {
  background: transparent;
}

.fabric-image-button:focus-visible {
  outline: 3px solid rgba(127, 157, 171, 0.32);
  outline-offset: 2px;
}

.fabric-modal[hidden] {
  display: none;
}

.fabric-modal {
  align-items: center;
  display: grid;
  inset: 0;
  padding: 24px;
  position: fixed;
  z-index: 30;
}

.fabric-modal-backdrop {
  background: rgba(63, 61, 56, 0.62);
  inset: 0;
  position: absolute;
}

.fabric-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(63, 61, 56, 0.32);
  justify-self: center;
  max-height: min(88vh, 860px);
  max-width: min(92vw, 860px);
  overflow: auto;
  padding: 22px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.fabric-modal-content img {
  border-radius: 8px;
  display: block;
  max-height: 68vh;
  object-fit: contain;
  width: 100%;
}

.fabric-modal-close {
  float: right;
  padding: 10px 14px;
  width: auto;
}

@media (max-width: 980px) {
  .product-summary {
    grid-template-columns: 180px 1fr;
  }
}

@media (max-width: 900px) {
  .customer-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  main {
    grid-template-areas:
      "cliente"
      "catalogo"
      "lateral";
    grid-template-columns: 1fr;
  }

  .checkout-grid {
    margin-top: 0;
    position: static;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 520px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .hero-content {
    margin-top: 62px;
  }

  main {
    padding: 0 16px;
  }

  .panel,
  .empty-state {
    padding: 18px;
  }

  .form-grid,
  .product-grid,
  .product-summary,
  .product-body {
    grid-template-columns: 1fr;
  }

  .product-title,
  .product-total,
  .toggle-fabrics {
    grid-column: 1;
  }

  .product-total {
    grid-row: auto;
    justify-items: start;
    min-width: 0;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .tabs {
    align-items: stretch;
    border-radius: 8px;
    display: grid;
    width: 100%;
  }

  .tab-button,
  .toggle-fabrics,
  .clear-product {
    width: 100%;
  }

  .fabric-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }
}




