/* ============================================================
   Techwine — Reusable components
   Buttons / cards / badges / stat blocks / forms / modals
   ============================================================ */

/* ---------- Buttons: uppercase pill convention ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary: yellow bg, teal-dark text */
.btn--primary {
  background: var(--color-yellow);
  color: var(--color-teal-dark);
}

.btn--primary:hover {
  background: var(--color-teal-dark);
  color: var(--color-yellow);
  box-shadow: 0 12px 26px rgba(0, 51, 52, 0.28);
}

/* Secondary: teal outline, transparent bg */
.btn--outline {
  background: transparent;
  border-color: var(--color-teal);
  color: var(--color-teal);
}

.btn--outline:hover {
  background: var(--color-teal);
  color: var(--color-off-white);
}

/* Light outline for dark backgrounds */
.btn--outline-light {
  background: transparent;
  border-color: var(--color-off-white);
  color: var(--color-off-white);
}

.btn--outline-light:hover {
  background: var(--color-off-white);
  color: var(--color-teal-dark);
}

.btn--sm {
  padding: 10px 22px;
  font-size: 12px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---------- Badges / tag pills ---------- */
.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge--new {
  background: var(--color-yellow);
  color: var(--color-teal-dark);
}

.badge--bestseller {
  background: var(--color-teal-dark);
  color: var(--color-yellow);
}

.badge--instock {
  background: var(--color-teal-pale);
  color: var(--color-teal);
}

.badge--category {
  background: rgba(10, 96, 98, 0.10);
  color: var(--color-teal);
}

/* ---------- Product card ---------- */
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  height: 100%;
  min-width: 0;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-teal-ghost);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card__media img {
  transform: scale(1.05);
}

.product-card__badges {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 26px;
  flex: 1;
}

.product-card__name {
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: break-word;
}

.product-card__spec {
  font-size: 14px;
  color: var(--color-teal-light);
  flex: 1;
  overflow-wrap: break-word;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.product-card__footer .btn {
  margin-left: auto;
}

/* Narrow cards (2-col mobile grids): stack footer, full-width CTA */
@media (max-width: 640px) {
  .product-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .product-card__footer .btn {
    margin-left: 0;
    justify-content: center;
  }
  .product-card__price {
    text-align: center;
  }
}

.product-card__price {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-teal-muted);
}

/* ---------- Category / feature card ---------- */
.category-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px 26px;
  border-radius: var(--radius-lg);
  background: var(--color-yellow-pale);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  height: 100%;
  min-width: 0;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
  background: #fff;
}

.category-card__icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-teal);
  color: var(--color-yellow);
}

.category-card__icon svg {
  width: 28px;
  height: 28px;
}

.category-card__title {
  font-size: 19px;
  overflow-wrap: break-word;
}

.category-card__text {
  font-size: 14px;
  color: var(--color-teal-light);
  flex: 1;
  overflow-wrap: break-word;
}

.category-card__link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-yellow-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-card__link:hover {
  color: var(--color-teal);
}

.category-card__link svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* ---------- Stat block ---------- */
.stat {
  text-align: center;
  padding: 18px 12px;
}

.stat__value {
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 800;
  color: var(--color-yellow);
  line-height: 1;
}

.stat__label {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-teal-muted);
}

/* ---------- Form controls ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-teal);
}

.field input,
.field select,
.field textarea {
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-teal-pale);
  background: #fff;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  border-radius: var(--radius-md);
  resize: vertical;
  min-height: 110px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 4px rgba(10, 96, 98, 0.12);
}

.field input.is-invalid,
.field textarea.is-invalid {
  border-color: var(--color-yellow-dark);
  box-shadow: 0 0 0 4px rgba(164, 138, 0, 0.14);
}

.field__error {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-yellow-dark);
  display: none;
}

.field.has-error .field__error {
  display: block;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.empty-state__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-yellow-pale);
  color: var(--color-yellow-dark);
}

.empty-state__icon svg {
  width: 32px;
  height: 32px;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--color-teal-light);
  max-width: 420px;
  margin: 0 auto;
}

/* ---------- Newsletter inline form ---------- */
.newsletter-form {
  display: flex;
  gap: 10px;
}

.newsletter-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(246, 246, 246, 0.25);
  background: rgba(246, 246, 246, 0.08);
  color: var(--color-off-white);
  outline: none;
}

.newsletter-form input::placeholder {
  color: var(--color-teal-muted);
}

.newsletter-form input:focus {
  border-color: var(--color-yellow);
}

.newsletter-form__msg {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-yellow);
  display: none;
}

.newsletter-form__msg.is-visible {
  display: block;
}
