/* "Add to your Jamón" block on the whole-piece product pages (app/complete-your-jamon.php).
   Plain CSS on purpose: it ships without the theme build. States come from :checked and
   :has(), never from classes added by JavaScript, so Remove Unused CSS has nothing to strip. */

.cyj-block {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-family: Gordita, sans-serif;
  padding: 1rem 1rem 0.75rem;
  background: #f9f6f1;
  border: 1px solid #eadfcd;
  border-radius: 0.5rem;
  text-align: left;
}

.cyj-block .cyj-title {
  margin: 0 0 0.25rem;
  font-family: Gordita, sans-serif;
  font-size: 1.0625rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #1a202c;
}

.cyj-block .cyj-sub {
  margin: 0 0 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #4d5c6b;
}

.cyj-block .cyj-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cyj-block .cyj-list li {
  margin: 0;
  border-top: 1px solid #eadfcd;
}

.cyj-block .cyj-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.75rem;
  margin: 0 -0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.cyj-block .cyj-item:hover,
.cyj-block .cyj-item:has(.cyj-check:checked) {
  background: #f3ead9;
}

.cyj-block .cyj-check {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  padding: 0;
  background-color: #fff;
  border: 1px solid #d3ae76;
  border-radius: 0.25rem;
  color: #d3ae76;
  accent-color: #d3ae76;
  cursor: pointer;
}

.cyj-block .cyj-check {
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.875rem 0.875rem;
}

/* The white tick is drawn here: the theme's form reset leaves a checked box as a plain
   filled square. */
.cyj-block .cyj-check:checked,
.cyj-block .cyj-check:checked:hover,
.cyj-block .cyj-check:checked:focus {
  background-color: #d3ae76;
  border-color: #d3ae76;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}

.cyj-block .cyj-check:focus {
  outline: none;
  box-shadow: none;
  --tw-ring-shadow: 0 0 #0000;
  --tw-ring-offset-shadow: 0 0 #0000;
}

.cyj-block .cyj-check:focus-visible {
  outline: 2px solid #4d5c6b;
  outline-offset: 2px;
}

.cyj-block .cyj-thumb {
  flex: none;
  width: 3rem;
  height: 3rem;
  margin: 0;
  object-fit: cover;
  border-radius: 0.375rem;
  background: #fff;
}

.cyj-block .cyj-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  color: #1a202c;
}

.cyj-block .cyj-size {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #6b7280;
}

.cyj-block .cyj-price {
  flex: none;
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  color: #1a202c;
}

.cyj-block .cyj-price del {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
  color: #9ca3af;
}

.cyj-block .cyj-foot {
  margin: 0;
  font-family: inherit;
  padding-top: 0.625rem;
  border-top: 1px solid #eadfcd;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #6b7280;
}

/* Running total, shown (hidden attribute removed) once a companion is ticked. */
.cyj-block .cyj-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 0.75rem;
  margin: 0.625rem -1rem -0.75rem;
  padding: 0.625rem 1rem 0.75rem;
  background: #f3ead9;
  border-top: 1px solid #eadfcd;
  border-radius: 0 0 0.5rem 0.5rem;
  color: #1a202c;
}

.cyj-block .cyj-total[hidden] {
  display: none;
}

.cyj-block .cyj-total-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.cyj-block .cyj-total-amount {
  font-size: 1.0625rem;
  white-space: nowrap;
}

.cyj-block .cyj-total-amount del {
  margin-right: 0.375rem;
  font-size: 0.875rem;
  color: #9ca3af;
}

.cyj-block .cyj-total-amount strong {
  font-weight: 700;
}

.cyj-block .cyj-total-saving {
  flex: 1 0 100%;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: right;
  color: #8a6a35;
}

.cyj-block .cyj-total-saving:empty {
  display: none;
}

/* The buy form is reused inside the theme's "upgrade" modal; the block stays on the page. */
.modaal-wrapper .cyj-block {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .cyj-block .cyj-item {
    transition: none;
  }
}
