/* Checkout Page Styles - Optimized for Mobile and Proper Padding */

/* Loader wrapper with better positioning */
.loader-wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  text-align: center;
  margin: 0;
  opacity: 0.1;
  z-index: 999999;
}

/* Checkout container with proper padding and responsive design */
#box-checkout {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  margin: 24px auto;
  max-width: 1200px;
  width: 100%;
  box-sizing: border-box;
}

/* Responsive adjustments for checkout container */
@media (max-width: 768px) {
  #box-checkout {
    margin: 16px auto;
    padding: 16px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  #box-checkout {
    margin: 12px auto;
    padding: 12px;
    border-radius: 10px;
  }
}

/* Checkout grid layout with proper spacing */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
}

@media (min-width: 768px) {
  .checkout-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1200px) {
  .checkout-grid {
    grid-template-columns: 2fr 1fr;
    gap: 32px;
  }
}

/* Cart section styling */
#box-checkout-cart {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 24px;
}

#box-checkout-cart .card-header {
  background: var(--gray-100);
  color: #374151;
  border-radius: 12px 12px 0 0;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

#box-checkout-cart .card-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

#box-checkout-cart .headings {
  background: #fff;
  border-bottom: 2px solid var(--gray-200);
  padding: 12px 20px;
  font-weight: 600;
  color: var(--gray-600);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 768px) {
  #box-checkout-cart .headings {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }
}

#box-checkout-cart .items {
  background: #fff;
}

#box-checkout-cart .item {
  border-bottom: 1px solid #f1f5f9;
  padding: 20px;
  transition: all 0.2s ease;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}

@media (max-width: 768px) {
  #box-checkout-cart .item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
}

.total-price {
  font-size:28px;
}

@media (max-width: 480px) {
  .total-price { font-size: 1.5rem; }
}

.cartitemactions {
  display:flex;
  flex-direction:row;
  gap:8px;
}


.cartitemsactionadnprice {
  display:flex; gap:20px; flex-direction:row;
}
@media(max-width:520px) {
    .cartitemsactionadnprice {
      flex-direction:column;
    }

}
#box-checkout-cart .item:hover {
  background: var(--gray-100);
}

#box-checkout-cart .checkoutimagedescription {
  margin-top: 12px;
  padding: 12px;
  background: var(--gray-100);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
}

@media (max-width: 600px) {
  #box-checkout-cart .checkoutimagedescription {
    flex-direction: column;
    gap: 8px;
  }
}

#box-checkout-cart .name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

#box-checkout-cart .input-group {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#box-checkout-cart .input-group input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  width: 60px;
  text-align: center;
}

#box-checkout-cart .btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

#box-checkout-cart .btn-primary {
  background: var(--color-accent-gradient);
  border: none;
  color: #fff;
}

#box-checkout-cart .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#box-checkout-cart .btn-default {
  background: #f1f5f9;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
}

#box-checkout-cart .btn-default:hover {
  background: var(--gray-200);
  color: var(--gray-600);
}

/* Customer section styling */
#box-checkout-customer {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 24px;
}

#box-checkout-customer .card-header {
  background: var(--gray-100);
  color: #374151;
  border-radius: 12px 12px 0 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

#box-checkout-customer .card-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

#box-checkout-customer .card-body {
  padding: 20px;
}

#box-checkout-customer fieldset {
  border: none;
  padding: 0;
  margin-bottom: 20px;
}

#box-checkout-customer .form-group {
  margin-bottom: 16px;
  width: 100%;
}

#box-checkout-customer .form-group label {
display:flex;
gap:20px;
flex-direction: row;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 0.875rem;
}

#box-checkout-customer .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #fff;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

#box-checkout-customer .form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Fix overflow issues on small screens */
@media (max-width: 480px) {
  /* Force all columns to stack on very small screens */
  #box-checkout .row [class*="col-xs-"] {
    grid-column: span 12 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  #box-checkout-customer .form-control {
    padding: 10px 12px;
    font-size: 0.95rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  #box-checkout-customer .form-group {
    margin-bottom: 12px;
    padding: 0 !important;
  }
  
  #box-checkout-customer .form-group label {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }
  
  /* Specific fixes for phone inputs that might have icons */
  #box-checkout-customer input[type="tel"],
  #box-checkout-customer input[type="phone"],
  #box-checkout-customer .phone-field {
    padding-right: 12px;
    padding-left: 12px;
  }
  
  /* Ensure any input wrapper elements don't cause overflow */
  #box-checkout-customer .input-group {
    flex-wrap: wrap;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  #box-checkout-customer .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
  }
  
  /* Fix row padding and gaps */
  #box-checkout .row {
    gap: 8px !important;
    padding: 0 !important;
  }
}

#box-checkout-customer button[type=submit]:not([disabled]) {
  font-weight: bold;
  color: #fff;
  background: var(--color-accent-gradient);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.2s ease;
}

#box-checkout-customer button[type=submit]:not([disabled]):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Shipping and Payment sections */
#box-checkout-shipping,
#box-checkout-payment {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 24px;
}

#box-checkout-shipping .card-header,
#box-checkout-payment .card-header {
  background: var(--gray-100);
  color: #374151;
  border-radius: 12px 12px 0 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

#box-checkout-shipping .card-header h2,
#box-checkout-payment .card-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

#box-checkout-shipping .card-body,
#box-checkout-payment .card-body {
  padding: 20px;
}

@media (max-width: 480px) {
  #box-checkout-customer .card-body,
  #box-checkout-shipping .card-body,
  #box-checkout-payment .card-body { padding: 12px; }
}

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

.shipping-option {
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  display: block;
  width: 100%;
  text-align: left;
  box-shadow: none;
}

.shipping-option:hover {
  border-color: #cbd5e1;
  background: var(--gray-100);
}

.shipping-option.active {
  border-color: var(--color-accent);
  background: #f8faff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.shipping-option.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.shipping-option input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--color-accent);
}

.option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.option-info {
  flex: 1;
  min-width: 0;
}

.module-title {
  font-weight: 700;
  color: var(--gray-800);
  font-size: 1rem;
  margin-bottom: 4px;
}

.option-name {
  color: var(--gray-500);
  font-size: 0.9rem;
  font-weight:bold;
}

.option-price {
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
}

.option-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 8px;
  padding: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
}

.option-content {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.option-description {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.option-fields {
  font-size: 0.9rem;
  color: #374151;
}

/* Remove default btn-group styling that causes full width */
.shipping-options .btn-group-vertical {
  width: auto;
}

.shipping-options .btn-group-vertical .btn {
  width: auto;
  flex: none;
}

/* Responsive adjustments for shipping options */
@media (max-width: 768px) {
  .shipping-option {
    padding: 12px;
    margin-bottom: 8px;
  }
  
  .option-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .option-price {
    align-self: flex-end;
  }
  
  .module-title {
    font-size: 0.95rem;
  }
  
  .option-name {
    font-size: 0.875rem;

  }
}

@media (max-width: 480px) {
  .shipping-option {
    padding: 10px;
  }
  
  .module-title {
    font-size: 0.9rem;
  }
  
  .option-name {
    font-size: 0.8rem;
  }
  
  .option-price {
    font-size: 0.8rem;
    padding: 3px 6px;
  }
}

.checkout-option {
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}

.checkout-option:hover {
  border-color: #cbd5e1;
}

.checkout-option.active {
  border-color: var(--color-accent);
  background: #f8faff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.checkout-option input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--color-accent);
}

.checkout-option .option-title {
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.checkout-option .option-description {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.checkout-option .option-price {
  font-weight: 700;
  color: var(--gray-800);
  margin-left: auto;
}

.checkout-option-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Summary section styling */
#box-checkout-summary {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}

#box-checkout-summary .card-body {
  padding: 24px;
}

#box-checkout-summary .comments {
  margin-bottom: 24px;
}

#box-checkout-summary .comments label {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  display: block;
}

#box-checkout-summary .input-wrapper {
  position: relative;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

#box-checkout-summary .input-wrapper:focus-within {
  border-color: var(--color-accent);
}

#box-checkout-summary textarea {
  width: 100%;
  border: none;
  outline: none;
  padding: 16px;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  background: #fff;
}

#box-checkout-summary .remaining {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.875rem;
  color: var(--gray-400);
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

#box-checkout-summary .confirm {
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  padding: 20px;
  border-radius: 0 0 12px 12px;
}

#box-checkout-summary .confirm .error {
  background: #fef2f2;
  color: #dc2626;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

#box-checkout-summary .confirm .consent {
  background: #fff;
  border: 1px solid var(--gray-200);
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
}

#box-checkout-summary .confirm .consent label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 1rem;
}

#box-checkout-summary .confirm .consent input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-accent);
}

#box-checkout-summary .confirm button[type="submit"] {
  background: linear-gradient(135deg, var(--color-confirm) 0%, var(--color-confirm-dark) 100%);
  border: none;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
  width: 100%;
}

#box-checkout-summary .confirm button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

#box-checkout-summary .confirm button[type="submit"]:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Progress indicators for checkout steps */
.checkout-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 20px;
}

.checkout-step {
  flex: 1;
  text-align: center;
  position: relative;
  padding-bottom: 20px;
}

.checkout-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 60%;
  right: -40%;
  height: 2px;
  background: var(--gray-200);
  z-index: 1;
}

.checkout-step .step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 8px;
  position: relative;
  z-index: 2;
}

.checkout-step .step-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 600;
}

.checkout-step.active .step-circle {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.checkout-step.active .step-label {
  color: var(--gray-700);
}

.checkout-step.completed .step-circle {
  background: var(--color-confirm);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.checkout-step.completed .step-label {
  color: var(--color-confirm-dark);
}

/* Form enhancements */
.checkout-form-group {
  margin-bottom: 20px;
}

.checkout-form-group label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.checkout-form-group input,
.checkout-form-group select,
.checkout-form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: #fff;
}

.checkout-form-group input:focus,
.checkout-form-group select:focus,
.checkout-form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkout-form-group .form-control {
  border-radius: 12px;
  border: 2px solid var(--gray-200);
}

.checkout-form-group .form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Responsive improvements for all sections */
@media (max-width: 768px) {
  /* Mobile form improvements */
  .checkout-form-group {
    margin-bottom: 16px;
  }
  
  .checkout-form-group label {
    font-size: 0.875rem;
    margin-bottom: 6px;
  }
  
  .checkout-form-group input,
  .checkout-form-group select,
  .checkout-form-group textarea {
    padding: 12px;
    font-size: 1rem;
  }
  
  /* Mobile card adjustments */
  .card {
    margin-bottom: 16px;
  }
  
  .card-header {
    padding: 12px 16px;
  }
  
  .card-body {
    padding: 16px;
  }
  
  /* Mobile button improvements */
  .btn {
    padding: 10px 16px;
    font-size: 1rem;
    width: 100%;
  }
  
  /* Mobile grid adjustments */
  .row {
    gap: 16px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  /* Mobile checkout grid */
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Mobile summary adjustments */
  #box-checkout-summary .card-body {
    padding: 16px;
  }
  
  #box-checkout-summary .confirm {
    padding: 16px;
  }
  
  /* Mobile option styling */
  .checkout-option {
    padding: 12px;
    margin-bottom: 8px;
  }
  
  .checkout-option-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .checkout-option .option-price {
    margin-left: 0;
    margin-top: 8px;
  }
  
  /* Mobile progress indicators */
  .checkout-steps {
    padding: 0 10px;
    flex-direction: column;
    gap: 16px;
  }
  
  .checkout-step:not(:last-child)::after {
    display: none;
  }
  
  .checkout-step {
    padding-bottom: 10px;
    text-align: left;
  }
  
  .checkout-step::after {
    content: '→';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-200);
    font-size: 1.5rem;
    z-index: 1;
  }
  
  .checkout-step:last-child::after {
    display: none;
  }
  
  /* Mobile cart adjustments */
  #box-checkout-cart .headings {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }
  
  #box-checkout-cart .item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  
  #box-checkout-cart .checkoutimagedescription {
    margin-top: 8px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  /* Extra small mobile adjustments */
  #box-checkout {
    margin: 12px auto;
    padding: 12px;
  }
  
  .checkout-form-group input,
  .checkout-form-group select,
  .checkout-form-group textarea {
    padding: 10px;
    font-size: 0.9rem;
  }
  
  .checkout-option {
    padding: 10px;
  }
  
  .checkout-option .option-title {
    font-size: 0.9rem;
  }
  
  .checkout-option .option-description {
    font-size: 0.8rem;
  }
}

/* Ensure all wrapper elements stay within bounds */
.wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Fix any remaining overflow issues */
#box-checkout * {
  box-sizing: border-box;
  max-width: 100%;
}

/* Fix fourteen-forty container overflow */
.fourteen-forty #box-checkout {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.fourteen-forty #box-checkout .row {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.fourteen-forty .customer.wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Flash animation for required checkboxes */
@keyframes flasher {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 2em 1px #ff0000;
  }
}

/* Checkout Page Header Specific Styles */
/* Fix header alignment and spacing issues only on checkout page */
#box-checkout .header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#box-checkout .header .logotype {
  display: flex;
  align-items: center;
  justify-content: center;
}

#box-checkout .header .imageonnav {
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

#box-checkout .header .imageonnav a {
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  transition: color 0.2s ease;
}

#box-checkout .header .imageonnav a:hover {
  color: var(--color-accent);
}

/* Mobile responsive improvements for checkout header */
@media (max-width: 768px) {
  #box-checkout .header {
    padding: 16px 20px;
    gap: 16px;
    min-height: auto;
  }
  
  #box-checkout .header .logotype {
    order: -1;
    margin-bottom: 8px;
  }
  
  #box-checkout .header .imageonnav {
    gap: 16px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
    margin-top: 0;
  }
  
  #box-checkout .header .imageonnav a {
    font-size: 14px;
  }
}

/* Ensure header stays within bounds */
#box-checkout .header {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

#box-checkout .header * {
  box-sizing: border-box;
}

.account h3{
  display:flex;
  flex-direction: row;
  gap:20px;
  margin: 0px 0px 8px 0px;
}