/* VTEX Checkout - Design System CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --color-primary: #FF0080;
  --color-text: #111111;
  --color-background: #FFFFFF;
  --color-button-primary-bg: #FF0080;
  --color-button-primary-text: #FFFFFF;
  --color-button-success-bg: #28a745;
  --color-button-success-text: #FFFFFF;
  --color-modal-bg: #FFFFFF;
  --color-modal-overlay: rgba(0,0,0,0.5);
  --color-link: #FF0080;
  --color-error: #ff0000;
  --color-border: #eaeaea;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 16px;
  --font-weight-normal: 400;
  --font-weight-bold: 700;
  --line-height: 1.5;

  /* Spacing */
  --spacing-unit: 8px;
  --padding-small: 8px;
  --padding-medium: 16px;
  --padding-large: 24px;
  --margin-small: 8px;
  --margin-medium: 16px;
  --margin-large: 24px;
  --gutter: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: #f8f9fa;
}

/* Container */
.container {
  max-width: 1200px;
  padding: 0 var(--padding-large);
  margin: 0 auto;
}

.container-fluid {
  width: 100%;
  padding: 0 var(--gutter);
  margin: 0 auto;
}

/* Header */
.x-header {
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.x-header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 93px;
  box-shadow: rgba(15, 31, 61, 0.4) 0px 3px 6px 0px;
}

.x-header__container > a {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.x-header__container > a svg,
.x-header__container > a img {
  width: 115px;
  height: 31px;
  display: block;
}

.x-header__security {
  font-size: 0.875rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}

.e-steps {
  list-style: none;
  display: flex;
  gap: var(--gutter);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  font-size: 1rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.step-number {
  background-color: var(--color-primary);
  color: var(--color-background);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.step-item.inactive {
  opacity: 0.4;
}

.step-item.inactive .step-number {
  background-color: #ccc;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  border: none;
  background-color: var(--color-button-primary-bg);
  color: var(--color-button-primary-text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-large {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

.btn-success {
  background-color: var(--color-button-success-bg);
  color: var(--color-button-success-text);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal */
.modal-overlay {
  background-color: var(--color-modal-overlay);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background-color: var(--color-modal-bg);
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0,0,0,.5);
  padding: var(--padding-large);
  max-width: 500px;
  width: 100%;
  z-index: 1050;
}

.modal-body {
  padding: var(--gutter);
}

.default-modal-security {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-bottom: var(--margin-small);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: 12px;
}

.modal-message {
  font-size: 1rem;
  margin-bottom: var(--gutter);
}

/* Icons */
.icon-lock::before {
  content: "\1F512";
}

.icon-spinner {
  animation: spin 1s linear infinite;
  font-size: 1.5rem;
  color: var(--color-primary);
}

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

/* Alerts */
.pci-alert-topbar {
  background-color: #fff3cd;
  color: #856404;
  padding: var(--padding-small) var(--gutter);
  font-size: 0.875rem;
  display: none;
  border-bottom: 1px solid #ffeeba;
}

.pci-alert-topbar.show {
  display: block;
}

.pci-alert-topbar a {
  color: var(--color-link);
  cursor: pointer;
  text-decoration: underline;
}

/* Message Close Button */
.vtex-front-messages-close-all {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  fill: var(--color-text);
}

/* Main Content */
.main-content {
  padding: 20px 0;
  min-height: calc(100vh - 200px);
}

/* Order Form Title */
.orderform-title {
  color: var(--color-primary);
  font-size: 25px;
  font-family: Lato, var(--font-family);
  font-weight: 800;
  text-align: center;
  margin: 30px 0 60px;
  padding: 0;
  line-height: 1.2;
}

/* Cart Items */
.cart-section {
  background: var(--color-background);
  padding: var(--padding-large);
  border-radius: 6px;
  margin-bottom: var(--margin-large);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 8px;
}

.cart-item:hover {
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(255,0,128,0.08);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cart-item-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--margin-small);
  line-height: 1.4;
  max-width: 100%;
  overflow-wrap: break-word;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: var(--padding-small);
  margin-top: var(--margin-small);
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: 2px solid #FF0080;
  background: #fff;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
  font-size: 16px;
  color: #FF0080;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: #FF0080;
  color: #fff;
  transform: scale(1.05);
}

.quantity-btn:active {
  transform: scale(0.95);
}

.quantity-value {
  min-width: 35px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a;
}

.cart-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.price-old {
  text-decoration: line-through;
  color: #999;
  font-size: 0.875rem;
}

.price-current {
  font-size: 1.375rem;
  font-weight: 700;
  color: #FF0080;
  letter-spacing: -0.02em;
}

.remove-item {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
  margin-top: var(--margin-small);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.remove-item:hover {
  color: #FF0080;
  background: #fff0f7;
}

/* Summary */
.cart-summary {
  background: var(--color-background);
  padding: var(--padding-large);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 100px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--padding-small) 0;
  font-size: 1rem;
}

.summary-row.total {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  border-top: 2px solid var(--color-border);
  padding-top: var(--padding-medium);
  margin-top: var(--padding-medium);
}

/* Forms */
.form-group {
  margin-bottom: var(--margin-medium);
}

.form-label {
  display: block;
  margin-bottom: var(--margin-small);
  font-weight: var(--font-weight-bold);
}

.form-control {
  width: 100%;
  padding: var(--padding-small) var(--padding-medium);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--font-family);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(255, 0, 128, 0.1);
}

.form-error {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: var(--margin-small);
}

/* Grid Layout */
.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--padding-large);
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: var(--padding-large) * 2;
}

.empty-cart-icon {
  font-size: 4rem;
  color: #ccc;
  margin-bottom: var(--margin-large);
}

.empty-cart-message {
  font-size: 1.25rem;
  color: #999;
  margin-bottom: var(--margin-large);
}

/* Payment Methods */
.payment-method {
  border: 2px solid var(--color-border);
  padding: var(--padding-medium);
  border-radius: 6px;
  margin-bottom: var(--margin-medium);
  cursor: pointer;
  transition: all 0.3s ease;
}

.payment-method:hover {
  border-color: var(--color-primary);
}

.payment-method.selected {
  border-color: var(--color-primary);
  background-color: rgba(255, 0, 128, 0.05);
}

.payment-method input[type="radio"] {
  margin-right: var(--margin-small);
}

/* Success Page */
.success-icon {
  width: 80px;
  height: 80px;
  background-color: var(--color-button-success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--margin-large);
  font-size: 2rem;
  color: white;
}

.success-message {
  text-align: center;
}

.order-number {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin: var(--margin-large) 0;
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
  }

  .cart-item-price {
    grid-column: 2;
    align-items: flex-start;
    margin-top: var(--margin-small);
  }

  .x-header__container {
    padding: 12px 20px;
    flex-direction: column;
    gap: 12px;
  }

  .e-steps {
    font-size: 0.75rem;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .step-item span:not(.step-number) {
    display: none;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .cart-summary {
    position: static;
    margin-top: var(--margin-large);
  }

  .container {
    padding: 0 var(--padding-medium);
  }

  .cart-section {
    padding: var(--padding-medium);
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .btn-large {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }

  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .x-header__security {
    font-size: 0.75rem;
  }

  .orderform-title {
    font-size: 20px;
    margin: 20px 0 40px;
  }
}

@media (max-width: 480px) {
  .x-header__container {
    padding: 10px 15px;
  }

  .x-header__container > a img {
    width: 90px;
    height: 24px;
  }

  .cart-item {
    grid-template-columns: 80px 1fr;
    padding: 16px;
    gap: 12px;
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
  }

  .cart-item-name {
    font-size: 0.9375rem;
    line-height: 1.3;
  }

  .price-current {
    font-size: 1.125rem;
  }

  .quantity-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .quantity-value {
    min-width: 28px;
    font-size: 0.9rem;
  }

  .remove-item {
    font-size: 0.8125rem;
  }

  .cart-section h2 {
    font-size: 1.25rem !important;
  }

  .summary-row {
    font-size: 0.875rem;
  }

  .summary-row.total {
    font-size: 1.25rem;
  }

  .step-number {
    width: 24px;
    height: 24px;
    font-size: 0.625rem;
  }

  .e-steps {
    gap: 4px;
  }
}

/* Loading Spinner */
.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

/* Collapsible Sections */
.checkout-step {
  background: var(--color-background);
  border: 2px solid var(--color-border);
  border-radius: 6px;
  margin-bottom: var(--margin-medium);
  overflow: hidden;
  transition: all 0.3s ease;
}

.checkout-step.active {
  border-color: var(--color-primary);
}

.checkout-step.completed {
  border-color: #28a745;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--padding-medium);
  cursor: pointer;
  background: #f8f9fa;
  transition: background 0.3s ease;
}

.step-header:hover {
  background: #e9ecef;
}

.checkout-step.completed .step-header {
  background: #e7f5ec;
}

.step-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: 1rem;
  flex-shrink: 0;
}

.checkout-step.completed .step-icon {
  background: #28a745;
}

.step-title {
  font-size: 1.125rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.step-summary {
  font-size: 0.875rem;
  color: #666;
  margin-top: 4px;
}

.step-edit-btn {
  background: none;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: var(--font-weight-bold);
  transition: all 0.3s ease;
}

.step-edit-btn:hover {
  background: var(--color-primary);
  color: white;
}

.step-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.checkout-step.active .step-content {
  max-height: 2000px;
  padding: var(--padding-large);
  padding-top: var(--padding-medium);
}

.step-actions {
  margin-top: var(--margin-large);
  display: flex;
  gap: var(--margin-medium);
}

.step-actions .btn {
  flex: 1;
}

/* Mobile adjustments for steps */
@media (max-width: 768px) {
  .step-header {
    padding: var(--padding-medium) var(--padding-small);
  }

  .step-icon {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
  }

  .step-title {
    font-size: 1rem;
  }

  .step-summary {
    font-size: 0.75rem;
  }

  .step-edit-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
  }

  .checkout-step.active .step-content {
    padding: var(--padding-medium);
  }
}

/* Checkout Banner */
.checkout-banner {
  max-width: 1200px;
  margin: -10px auto 30px;
  padding: 0 var(--padding-large);
}

.checkout-banner-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .checkout-banner {
    margin: -5px auto 20px;
    padding: 0 var(--padding-medium);
  }
}

/* Footer */
.e-footer__main__bottom {
  background-color: var(--color-primary);
  margin-top: 60px;
  padding: 40px 0;
  color: white;
}

.e-footer__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--padding-large);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.e-footer__payments,
.e-footer__security {
  display: block;
}

.e-footer__payments--list,
.e-footer__security--list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.e-footer__payments--title,
.e-footer__security--title {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 20px;
  color: white;
}

.e-footer__payments--list {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.e-footer__payments--item {
  background: white;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.e-footer__payments--item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.e-footer__payments--item svg {
  height: 38px;
  width: auto;
  max-width: 60px;
}

.e-footer__security--list {
  gap: 16px;
}

.e-footer__security--item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: white;
  line-height: 1.4;
}

.e-footer__security--item svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.e-footer__bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 20px;
  margin-top: 20px;
  text-align: center;
  color: white;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Responsive Footer */
@media (max-width: 768px) {
  .e-footer__main__bottom {
    margin-top: 40px;
    padding: 30px 0;
  }

  .e-footer__container {
    padding: 0 var(--padding-medium);
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .e-footer__payments--title,
  .e-footer__security--title {
    font-size: 0.75rem;
    margin-bottom: 15px;
  }

  .e-footer__payments--list {
    gap: 8px;
  }

  .e-footer__payments--item {
    padding: 6px 10px;
    min-height: 38px;
  }

  .e-footer__payments--item svg {
    height: 32px;
    max-width: 50px;
  }

  .e-footer__security--list {
    gap: 12px;
  }

  .e-footer__security--item {
    font-size: 0.75rem;
  }

  .e-footer__security--item svg {
    width: 20px;
    height: 20px;
  }

  .e-footer__bottom {
    font-size: 0.65rem;
    margin-top: 10px;
    padding-top: 15px;
  }
}

/* Shipping Options */
.shipping-option {
  transition: all 0.2s ease;
}

.shipping-option:hover {
  border-color: #FF0080 !important;
  background: #fff8fc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 0, 128, 0.1);
}

.shipping-option:has(input:checked) {
  border-color: #FF0080 !important;
  background: #fff0f7;
  box-shadow: 0 4px 12px rgba(255, 0, 128, 0.15);
}
