/* Cart styles - tipobetter */
.c-nav__cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 1.05rem;
  border-radius: 50%;
  margin-left: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.c-nav__cart-btn:hover { background: var(--color-surface-tint); }
.c-nav__cart-count {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.c-cart-overlay {
  position: fixed; inset: 0;
  background: rgba(26,26,24,0.45);
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition-mid), visibility var(--transition-mid);
  z-index: 998;
}
.c-cart-overlay.is-open { opacity: 1; visibility: visible; }

.c-cart-panel {
  position: fixed;
  top: 0; right: 0;
  width: 100%; max-width: 420px;
  height: 100vh;
  background: var(--color-surface);
  box-shadow: var(--shadow-xl);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-mid);
  visibility: hidden;
}
.c-cart-panel.is-open { transform: translateX(0); visibility: visible; }

.c-cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.c-cart-panel__header h3 { font-size: 1.1rem; font-weight: 700; }
.c-cart-panel__close {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-primary);
  background: none;
  border: none;
  cursor: pointer;
}
.c-cart-panel__close:hover { background: var(--color-surface-tint); }
.c-cart-panel__items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}
.c-cart-panel__empty {
  color: var(--color-text-secondary);
  text-align: center;
  padding: 3rem 0;
  font-size: 0.95rem;
}
.c-cart-panel__footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}
.c-cart-panel__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}
.c-cart-panel__note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.c-cart-line {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  position: relative;
  padding-right: 2rem;
}
.c-cart-line__img {
  width: 70px; height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-surface-tint);
}
.c-cart-line__body { flex: 1; min-width: 0; }
.c-cart-line__name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.c-cart-line__meta { font-size: 0.78rem; color: var(--color-text-secondary); margin-bottom: 0.4rem; }
.c-cart-line__row { display: flex; justify-content: space-between; align-items: center; }
.c-cart-line__qty { display: inline-flex; align-items: center; gap: 0.4rem; }
.c-cart-line__qty button {
  width: 26px; height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--color-text-primary);
  background: var(--color-surface);
  cursor: pointer;
}
.c-cart-line__qty button:hover { background: var(--color-surface-tint); }
.c-cart-line__qty span { min-width: 1.5rem; text-align: center; font-weight: 600; font-size: 0.9rem; }
.c-cart-line__price { font-weight: 700; font-size: 0.95rem; color: var(--color-accent); }
.c-cart-line__remove {
  position: absolute;
  top: 1rem;
  right: 0;
  width: 24px; height: 24px;
  color: var(--color-text-light);
  background: none;
  border: none;
  cursor: pointer;
}
.c-cart-line__remove:hover { color: var(--color-text-primary); }

/* Cart page */
.s-cart-page { padding: 4rem 0 5rem; min-height: 60vh; }
.s-cart-page__title { font-size: 2rem; margin-bottom: 2rem; font-weight: 700; }
.c-cart-empty {
  padding: 3rem;
  text-align: center;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.c-cart-empty a { color: var(--color-accent); text-decoration: underline; font-weight: 600; }

.s-cart-page__grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .s-cart-page__grid { grid-template-columns: 1fr; }
}

.c-cart-list {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}
.c-cart-row {
  display: grid;
  grid-template-columns: 90px 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}
.c-cart-row:last-child { border-bottom: none; }
.c-cart-row__img {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-surface-tint);
}
.c-cart-row__name { font-weight: 700; margin-bottom: 0.2rem; }
.c-cart-row__meta { font-size: 0.82rem; color: var(--color-text-secondary); margin-bottom: 0.3rem; }
.c-cart-row__price { font-size: 0.9rem; color: var(--color-text-secondary); }
.c-cart-row__qty { display: inline-flex; align-items: center; gap: 0.4rem; }
.c-cart-row__qty button {
  width: 30px; height: 30px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-primary);
  background: var(--color-surface);
  cursor: pointer;
}
.c-cart-row__qty input {
  width: 46px;
  height: 30px;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.c-cart-row__subtotal { font-weight: 700; min-width: 90px; text-align: right; color: var(--color-accent); }
.c-cart-row__remove {
  color: var(--color-text-light);
  padding: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
}
.c-cart-row__remove:hover { color: #c0392b; }
@media (max-width: 640px) {
  .c-cart-row { grid-template-columns: 70px 1fr auto; grid-template-rows: auto auto auto; }
  .c-cart-row__img { width: 70px; height: 70px; grid-row: 1 / span 2; }
  .c-cart-row__info { grid-column: 2 / span 2; }
  .c-cart-row__qty { grid-column: 2; }
  .c-cart-row__subtotal { grid-column: 3; grid-row: 2; }
  .c-cart-row__remove { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; }
}

.c-cart-summary {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 90px;
}
.c-cart-summary__title { font-size: 1.1rem; margin-bottom: 1rem; font-weight: 700; }
.c-cart-summary__row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}
.c-cart-summary__row--total {
  border-top: 1px solid var(--color-border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-accent);
}

.c-checkout-form {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-xs);
  margin-top: 2rem;
}
.c-checkout-form__title { font-size: 1.3rem; margin-bottom: 1rem; font-weight: 700; }
.c-checkout-form__section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--color-accent-light);
  color: var(--color-accent);
}
.c-checkout-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .c-checkout-form__row { grid-template-columns: 1fr; }
}
.c-field { margin-bottom: 1rem; }
.c-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.c-field label .req { color: #c0392b; margin-left: 0.2rem; }
.c-field input,
.c-field textarea,
.c-field select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast);
}
.c-field input:focus,
.c-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}
.c-field textarea { resize: vertical; min-height: 80px; }
.c-payment-options { display: grid; gap: 0.5rem; }
.c-payment-opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
}
.c-payment-opt input { width: auto; margin: 0; }
.c-payment-opt:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}
.c-checkout-form__legal {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}
.c-checkout-form__legal a { color: var(--color-accent); text-decoration: underline; }
.c-checkout-form__submit { margin-top: 1rem; }

.c-cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-bg-dark);
  color: #fff;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-mid), transform var(--transition-mid), visibility var(--transition-mid);
  z-index: 1000;
  font-size: 0.9rem;
}
.c-cart-toast.is-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.c-order-success {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.c-order-success__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.c-order-success__id {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--color-surface-tint);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-weight: 700;
  margin: 0.5rem 0;
}
.c-order-success__items {
  margin-top: 1.5rem;
  text-align: left;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}
.c-order-success__item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}
