:root {
  --paper: #fbf8f3;
  --surface: #ffffff;
  --surface-soft: #f4ece3;
  --ink: #29231f;
  --muted: #71665f;
  --accent: #7b2940;
  --accent-dark: #5a1a2d;
  --gold: #b18458;
  --border: #e6d9cb;
  --success: #1f7a4d;
  --warning: #a36a16;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(42, 29, 20, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Tajawal", Tahoma, Arial, sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 11px 16px;
  color: #fffaf5;
  background: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.topbar p {
  margin: 0;
}

.nav {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-family: Georgia, serif;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ghost-link {
  color: var(--accent);
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 30px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

.button.compact {
  min-height: 44px;
  padding-inline: 22px;
}

.button.secondary {
  color: var(--accent);
  background: #f6e7eb;
}

.hero {
  display: grid;
  grid-template-columns: minmax(330px, 0.9fr) 1fr;
  gap: 64px;
  padding: 22px 0 76px;
  align-items: start;
}

.gallery {
  display: flex;
  flex-direction: row-reverse;
  gap: 14px;
}

.main-photo {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: 160px 160px 18px 18px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.main-photo img {
  width: 100%;
  aspect-ratio: 0.76;
  object-fit: cover;
}

.photo-pill {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 800;
}

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

.thumb {
  width: 72px;
  height: 94px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
  opacity: 0.72;
}

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

.thumb.is-active,
.thumb:hover {
  border-color: var(--accent);
  opacity: 1;
}

.product-copy {
  padding-top: 42px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  max-width: 560px;
  margin: 0 0 20px;
  font-size: clamp(38px, 4.2vw, 54px);
  line-height: 1.25;
}

.intro {
  max-width: 560px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.85;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 26px;
}

.price-row strong {
  color: var(--accent);
  font-size: 43px;
  line-height: 1;
}

.price-row small,
.offer-card small {
  font-size: 17px;
  font-weight: 800;
}

.price-row p,
.swatches p {
  margin: 0;
  color: var(--muted);
}

.swatches {
  margin-bottom: 28px;
}

.swatches p {
  margin-bottom: 14px;
}

.swatch-list {
  display: flex;
  gap: 12px;
}

.swatch {
  width: 32px;
  height: 32px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d0beb0;
  cursor: pointer;
}

.swatch.is-active {
  box-shadow: 0 0 0 2px var(--accent);
}

.offwhite { background: #f4eee3; }
.purple { background: #742070; }
.burgundy { background: #700e26; }
.lavender { background: #a794ec; }
.caramel { background: #a76432; }

.details {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.details li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.details li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold);
}

.details strong {
  color: var(--ink);
}

.offers {
  padding: 66px 0 74px;
  background: var(--surface);
}

.section-heading {
  margin-bottom: 38px;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(29px, 3.4vw, 39px);
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.offer-card {
  position: relative;
  min-height: 172px;
  padding: 30px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffdfa;
  text-align: center;
}

.offer-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.offer-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 32px;
}

.offer-card span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.offer-card.recommended {
  border: 2px solid var(--accent);
}

.badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 18px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.order-section {
  padding: 82px 0;
  background: var(--surface-soft);
}

.order-layout {
  display: grid;
  grid-template-columns: 0.78fr 1fr;
  gap: 72px;
  align-items: start;
}

.order-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.4;
}

.order-copy > p:not(.eyebrow) {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.shipping-box {
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.shipping-box h3 {
  margin: 0 0 12px;
}

.shipping-box p {
  margin: 9px 0;
  color: var(--muted);
  line-height: 1.75;
}

.order-form,
.admin-panel,
.invoice-panel {
  padding: 32px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quantity-options {
  display: flex;
  gap: 11px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.quantity-options legend {
  width: 100%;
  margin-bottom: 12px;
  font-weight: 800;
}

.quantity-options label {
  flex: 1;
}

.quantity-options input {
  position: absolute;
  opacity: 0;
}

.quantity-options span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.quantity-options input:checked + span {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.piece-options {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.piece {
  display: grid;
  grid-template-columns: 92px 1fr 1fr;
  gap: 9px;
  align-items: center;
}

.piece b {
  color: var(--muted);
  font-size: 14px;
}

.piece select,
.field input,
.field select,
.field textarea,
.admin-filter input,
.admin-filter select,
.status-select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--ink);
  background: #fffdfa;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.field textarea {
  resize: vertical;
}

.field :focus,
.piece select:focus,
.admin-filter :focus,
.status-select:focus {
  outline: 2px solid rgba(123, 41, 64, 0.18);
  border-color: var(--accent);
}

.summary {
  display: grid;
  gap: 13px;
  margin: 24px 0;
  padding: 20px;
  border-radius: 8px;
  background: #faf5ef;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.summary strong {
  color: var(--ink);
}

.summary .total {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

.summary .total strong {
  color: var(--accent);
}

.form-button {
  width: 100%;
}

.form-feedback {
  margin: 18px 0 0;
  padding: 14px;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #f8e8ea;
  line-height: 1.7;
}

.form-feedback[data-type="success"] {
  color: var(--success);
  background: #e9f7ef;
}

.form-feedback[data-type="error"] {
  color: var(--danger);
  background: #fdebea;
}

.footer {
  padding: 44px 20px;
  color: #eee2d9;
  background: var(--ink);
  text-align: center;
}

.footer .logo {
  margin: 0 0 10px;
  color: white;
}

.footer p:last-child {
  margin: 0;
}

.admin-main {
  padding: 28px 0 70px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.admin-head h1 {
  margin-bottom: 8px;
}

.admin-head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 28px;
}

.admin-filter {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
  margin-bottom: 20px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th,
.orders-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: top;
}

.orders-table th {
  color: var(--muted);
  font-size: 13px;
}

.order-id {
  color: var(--accent);
  font-weight: 800;
}

.badge-status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3eadf;
  font-size: 13px;
  font-weight: 800;
}

.badge-status.shipped,
.badge-status.delivered {
  color: var(--success);
  background: #e8f4ed;
}

.badge-status.confirmed {
  color: #2458a6;
  background: #eaf1fb;
}

.badge-status.processing {
  color: var(--warning);
  background: #fff3df;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.small-button.light {
  color: var(--accent);
  background: #f6e7eb;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.invoice-panel {
  margin-top: 22px;
}

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

.invoice-panel pre {
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: #2a2521;
  color: #fffaf5;
  direction: rtl;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .hero,
  .order-layout {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .product-copy {
    padding-top: 0;
  }

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

  .admin-filter {
    grid-template-columns: 1fr;
  }

  .orders-table {
    min-width: 860px;
  }

  .admin-panel {
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 30px, 480px);
  }

  .topbar {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-size: 12px;
  }

  .nav,
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 0;
    padding-bottom: 48px;
  }

  .gallery {
    flex-direction: column;
  }

  .main-photo {
    border-radius: 118px 118px 14px 14px;
  }

  .thumbnails {
    flex-direction: row;
    justify-content: center;
  }

  .thumb {
    width: calc((100% - 42px) / 5);
    height: 78px;
  }

  h1 {
    font-size: 34px;
  }

  .intro {
    font-size: 16px;
  }

  .offer-grid,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px 10px;
  }

  .offer-card {
    min-height: 154px;
    padding: 26px 8px 18px;
  }

  .order-section {
    padding: 57px 0;
  }

  .order-form,
  .admin-panel,
  .invoice-panel {
    padding: 22px 16px;
  }

  .piece {
    grid-template-columns: 1fr 1fr;
  }

  .piece b {
    grid-column: 1 / -1;
  }
}
