/* ========================================
   CHECKOUT PAGE - STYLES
   Multi-step checkout flow
   ======================================== */

/* ===== Variables ===== */
:root {
  --checkout-primary: #0c4326;
  --checkout-primary-light: #2d8f5f;
  --checkout-accent: #4ade80;
  --checkout-bg: #faf8f5;
  --checkout-card-bg: #ffffff;
  --checkout-border: rgba(26, 69, 46, 0.12);
  --checkout-text: #1a1a1a;
  --checkout-text-muted: #64748b;
  --checkout-error: #ef4444;
  --checkout-success: #22c55e;
}

/* ===== Base Layout ===== */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--checkout-bg);
}

/* ===== Header ===== */
.checkout-header {
  background: var(--checkout-primary);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.checkout-header .header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-header .header-logo img {
  height: 55px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

/* ===== Page Title ===== */
.checkout-page-title {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 2rem 0.25rem;
}

.checkout-page-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--checkout-primary);
  margin: 0;
  font-family: 'Inter', sans-serif;
}

/* ===== Header User Avatar (Chrome-style) ===== */
.header-user-avatar {
  position: relative;
}

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, #2d8f5f, #4ade80);
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.avatar-btn:hover {
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

.avatar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1rem;
  z-index: 200;
  animation: dropdownFadeIn 0.2s ease;
}

.avatar-dropdown.open {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.avatar-dropdown-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
}

.avatar-dropdown-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d8f5f, #4ade80);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.avatar-dropdown-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.avatar-dropdown-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-dropdown-email {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-dropdown-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0 0 0.5rem;
}

.avatar-dropdown-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-dropdown-logout:hover {
  background: #fef2f2;
  color: #ef4444;
}

.avatar-dropdown-logout svg {
  flex-shrink: 0;
}

/* ===== Continue Shopping - Header (hidden now) ===== */
.checkout-header .continue-shopping {
  display: none;
}

/* ===== Main Content ===== */
.checkout-main {
  flex: 1;
  padding: 2rem;
}

.checkout-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* ===== Progress Indicator ===== */
.checkout-progress {
  margin-bottom: 3rem;
  position: relative;
}

.progress-track {
  position: absolute;
  top: 20px;
  left: 10%;
  right: 10%;
  height: 4px;
  background: var(--checkout-border);
  border-radius: 2px;
  z-index: 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--checkout-primary), var(--checkout-primary-light));
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--checkout-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  position: relative;
}

.step-number {
  font-size: 1rem;
  font-weight: 600;
  color: var(--checkout-text-muted);
  transition: all 0.3s ease;
}

.step-check {
  display: none;
  color: white;
}

.step-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--checkout-text-muted);
  transition: all 0.3s ease;
}

/* Progress Step States */
.progress-step.active .step-circle {
  border-color: var(--checkout-primary);
  background: var(--checkout-primary);
}

.progress-step.active .step-number {
  color: white;
}

.progress-step.active .step-label {
  color: var(--checkout-primary);
  font-weight: 600;
}

.progress-step.completed .step-circle {
  border-color: var(--checkout-success);
  background: var(--checkout-success);
}

.progress-step.completed .step-number {
  display: none;
}

.progress-step.completed .step-check {
  display: block;
}

.progress-step.completed .step-label {
  color: var(--checkout-success);
}

/* ===== Checkout Content ===== */
.checkout-content {
  background: var(--checkout-card-bg);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 2.5rem;
  margin-bottom: 2rem;
  min-height: 400px;
}

.checkout-step {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.step-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0 0 0.5rem;
}

.step-header p {
  font-size: 1rem;
  color: var(--checkout-text-muted);
  margin: 0;
}

/* ===== Cart Container (Step 1) ===== */
.cart-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #f8faf9;
  border-radius: 16px;
  border: 1px solid var(--checkout-border);
  transition: all 0.3s ease;
}

.cart-item:hover {
  border-color: var(--checkout-primary-light);
  box-shadow: 0 4px 15px rgba(26, 69, 46, 0.08);
}

.cart-item-image {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cart-item-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0 0 0.25rem;
}

.cart-item-meta {
  font-size: 0.875rem;
  color: var(--checkout-text-muted);
  margin: 0 0 1rem;
}

.cart-item-meta span {
  display: inline-block;
}

.cart-item-meta span:not(:last-child)::after {
  content: '•';
  margin: 0 0.5rem;
  color: var(--checkout-border);
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quantity-label {
  font-size: 0.875rem;
  color: var(--checkout-text-muted);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: white;
  border: 1px solid var(--checkout-border);
  border-radius: 8px;
  overflow: hidden;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  color: var(--checkout-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: rgba(26, 69, 46, 0.08);
}

.quantity-btn:disabled {
  color: var(--checkout-text-muted);
  cursor: not-allowed;
}

.quantity-value {
  width: 40px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--checkout-text);
  border-left: 1px solid var(--checkout-border);
  border-right: 1px solid var(--checkout-border);
  padding: 0.5rem 0;
}

.cart-item-actions {
  display: flex;
  align-items: flex-start;
}

.remove-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid #e0e0e0;
  background: #fafafa;
  color: #b0b0b0;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.remove-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}

.remove-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(239,68,68,0.15);
  transform: scale(1.08);
}

.remove-btn:hover svg {
  transform: rotate(-8deg);
}

.remove-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* ===== Cart Item Tags (size / board / face) ===== */
.cart-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.cart-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.tag-size {
  background: rgba(26, 69, 46, 0.08);
  color: var(--checkout-primary);
}

.tag-board {
  background: rgba(183, 150, 88, 0.15);
  color: #8b6914;
}

.tag-face {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

/* ===== Cart Item Bottom Row (qty + price) ===== */
.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cart-item-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--checkout-primary);
  white-space: nowrap;
}

/* ===== Cart Totals ===== */
.cart-totals {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
  background: #f8faf9;
  border-radius: 12px;
  border: 1px solid var(--checkout-border);
}

.cart-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--checkout-text-muted);
}

.cart-totals-grand {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--checkout-primary);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--checkout-primary);
}

/* ===== Product Detail Specs (Step 2 read-only) ===== */
.product-detail-specs {
  padding: 0.75rem 0 0;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: var(--checkout-text-muted);
  font-weight: 500;
}

.spec-value {
  color: var(--checkout-text);
  font-weight: 600;
}

.spec-total {
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--checkout-border);
}

.spec-total .spec-value {
  color: var(--checkout-primary);
  font-weight: 700;
}

/* ===== Summary Pricing Totals (Step 3) ===== */
.summary-pricing-totals {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #f8faf9;
  border-radius: 12px;
  border: 1px solid var(--checkout-border);
}

.summary-pricing-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--checkout-text-muted);
}

.summary-pricing-grand {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--checkout-primary);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--checkout-primary);
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-cart-icon {
  color: var(--checkout-text-muted);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-cart h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0 0 0.5rem;
}

.empty-cart p {
  font-size: 1rem;
  color: var(--checkout-text-muted);
  margin: 0 0 2rem;
}

/* ===== Details Form (Step 2) ===== */
.details-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-section {
  background: #f8faf9;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--checkout-border);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--checkout-border);
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--checkout-primary), var(--checkout-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.section-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--checkout-text);
}

.form-group label .required {
  color: var(--checkout-error);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--checkout-border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(12, 67, 38, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--checkout-error);
}

.form-group input:read-only {
  background: #f1f5f9;
  color: var(--checkout-text-muted);
}

/* Phone input with country code dropdown */
.phone-input-wrapper {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.phone-input-wrapper .country-code-select {
  flex: 0 0 auto;
  width: 110px;
  padding: 0.875rem 0.5rem 0.875rem 0.75rem;
  border: 1.5px solid var(--checkout-border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #f8faf8;
  color: var(--checkout-text);
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}

.phone-input-wrapper .country-code-select:focus {
  outline: none;
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(12, 67, 38, 0.1);
}

.phone-input-wrapper input[type="tel"] {
  flex: 1;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--checkout-border);
  border-left: 1px solid var(--checkout-border);
  border-radius: 0 10px 10px 0;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: all 0.3s ease;
}

.phone-input-wrapper input[type="tel"]:focus {
  outline: none;
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(12, 67, 38, 0.1);
}

.phone-input-wrapper input[type="tel"].error {
  border-color: var(--checkout-error);
}

.form-group .error-message {
  font-size: 0.75rem;
  color: var(--checkout-error);
  min-height: 1rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Product Details Cards */
.product-details-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.product-detail-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--checkout-border);
}

.product-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--checkout-border);
}

.product-detail-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0 0 0.25rem;
}

.product-detail-info p {
  font-size: 0.875rem;
  color: var(--checkout-text-muted);
  margin: 0;
}

.product-detail-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Size Select Dropdown */
.size-select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--checkout-border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 3rem;
}

.size-select:focus {
  outline: none;
  border-color: var(--checkout-primary);
  box-shadow: 0 0 0 3px rgba(12, 67, 38, 0.1);
}

.size-select:hover {
  border-color: var(--checkout-primary-light);
}

.size-select option {
  padding: 0.75rem;
}

.size-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.size-inputs input {
  flex: 1;
  padding: 0.75rem;
  border: 1.5px solid var(--checkout-border);
  border-radius: 8px;
  font-size: 0.9375rem;
  text-align: center;
}

.size-inputs input:focus {
  outline: none;
  border-color: var(--checkout-primary);
}

.size-inputs span {
  font-size: 1.25rem;
  color: var(--checkout-text-muted);
}

.size-unit {
  font-size: 0.875rem;
  color: var(--checkout-text-muted);
}

/* ===== Summary (Step 3) ===== */
.summary-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.summary-section {
  background: #f8faf9;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--checkout-border);
}

.summary-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--checkout-border);
}

.summary-section-header svg {
  color: var(--checkout-primary);
}

.summary-section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0;
  flex: 1;
}

.edit-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--checkout-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.edit-btn:hover {
  background: rgba(12, 67, 38, 0.08);
}

.summary-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.9375rem;
}

.summary-row .label {
  color: var(--checkout-text-muted);
}

.summary-row .value {
  color: var(--checkout-text);
  font-weight: 500;
  text-align: right;
}

.summary-product {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--checkout-border);
}

.summary-product-image {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
}

.summary-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-product-details {
  flex: 1;
}

.summary-product-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0 0 0.25rem;
}

.summary-product-meta {
  font-size: 0.8125rem;
  color: var(--checkout-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ===== Success Step ===== */
.success-container {
  text-align: center;
  padding: 3rem 2rem;
}

.success-icon-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.1) 0%, rgba(34,197,94,0.05) 60%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  animation: ringPulse 2s ease infinite;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--checkout-success), #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.35);
  animation: checkBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes checkBounce {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.2); }
  50% { box-shadow: 0 0 0 20px rgba(34, 197, 94, 0); }
}

.success-icon svg {
  animation: drawCheck 0.5s ease 0.5s both;
}

@keyframes drawCheck {
  0% { stroke-dasharray: 30; stroke-dashoffset: 30; opacity: 0; }
  100% { stroke-dasharray: 30; stroke-dashoffset: 0; opacity: 1; }
}

.success-container h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--checkout-text);
  margin: 0 0 0.75rem;
}

.success-method-text {
  font-size: 1rem;
  color: var(--checkout-text-muted);
  max-width: 500px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

.success-ref {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--checkout-primary);
  background: rgba(12, 67, 38, 0.06);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
}

.success-ref:empty {
  display: none;
}

.success-details {
  background: #f8faf9;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: left;
  max-width: 400px;
  margin: 0 auto 2rem;
}

.success-details p {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--checkout-text);
  margin: 0 0 1rem;
}

.success-details ul {
  margin: 0;
  padding-left: 1.25rem;
}

.success-details li {
  font-size: 0.875rem;
  color: var(--checkout-text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Navigation Buttons ===== */
.checkout-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--checkout-primary), var(--checkout-primary-light));
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(12, 67, 38, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(12, 67, 38, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: var(--checkout-primary);
  border: 2px solid var(--checkout-border);
}

.btn-secondary:hover {
  border-color: var(--checkout-primary);
  background: rgba(12, 67, 38, 0.04);
}

/* Download PDF Button */
.btn-download-pdf {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  color: var(--checkout-primary);
  border: 2px solid var(--checkout-primary);
  box-shadow: 0 2px 8px rgba(12, 67, 38, 0.08);
}

.btn-download-pdf:hover:not(:disabled) {
  background: var(--checkout-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(12, 67, 38, 0.25);
}

.btn-download-pdf:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ===== Footer ===== */
.checkout-footer {
  background: var(--checkout-primary);
  padding: 1.5rem 2rem;
  margin-top: auto;
}

.checkout-footer .footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.checkout-footer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin: 0;
}

.checkout-footer .footer-links {
  display: flex;
  gap: 1.5rem;
}

.checkout-footer .footer-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.checkout-footer .footer-links a:hover {
  color: white;
}

/* Continue Shopping - Bottom (next to Next button) */
.continue-shopping-bottom {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--checkout-primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--checkout-primary);
  border-radius: 12px;
  transition: all 0.3s ease;
  background: transparent;
  margin-right: auto;
}

.continue-shopping-bottom:hover {
  background: rgba(12, 67, 38, 0.05);
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
  .checkout-header {
    padding: 0.5rem 1rem;
  }

  .checkout-header .header-container {
    justify-content: space-between;
  }

  .checkout-header .header-logo img {
    height: 40px;
  }

  .checkout-page-title {
    padding: 1rem 1rem 0.25rem;
  }

  .checkout-page-title h1 {
    font-size: 1.35rem;
  }

  .continue-shopping-bottom {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
    margin-right: 0;
    order: 1;
  }

  .checkout-navigation {
    flex-direction: column;
    gap: 0.75rem;
  }

  .checkout-navigation .btn-primary,
  .checkout-navigation .btn-secondary {
    flex: unset;
    width: 100%;
    padding: 1rem;
  }
  
  .checkout-main {
    padding: 1rem;
  }
  
  .checkout-content {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  .progress-track {
    left: 5%;
    right: 5%;
  }
  
  .step-circle {
    width: 36px;
    height: 36px;
  }
  
  .step-number {
    font-size: 0.875rem;
  }
  
  .step-label {
    font-size: 0.75rem;
  }
  
  .cart-item {
    flex-direction: column;
    gap: 1rem;
  }
  
  .cart-item-image {
    width: 100%;
    height: 160px;
  }
  
  .cart-item-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
  
  .cart-item {
    position: relative;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .product-detail-fields {
    grid-template-columns: 1fr;
  }
  
  .checkout-navigation {
    flex-direction: column;
  }
  
  .btn-primary,
  .btn-secondary,
  .continue-shopping-bottom {
    width: 100%;
  }
  
  .checkout-footer .footer-container {
    flex-direction: column;
    text-align: center;
  }
  
  .checkout-footer .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .step-header h2 {
    font-size: 1.375rem;
  }
  
  .section-header h3 {
    font-size: 1rem;
  }
  
  .product-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .size-inputs {
    flex-wrap: wrap;
  }
  
  .size-inputs input {
    min-width: 60px;
  }
  
  .success-actions {
    flex-direction: column;
  }
  
  .success-actions .btn-primary,
  .success-actions .btn-secondary {
    width: 100%;
  }
}

/* ===== Welcome Back Banner (disabled — user info in header avatar) ===== */
.welcome-back-banner {
  display: none !important;
}

/* ===== Previous Orders ===== */
.previous-orders-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--checkout-border);
}
.previous-orders-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.prev-order-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--checkout-card-bg);
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  transition: all 0.2s ease;
}
.prev-order-card:hover {
  border-color: var(--checkout-primary);
  box-shadow: 0 2px 12px rgba(12, 67, 38, 0.08);
}
.prev-order-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 90px;
}
.prev-order-ref {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--checkout-primary);
}
.prev-order-date {
  font-size: 0.75rem;
  color: var(--checkout-text-muted);
}
.prev-order-body {
  flex: 1;
  min-width: 0;
}
.prev-order-items {
  margin: 0;
  font-size: 0.85rem;
  color: var(--checkout-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prev-order-qty {
  font-size: 0.75rem;
  color: var(--checkout-text-muted);
}
.prev-order-reorder {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: var(--checkout-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.prev-order-reorder:hover {
  background: var(--checkout-primary-light);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .prev-order-card {
    flex-wrap: wrap;
  }
  .prev-order-header {
    min-width: auto;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
  }
  .prev-order-reorder {
    width: 100%;
    justify-content: center;
  }
}
