/* 
 * Shopify-Grade COD Design System v3
 * Features: Floating Labels, Semantic Steps, Trust Grid
 */

:root {
  /* Brand & Functional Colors */
  --color-primary: #0F172A;
  --color-primary-soft: #334155;
  --color-action: #2563EB;
  --color-action-hover: #1D4ED8;
  --color-accent: #10B981;
  --color-bg-body: #F8FAFC;
  --color-bg-surface: #FFFFFF;
  --color-bg-input: #F1F5F9;
  --color-border: #E2E8F0;
  --color-text-main: #0F172A;
  --color-text-muted: #64748B;

  /* Shape & Depth */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap');

body {
  font-family: 'Cairo', sans-serif !important;
  background-color: var(--color-bg-body);
  color: var(--color-text-main);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Cairo', sans-serif;
  color: var(--color-primary);
  font-weight: 700;
}

/* -------------------------------------------
   Step-Based Form Layout
------------------------------------------- */
/* -------------------------------------------
   Step-Based Form Layout
------------------------------------------- */
.shopify-form-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  /* Force full width */
}

.form-step {
  animation: fadeIn 0.4s ease-out;
  width: 100%;
  /* Force full width */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------
   Floating Labels (Magic)
------------------------------------------- */
.field-float {
  position: relative;
  margin-bottom: 10px;
  width: 100%;
}

.field-float input,
.field-float select {
  width: 100%;
  height: 56px !important;
  padding: 24px 16px 8px !important;
  /* Top padding reserved for label */
  background: var(--color-bg-input) !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md) !important;
  font-size: 1rem !important;
  color: var(--color-text-main) !important;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.field-float input:focus,
.field-float select:focus {
  background: #fff !important;
  border-color: var(--color-action) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  outline: none;
}

.field-float label {
  position: absolute;
  top: 50%;
  right: 16px;
  /* RTL Default */
  left: auto;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--color-text-muted);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: right top;
}

/* Handle LTR if needed */
body:not(.rtl) .field-float label {
  left: 16px;
  right: auto;
  transform-origin: left top;
}

/* Float State (Focus or Has Value) */
.field-float input:focus+label,
.field-float input:not(:placeholder-shown)+label,
.field-float select:valid+label,
.field-float input.has-content+label {
  /* Fallback class via JS if needed */
  top: 12px;
  transform: translateY(0) scale(0.85);
  color: var(--color-action);
  font-weight: 600;
}



/* -------------------------------------------
   Form Row Group (2-Column Layout)
------------------------------------------- */
.form-row-group {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 0;
  /* Handled by grid-gap */
}

@media (max-width: 480px) {
  .form-row-group {
    flex-direction: column;
    gap: 0;
  }
}

/* -------------------------------------------
   Trust Signals Grid
------------------------------------------- */
.trust-signal-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
}

/* -------------------------------------------
     Shipping Toggle (Segmented Control)
  ------------------------------------------- */
.alpha-shipping-toggle {
  display: flex !important;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
  margin-bottom: 24px;
  width: 100%;
}

.alpha-shipping-toggle label {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  color: #64748B;
  border: 1px solid transparent;
}

/* Radio Button Styling */
.alpha-shipping-toggle input[type="radio"] {
  accent-color: var(--color-accent);
  margin: 0;
  width: 16px;
  height: 16px;
  /* Ensure radio is visible */
  appearance: auto;
}

/* Active State */
.alpha-shipping-toggle label:has(input:checked) {
  background: #fff;
  color: var(--color-accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-color: #E2E8F0;
}



.trust-signal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 8px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  gap: 8px;
  transition: all 0.2s;
}

.trust-signal-item:hover {
  background: #fff;
  border-color: var(--color-accent);
}

.trust-signal-item i {
  font-size: 1.5rem;
  color: #10B981;
  /* Green color from image */
}

.trust-signal-item span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
}

/* -------------------------------------------
   Buttons & Primary Actions
------------------------------------------- */
.button,
#alphacheckout_submit {
  background: var(--color-action) !important;
  color: white !important;
  border-radius: var(--radius-pill) !important;
  height: 56px;
  width: 100%;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.25);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

#alphacheckout_submit:hover {
  background: var(--color-action-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

/* Reassurance Micro-copy */
.cta-reassurance {
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cta-reassurance span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cta-reassurance i {
  color: #10B981;
  /* Green check */
}

.button:hover,
#alphacheckout_submit:hover {
  background: var(--color-action-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px rgba(37, 99, 235, 0.3);
}

/* -------------------------------------------
   Mobile Sticky Bar (Refined)
------------------------------------------- */
@media (max-width: 768px) {
  body {
    padding-bottom: 90px;
  }

  .sticky-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 12px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--color-border);
  }

  .sticky-mobile-bar .price-display {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-primary);
  }

  .sticky-mobile-bar .button {
    width: auto !important;
    padding: 0 32px;
    height: 48px;
    font-size: 1rem !important;
  }
}

/* -------------------------------------------
   Checkout Card Container
------------------------------------------- */
/* -------------------------------------------
   Checkout Card Container (New Wrapper)
------------------------------------------- */
.alpha-checkout-wrapper {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#alphacheckout_woo_single_form {
  /* Removed card styles as they are now on wrapper */
  display: grid;
  grid-gap: 15px;
  grid-template-columns: repeat(1, 1fr);
  width: 100%;
}

/* -------------------------------------------
   Footer Layout: Qty & Submit
------------------------------------------- */
.form-footer-row {
  display: flex !important;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.form-qte-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  height: 54px;
  min-width: 120px;
  overflow: hidden;
}

.form-qte-wrapper span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  background: #fff;
  transition: background 0.2s;
  user-select: none;
}

.form-qte-wrapper span:hover {
  background: var(--color-bg-input);
}

#alphacheckout_count_button {
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  flex: 1.5;
  /* Slightly wider for number */
  cursor: default;
}

.form-submit-wrapper {
  flex: 1;
  /* Takes remaining space */
}

/* Ensure button fills wrapper */
.form-submit-wrapper input[type="submit"],
.form-submit-wrapper .button {
  width: 100%;
}

@media (max-width: 480px) {
  .form-footer-row {
    flex-direction: row;
  }
}

/* -------------------------------------------
   CRO Bundle Styling
------------------------------------------- */
.variation-item-li {
  position: relative;
  list-style: none;
  margin-bottom: 12px;
}

.variation-card-label {
  display: flex !important;
  align-items: center;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
  width: 100%;
  position: relative;
}

.highlighted-offer .variation-card-label {
  border: 2px solid var(--color-accent);
  background: #F0FDFA;
  /* Light teal bg */
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.popular-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--color-accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 10;
}

.variation-details-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-right: 12px;
}

.variation-main-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.benefit-tag {
  font-size: 0.8rem;
  color: #059669;
  font-weight: 600;
  background: #D1FAE5;
  padding: 2px 6px;
  border-radius: 4px;
}

.price-block {
  margin-top: 4px;
  font-size: 1rem;
  color: #334155;
}

.crossed-price {
  text-decoration: line-through;
  color: #94A3B8;
  margin-right: 8px;
  font-size: 0.9rem;
}

/* -------------------------------------------
   Mobile Polish (Thumb-friendly)
------------------------------------------- */
@media (max-width: 480px) {

  /* Enforce minimum touch target size */
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  select,
  .button,
  .alpha-shipping-toggle label,
  .variation-card-label,
  .form-qte-wrapper {
    min-height: 48px !important;
    font-size: 16px !important;
    /* Prevent iOS zoom */
  }

  /* Increase specific spacing for mobile */
  .form-row-group {
    gap: 16px;
    margin-bottom: 0;
    /* Handled by grid-gap */
  }

  /* Make radio selection easier */
  .alpha-shipping-toggle label {
    padding: 14px 8px;
  }

  /* Full width variation cards */
  .variation-main-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .popular-badge {
    top: -12px;
    right: 8px;
  }
}