/* Organic Earth Interface Palette Styles */
:root {
  --earth-primary: #C86446;
  --earth-primary-hover: #B45235;
  --earth-primary-active: #9F4229;
  --earth-primary-light: #F7ECE8;
  --earth-secondary: #586F52;
  --earth-secondary-hover: #475C42;
  --earth-secondary-light: #EDF2EC;
  --earth-accent: #D8976C;
  --earth-bg-body: #FAF7F2;
  --earth-surface: #FFFFFF;
  --earth-surface-secondary: #F4ECE1;
  --earth-surface-subtle: #F9F5EE;
  --earth-border-default: #E4DAD0;
  --earth-border-subtle: #EDE5DC;
  --earth-border-focused: #C86446;
  --earth-text-primary: #2D2621;
  --earth-text-secondary: #6A5F56;
  --earth-text-muted: #968A80;
}

.earth-cart-modal .modal-dialog {
  max-height: 90vh;
  margin: 1.75rem auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 576px) {
  .earth-cart-modal .modal-dialog {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }
}

.earth-modal-content {
  background-color: var(--earth-surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.earth-modal-header {
  background-color: var(--earth-surface-secondary);
  border-bottom: 1px solid var(--earth-border-default);
  padding: 1rem 1.5rem;
  color: var(--earth-text-primary);
}

.earth-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.earth-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--earth-bg-body);
  color: var(--earth-text-primary);
}

/* Smooth Custom Scrollbar */
.earth-modal-body::-webkit-scrollbar {
  width: 6px;
}
.earth-modal-body::-webkit-scrollbar-track {
  background: var(--earth-bg-body);
}
.earth-modal-body::-webkit-scrollbar-thumb {
  background-color: var(--earth-border-default);
  border-radius: 4px;
}

/* Cart Item Styles */
.earth-cart-img-wrap {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--earth-surface-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.earth-cart-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.earth-cart-title {
  color: var(--earth-text-primary);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.earth-cart-title:hover {
  color: var(--earth-primary);
}

.earth-qty-control {
  background-color: var(--earth-surface);
  border: 1px solid var(--earth-border-default);
  height: 32px;
  padding: 0 4px;
}

.earth-qty-btn {
  border: none;
  background: transparent;
  color: var(--earth-text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease;
}
.earth-qty-btn:hover {
  color: var(--earth-primary);
}

.earth-qty-input {
  width: 38px;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--earth-text-primary);
  outline: none;
  -moz-appearance: textfield;
}
.earth-qty-input::-webkit-outer-spin-button,
.earth-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.earth-remove-btn {
  color: var(--earth-text-muted);
  transition: color 0.15s ease;
}
.earth-remove-btn:hover {
  color: #BD4A42;
}

/* Shipping card */
.earth-shipping-card {
  background-color: var(--earth-surface);
  border-color: var(--earth-border-default) !important;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.earth-shipping-card:has(input:checked) {
  border-color: var(--earth-primary) !important;
  background-color: var(--earth-primary-light);
}
.earth-shipping-card input[type="radio"]:checked {
  background-color: var(--earth-primary);
  border-color: var(--earth-primary);
}
.earth-shipping-price {
  color: var(--earth-accent);
}

/* Forms */
.earth-form-input {
  border: 1px solid var(--earth-border-default);
  background-color: var(--earth-surface);
  color: var(--earth-text-primary);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.earth-form-input:focus {
  border-color: var(--earth-border-focused);
  box-shadow: 0 0 0 3px rgba(200, 100, 70, 0.15);
}

/* Summary & Buttons */
.earth-order-summary {
  background-color: var(--earth-surface-secondary);
  border: 1px solid var(--earth-border-subtle);
}
.earth-grand-total {
  color: var(--earth-primary);
}

.earth-btn-primary {
  background-color: var(--earth-primary);
  border-color: var(--earth-primary);
  color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px 0 rgba(200, 100, 70, 0.20);
  transition: all 0.2s ease;
}
.earth-btn-primary:hover {
  background-color: var(--earth-primary-hover);
  border-color: var(--earth-primary-hover);
  color: #FFFFFF;
}
.earth-btn-primary:active {
  background-color: var(--earth-primary-active);
  border-color: var(--earth-primary-active);
}

.earth-btn-secondary {
  background-color: transparent;
  border: 1px solid var(--earth-secondary);
  color: var(--earth-secondary);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.earth-btn-secondary:hover {
  background-color: var(--earth-secondary-light);
  border-color: var(--earth-secondary-hover);
  color: var(--earth-secondary-hover);
}

.earth-btn-close:focus {
  box-shadow: 0 0 0 3px rgba(200, 100, 70, 0.25);
}