/* ==========================================================================
   CHECKOUT LAYOUT
   ========================================================================== */
.checkout-page-wrapper {
  padding: 120px 0 5rem 0;
  min-height: 80vh;
  background-color: var(--clr-off-white);
}

.checkout-header {
  margin-bottom: 2rem;
}

.checkout-header h1 {
  font-size: 2.5rem;
  color: var(--clr-green-forest);
}

.checkout-layout {
  display: flex;
  gap: 3rem;
}

.checkout-main {
  width: 65%;
}

.checkout-sidebar {
  width: 35%;
}

/* ==========================================================================
   MULTI-STEP ACCORDION / SECTIONS
   ========================================================================== */
.checkout-step {
  background: var(--clr-white);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid var(--clr-border);
  transition: all 0.3s ease;
}

.step-header {
  display: flex;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--clr-green-light);
  border-bottom: 1px solid var(--clr-border);
  cursor: pointer;
}

.step-number {
  width: 30px;
  height: 30px;
  background: var(--clr-green-deep);
  color: var(--clr-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 1rem;
}

.step-header.completed .step-number {
  background: var(--clr-success, #2a9d8f);
  content: '✓';
}

.step-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--clr-green-forest);
}

.step-content {
  padding: 2rem;
  display: none;
  animation: fadeIn 0.4s ease;
}

.checkout-step.active .step-content {
  display: block;
}

/* Re-using floating label styles from contact */
.form-group-float {
  position: relative;
  margin-bottom: 2rem;
}

.form-control {
  width: 100%;
  padding: 1rem 0 0.5rem 0;
  border: none;
  border-bottom: 2px solid var(--clr-border);
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus {
  border-bottom-color: var(--clr-green-deep);
}

.form-label {
  position: absolute;
  top: 1rem;
  left: 0;
  color: var(--clr-text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: 0.3s ease all;
}

.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
  top: -0.5rem;
  font-size: 0.8rem;
  color: var(--clr-green-deep);
}

/* Form Layout Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

.btn-next-step {
  padding: 0.8rem 2rem;
  margin-top: 1rem;
  float: right;
}

/* ==========================================================================
   PAYMENT OPTIONS
   ========================================================================== */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.payment-option {
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.payment-option:hover {
  background: var(--clr-off-white);
}

.payment-option input[type="radio"] {
  margin-right: 1rem;
  transform: scale(1.2);
  accent-color: var(--clr-green-deep);
}

.payment-option.active {
  border-color: var(--clr-green-deep);
  background: var(--clr-green-light);
}

/* Credit Card Container */
.cc-container {
  display: none;
  animation: fadeIn 0.4s ease;
  padding-top: 1rem;
}

/* Animated Card Preview */
.card-preview {
  width: 100%;
  max-width: 380px;
  height: 220px;
  background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 100%);
  border-radius: 16px;
  color: var(--clr-white);
  padding: 1.5rem;
  position: relative;
  margin: 0 auto 2rem auto;
  box-shadow: 0 15px 30px rgba(27, 67, 50, 0.3);
  overflow: hidden;
}

.card-preview::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.chip {
  width: 45px;
  height: 35px;
  background: #E8D39E;
  border-radius: 5px;
  margin-bottom: 1.5rem;
  position: relative;
}

.chip::after {
  content: '';
  position: absolute;
  top: 50%; left: 0; width: 100%; height: 1px;
  background: rgba(0,0,0,0.2);
}

.card-number-display {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.5rem;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  height: 34px;
}

.card-footer-display {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  text-transform: uppercase;
}

.card-label {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.card-name-display, .card-expiry-display {
  font-size: 1rem;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Place Order Button */
.btn-place-order {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.2rem;
  margin-top: 2rem;
}

/* ==========================================================================
   ORDER SUMMARY SIDEBAR
   ========================================================================== */
.checkout-summary {
  background: var(--clr-white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 100px;
  border: 1px solid var(--clr-border);
}

.checkout-summary h3 {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--clr-border);
}

/* Simple item list for sidebar */
.mini-cart-list {
  margin-bottom: 2rem;
}

.mini-cart-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.mini-cart-item .name {
  color: var(--clr-text-main);
  max-width: 60%;
}

.mini-cart-item .price {
  font-weight: 600;
}

/* ==========================================================================
   SUCCESS MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(8, 28, 21, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.success-modal {
  background: var(--clr-white);
  padding: 4rem 3rem;
  border-radius: 16px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .success-modal {
  transform: scale(1);
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--clr-green-light);
  color: var(--clr-green-deep);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem auto;
  animation: bounce 1s ease 0.5s;
}

.success-modal h2 {
  color: var(--clr-green-forest);
  margin-bottom: 1rem;
}

.success-modal p {
  color: var(--clr-text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .checkout-layout { flex-direction: column; }
  .checkout-main, .checkout-sidebar { width: 100%; }
  .checkout-summary { position: static; }
}

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .step-header { padding: 1.5rem; }
  .step-content { padding: 1.5rem; }
}
