/* ===== Crafto shop: catalog, product page, cart. Loaded after styles.css. ===== */

.shop-body {
  padding-bottom: 96px;
}

.draft-ribbon {
  margin: 0;
  padding: 6px 16px;
  background: #fff1c2;
  color: #6b4b00;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

/* header: cart button replaces the WhatsApp CTA */
.cart-toggle {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-weight: 900;
  font-size: 0.82rem;
  cursor: pointer;
}

.cart-toggle svg,
.add-to-cart svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transform: none;
}

.cart-count {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--coral);
  font-size: 0.72rem;
}

.desktop-nav a[aria-current="page"] {
  color: var(--coral-dark);
}

/* ===== Catalog ===== */
.shop-hero {
  padding-block: 44px 8px;
}

.shop-hero h1 {
  margin: 10px 0 8px;
  color: var(--navy);
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  font-weight: 900;
  line-height: 1.2;
}

.shop-lead {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
}

.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.shop-filters[hidden] {
  display: none;
}

.filter-chip {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.shop-grid-section {
  padding-top: 28px;
}

.shop-grid .product-card:last-child {
  grid-column: auto;
}

.shop-card[hidden] {
  display: none;
}

.shop-card-link {
  display: block;
  height: 100%;
}

.shop-card .product-info > p:not(.product-kind):not(.shop-price) {
  min-height: 0;
  margin: 6px 0 12px;
}

.shop-price {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 900;
}

.shop-price.is-ask {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.status-pill {
  position: absolute;
  bottom: 14px;
  right: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 900;
}

/* ===== Product page ===== */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 18px 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.crumbs a {
  color: var(--navy);
  font-weight: 700;
}

.pdp {
  display: grid;
  gap: 28px;
  padding-bottom: 40px;
}

.pdp > * {
  min-width: 0;
}

.pdp-main-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #eee9e0;
  aspect-ratio: 1.3;
}

.pdp-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-main-image img.product-visual-full {
  padding: 16px;
  object-fit: contain;
}

.pdp-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}

.thumb {
  flex: 0 0 72px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #eee9e0;
  cursor: pointer;
}

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

.thumb.is-active {
  border-color: var(--coral);
}

.pdp-info h1 {
  margin: 4px 0 6px;
  color: var(--navy);
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  line-height: 1.3;
}

.pdp-price {
  margin: 0;
  color: var(--coral-dark);
  font-size: 1.6rem;
  font-weight: 900;
}

.pdp-price.is-ask {
  color: var(--muted);
  font-size: 1rem;
}

.tier-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.tier-list li {
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  font-size: 0.8rem;
}

.tier-list span {
  color: var(--muted);
}

.pdp-summary {
  margin: 14px 0 0;
  color: var(--ink);
}

.pdp-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.personalize {
  display: grid;
  gap: 8px;
}

.personalize label,
.color-pick legend,
.qty-row > span {
  color: var(--navy);
  font-weight: 900;
  font-size: 0.9rem;
}

.name-input,
.personalize textarea {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--bone);
  color: var(--ink);
  font-size: 1.1rem;
}

.name-input:focus,
.personalize textarea:focus {
  outline: 3px solid rgba(243, 108, 61, 0.35);
  border-color: var(--coral);
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.field-hint.is-bad,
.form-error {
  color: #b42318;
  font-weight: 700;
}

.form-error {
  margin: 0;
  font-size: 0.85rem;
}

/* live name preview: letters standing on a band, tray behind */
.name-preview {
  --stand: #1c1c1c;
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 150px;
  padding: 18px 12px 0;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(#f3eee6, #e7dfd2);
}

.name-preview-text {
  position: relative;
  z-index: 1;
  color: var(--stand);
  font-family: "Lalezar", "Cairo", sans-serif;
  font-size: 4.4rem;
  line-height: 1.05;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 5px 10px rgba(0, 0, 0, 0.16);
  filter: saturate(1.05);
}

.name-preview-tray {
  width: 100%;
  height: 26px;
  border-radius: 6px 6px 0 0;
  background: var(--stand);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.16);
}

.preview-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.color-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.color-pick legend {
  margin-bottom: 8px;
}

.color-pick label {
  cursor: pointer;
}

.color-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-pick span {
  --swatch: #ccc;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.color-pick span::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.color-pick input:checked + span {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--navy);
}

.color-pick input:focus-visible + span {
  outline: 3px solid rgba(243, 108, 61, 0.45);
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
}

.qty button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
}

.qty output {
  min-width: 28px;
  text-align: center;
  font-weight: 900;
}

.line-price {
  margin-inline-start: auto;
  color: var(--navy);
  font-size: 1.05rem;
}

.add-to-cart {
  width: 100%;
}

.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 999px;
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 900;
}

.button-ghost svg {
  width: 19px;
  fill: currentColor;
}

.spec-list {
  display: grid;
  gap: 0;
  margin: 22px 0 0;
}

.spec-list div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.spec-list dt {
  color: var(--muted);
}

.spec-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.pdp-desc p {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.pdp-honest {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff4ea;
  color: #7a3a1d;
  font-size: 0.8rem;
}

.related {
  padding-top: 24px;
  background: #fffaf2;
}

.related-title {
  margin: 0 0 20px;
  color: var(--navy);
  font-size: 1.5rem;
}

/* ===== Cart drawer ===== */
.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 25, 42, 0.45);
}

.cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--bone);
  box-shadow: 0 0 60px rgba(6, 25, 42, 0.3);
}

.cart-drawer[hidden],
.cart-backdrop[hidden],
.mobile-cart-bar[hidden] {
  display: none;
}

.cart-open {
  overflow: hidden;
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.cart-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.3rem;
}

.cart-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  font-size: 1.1rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px;
}

.cart-empty {
  color: var(--muted);
}

.cart-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #eee9e0;
}

.cart-item strong,
.cart-item small,
.cart-item-price {
  display: block;
  line-height: 1.5;
}

.cart-item strong {
  color: var(--navy);
  font-size: 0.88rem;
}

.cart-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.cart-item-price {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.cart-remove {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.cart-foot {
  padding: 16px 20px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--white);
}

.cart-total {
  margin: 0 0 12px;
  color: var(--navy);
  font-weight: 900;
}

.cart-checkout[hidden] {
  display: none;
}

.cart-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

/* mobile bar mirrors the landing page's order bar */
.mobile-cart-bar {
  position: fixed;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 10px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px 10px 15px;
  border-radius: 22px;
  background: rgba(6, 25, 42, 0.96);
  color: var(--white);
  box-shadow: 0 15px 45px rgba(6, 25, 42, 0.33);
}

.mobile-cart-bar small,
.mobile-cart-bar strong {
  display: block;
  line-height: 1.3;
}

.mobile-cart-bar small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.65rem;
}

.mobile-cart-bar strong {
  margin-top: 3px;
  font-size: 0.82rem;
}

.cart-toggle-bar {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: var(--white);
  font-weight: 900;
  font-size: 0.8rem;
  cursor: pointer;
}

@media (max-width: 659px) {
  .cart-toggle span {
    display: none;
  }
}

@media (min-width: 900px) {
  .pdp {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
    gap: 44px;
  }

  .pdp-gallery {
    position: sticky;
    top: 104px;
  }

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