:root {
  --bg: #F9F4E8;
  --surface: #FFFFFF;
  --surface-alt: #D6F3F6;
  --text: #292214;
  --text-muted: #6D6555;
  --border: #E4E0D8;
  --primary: #117B88;
  --primary-hover: #0D5E68;
  --on-primary: #FFFFFF;
  --primary-text: #10737F;
  --accent: #DF1664;
  --on-accent: #FFFFFF;
  --accent-text: #CD145C;
}

.ct-modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ct-modal-wrapper.ct-modal-open {
  opacity: 1;
  visibility: visible;
}

.ct-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 61, 67, 0.6);
}

.ct-modal-container {
  position: relative;
  background: var(--surface);
  color: var(--text);
  width: 95%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 1;
  overflow: hidden;
}

.ct-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}

.ct-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-text);
}

.ct-modal-close {
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.ct-modal-close:hover {
  color: var(--accent);
}

.ct-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.ct-cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 10px;
  font-size: 1rem;
}

.ct-cart-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.ct-cart-item-img-col {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
}

.ct-cart-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.ct-cart-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ct-cart-item-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.ct-cart-item-price {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ct-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.ct-qty-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.ct-qty-btn {
  background: var(--surface-alt);
  color: var(--text);
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.ct-qty-btn:hover {
  background: var(--border);
}

.ct-qty-input {
  width: 36px;
  height: 28px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 0.85rem;
  appearance: textfield;
  -moz-appearance: textfield;
}

.ct-qty-input::-webkit-outer-spin-button,
.ct-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ct-cart-item-subtotal {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.ct-cart-remove-link {
  background: none;
  border: none;
  color: var(--accent-text);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.ct-cart-remove-link:hover {
  color: var(--accent);
}

.ct-order-summary-box {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.ct-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
}

.ct-checkout-form {
  margin-top: 15px;
}

.ct-form-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary-text);
}

.ct-checkout-error {
  background-color: #fee2e2;
  color: #b91c1c;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.ct-form-row {
  margin-bottom: 12px;
}

.ct-form-group-cols {
  display: flex;
  gap: 10px;
}

.ct-form-group-cols .ct-form-row {
  flex: 1;
}

.ct-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.ct-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.ct-input:focus {
  outline: none;
  border-color: var(--primary);
}

.ct-shipping-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-alt);
  padding: 10px;
  border-radius: 6px;
}

.ct-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.ct-form-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0;
}

.ct-consent-label {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.3;
}

.ct-consent-label a {
  color: var(--primary-text);
  text-decoration: underline;
}

.ct-btn-submit {
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  padding: 10px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.ct-btn-submit:hover {
  background-color: var(--primary-hover);
}

.ct-checkout-success-view {
  text-align: center;
  padding: 30px 10px;
}

.ct-success-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.ct-success-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.ct-success-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.ct-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  z-index: 2;
}

.ct-footer-total {
  font-size: 1.1rem;
  font-weight: 700;
}

.ct-total-val {
  color: var(--primary-text);
  margin-left: 6px;
}

.ct-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ct-toast.ct-toast-visible {
  opacity: 0.95;
}

[data-cart-count] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
}

@media (max-width: 576px) {
  .ct-cart-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .ct-cart-item-img-col {
    width: 60px;
    height: 60px;
  }
  .ct-cart-item-controls {
    width: 100%;
    justify-content: space-between;
  }
  .ct-form-group-cols {
    flex-direction: column;
    gap: 0;
  }
}