/* Checkout Page Styles */
.checkout-page {
  min-height: calc(100vh - 80px);
  padding: 120px 0 40px 0;
  background: #f8f9fa;
}

.checkout-steps {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.9rem;
}

/* Checkout Navbar Specific Styling */
.checkout-page .navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.checkout-page .navbar .logo img {
  filter: none;
}

.step {
  color: #6c757d;
}

.step.active {
  color: #081a30;
  font-weight: 600;
}

.step-divider {
  color: #dee2e6;
}

/* Checkout Grid */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
  max-width: 1200px;
  min-width: 0;
  margin: 0 auto;
}

/* Checkout Main */
.checkout-main {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  box-sizing: border-box;
  min-width: 0;
}

.checkout-main h1 {
  margin-bottom: 30px;
  color: #081a30;
  font-size: 2rem;
}

/* Checkout Sections */
.checkout-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 2px solid #e9ecef;
}

.checkout-section:last-of-type {
  border-bottom: none;
}

.checkout-section h2 {
  margin-bottom: 20px;
  color: #081a30;
  font-size: 1.25rem;
}

/* Form Styles */
.form-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: none;
}

.form-group input,
.form-group select {
  padding: 14px 15px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

.form-group input::placeholder {
  color: #999;
  font-weight: 400;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  color: #333;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
}

.form-group select option[value=""] {
  color: #999;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #081a30;
  box-shadow: 0 0 0 3px rgba(8, 26, 48, 0.1);
}

/* Shipping Options */
.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.shipping-option {
  display: flex;
  align-items: center;
  padding: 20px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.shipping-option:hover {
  border-color: #081a30;
  background: #f8f9fa;
}

.shipping-option input[type="radio"] {
  margin-right: 15px;
}

.shipping-option input[type="radio"]:checked + .shipping-details {
  font-weight: 500;
}

.shipping-option:has(input:checked) {
  border-color: #081a30;
  background: rgba(8, 26, 48, 0.05);
}

.shipping-details {
  display: flex;
  justify-content: space-between;
  flex: 1;
  align-items: center;
}

.shipping-time {
  display: block;
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 400;
  margin-top: 2px;
}

.shipping-price {
  font-weight: 600;
  color: #081a30;
}

/* Payment Element */
#payment-element {
  min-height: 300px;
  padding: 20px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

#payment-message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.9rem;
}

#payment-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

#payment-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Submit Button */
#submit {
  margin-top: 30px;
  padding: 15px 30px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#submit.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

#spinner {
  display: inline-block;
}

/* Order Summary Sidebar */
.checkout-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  min-width: 0;
}

.order-summary {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.order-summary h2 {
  margin-bottom: 20px;
  color: #081a30;
  font-size: 1.25rem;
}

/* Order Items */
#order-items {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.order-item {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.order-item-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: #f8f9fa;
}

.order-item-details {
  flex: 1;
  min-width: 0;
}

.order-item-name {
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.order-item-qty {
  color: #6c757d;
  font-size: 0.85rem;
}

.order-item-price {
  font-weight: 600;
  color: #081a30;
  white-space: nowrap;
}

/* Summary Totals */
.summary-totals {
  padding-top: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
  color: #495057;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  padding: 15px 0 0;
  margin-top: 15px;
  border-top: 2px solid #e9ecef;
  font-size: 1.25rem;
  font-weight: 600;
  color: #081a30;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #081a30;
  color: white;
}

.btn-primary:hover:not(.loading) {
  background: #0a2344;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(8, 26, 48, 0.2);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
  
  .checkout-sidebar {
    position: static;
    order: -1;
  }
  
  .checkout-steps {
    display: none;
  }
}

@media (max-width: 768px) {
  .checkout-page {
    padding: 96px 0 24px;
  }

  .checkout-page > .container {
    width: 100%;
    max-width: none;
    padding: 0 16px;
    box-sizing: border-box;
  }

  .checkout-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .checkout-sidebar {
    display: contents;
  }

  .order-summary {
    order: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
  }

  .checkout-main {
    order: 2;
    width: 100%;
    padding: 20px;
  }

  .also-like-section {
    order: 3;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    padding: 8px 0 0;
  }

  .checkout-main h1 {
    margin-bottom: 24px;
    font-size: 1.75rem;
  }

  .checkout-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
  }

  .checkout-section h2 {
    margin-bottom: 14px;
    font-size: 1.1rem;
  }

  .checkout-main {
    min-width: 0;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }

  .checkout-main .form-row[style] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-group input,
  .form-group select {
    min-width: 0;
    padding: 13px 14px;
  }

  .email-optin {
    padding-bottom: 20px !important;
    margin-top: -4px !important;
  }

  .shipping-options {
    gap: 10px;
  }

  .shipping-option {
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .shipping-option input[type="radio"] {
    flex: 0 0 auto;
    margin: 3px 0 0;
  }

  .shipping-details {
    min-width: 0;
    gap: 10px;
    flex-wrap: wrap;
  }

  .shipping-details > div:first-child {
    min-width: 0;
    flex: 1 1 150px;
  }

  .shipping-price {
    margin-left: auto;
    white-space: nowrap;
  }

  #payment-element {
    min-height: 260px;
    padding: 14px;
    box-sizing: border-box;
  }

  #submit {
    margin-top: 20px;
    padding: 14px 20px;
  }

  .terms-label {
    align-items: flex-start;
  }

  .terms-text {
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .summary-row,
  .summary-total {
    gap: 16px;
  }

  .summary-row > span:last-child,
  .summary-total > span:last-child {
    white-space: nowrap;
  }
}

/* You May Also Like */
.also-like-section {
  margin-top: 40px;
  padding: 30px 0;
}

.also-like-section h2 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: #081a30;
}

.also-like-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.also-like-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.also-like-card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.also-like-link {
  flex-grow: 1;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.also-like-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.also-like-card .also-like-info {
  padding: 10px 12px;
}

.also-like-card .also-like-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #081a30;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.also-like-card .also-like-collection {
  font-size: 0.75rem;
  color: #6c757d;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.also-like-card .also-like-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: #081a30;
}

.also-like-btn-add {
  background: #081a30;
  color: #fff;
  border: none;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0 0 8px 8px;
  transition: background 0.2s;
}

.also-like-btn-add:hover {
  background: #0b2447;
}

.also-like-card .also-like-type {
  display: inline-block;
  font-size: 0.65rem;
  background: #e8f0fe;
  color: #1a5276;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

@media (max-width: 768px) {
  .also-like-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Terms & Conditions Checkbox */
.terms-checkbox-wrapper {
  margin-top: 24px;
  margin-bottom: 0;
}

.terms-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #333;
  user-select: none;
}

.terms-label input[type="checkbox"] {
  display: none;
}

.terms-checkmark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
}

.terms-label input[type="checkbox"]:checked ~ .terms-checkmark {
  background: #081a30;
  border-color: #081a30;
}

.terms-label input[type="checkbox"]:checked ~ .terms-checkmark::after {
  content: '';
  display: block;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.terms-text a {
  color: #19376D;
  text-decoration: underline;
  font-weight: 500;
}

.terms-text a:hover {
  color: #081a30;
}

.terms-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin: 8px 0 0 32px;
}

.terms-checkbox-wrapper.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Policy Note in Order Summary */
.order-policy-note {
  font-size: 0.78rem;
  color: #6c757d;
  line-height: 1.5;
  margin: 16px 0 0 0;
  text-align: center;
}

.order-policy-note a {
  color: #19376D;
  text-decoration: underline;
}

.order-policy-note a:hover {
  color: #081a30;
}

/* Loading State */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #081a30;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}