/**
 * FlexAuto Product Page - Modern Design with Light/Dark Theme Support
 *
 * Supports both light and dark themes via CSS variables.
 * No WooCommerce dependency – uses flexauto_product CPT only.
 */

/* ========================================
   CSS VARIABLES - DARK THEME (DEFAULT)
   ======================================== */
:root {
  --flexauto-background: 222 47% 6%;
  --flexauto-foreground: 210 40% 98%;

  --flexauto-card: 222 47% 9%;
  --flexauto-card-foreground: 210 40% 98%;

  --flexauto-primary: 199 89% 48%;
  --flexauto-primary-foreground: 222 47% 6%;

  --flexauto-secondary: 222 47% 14%;
  --flexauto-secondary-foreground: 210 40% 98%;

  --flexauto-muted: 222 47% 14%;
  --flexauto-muted-foreground: 215 20% 55%;

  --flexauto-border: 222 47% 18%;
  --flexauto-input: 222 47% 14%;
  --flexauto-ring: 199 89% 48%;

  /* Custom tokens */
  --flexauto-gradient-primary: linear-gradient(135deg, hsl(199 89% 48%), hsl(217 91% 60%));
  --flexauto-gradient-glow: linear-gradient(135deg, hsl(199 89% 48% / 0.2), hsl(217 91% 60% / 0.2));
  --flexauto-shadow-glow: 0 0 30px hsl(199 89% 48% / 0.3);
  --flexauto-glass-bg: hsl(222 47% 9% / 0.8);
  --flexauto-glass-border: hsl(222 47% 20% / 0.5);

  --flexauto-success: 142 76% 36%;
  --flexauto-success-foreground: 210 40% 98%;
}

/* Force dark theme on single product pages */
body.single-flexauto_product,
html.single-flexauto_product,
body.single-flexauto_product .site,
body.single-flexauto_product .site-main,
body.single-flexauto_product .content-area,
body.flexauto-single-product,
body.flexauto-single-product .site,
body.flexauto-single-product .site-main,
body.flexauto-single-product .content-area {
  --flexauto-background: 222 47% 6% !important;
  --flexauto-foreground: 210 40% 98% !important;
  --flexauto-card: 222 47% 9% !important;
  --flexauto-card-foreground: 210 40% 98% !important;
  --flexauto-secondary: 222 47% 14% !important;
  --flexauto-secondary-foreground: 210 40% 98% !important;
  --flexauto-muted: 222 47% 14% !important;
  --flexauto-muted-foreground: 215 20% 55% !important;
  --flexauto-border: 222 47% 18% !important;
  --flexauto-input: 222 47% 14% !important;
  --flexauto-glass-bg: hsl(222 47% 9% / 0.8) !important;
  --flexauto-glass-border: hsl(222 47% 20% / 0.5) !important;
}

/* ========================================
   CSS VARIABLES - LIGHT THEME (OPTIONAL)
   ======================================== */
.flexauto-theme-light,
.flexauto-theme-light body,
body.flexauto-theme-light,
html.flexauto-theme-light {
  --flexauto-background: 210 40% 98%;
  --flexauto-foreground: 222 47% 11%;

  --flexauto-card: 0 0% 100%;
  --flexauto-card-foreground: 222 47% 11%;

  --flexauto-primary: 199 89% 48%;
  --flexauto-primary-foreground: 0 0% 100%;

  --flexauto-secondary: 210 40% 94%;
  --flexauto-secondary-foreground: 222 47% 11%;

  --flexauto-muted: 210 40% 94%;
  --flexauto-muted-foreground: 215 20% 40%;

  --flexauto-border: 214 32% 85%;
  --flexauto-input: 214 32% 91%;
  --flexauto-ring: 199 89% 48%;

  /* Custom tokens */
  --flexauto-gradient-primary: linear-gradient(135deg, hsl(199 89% 48%), hsl(217 91% 60%));
  --flexauto-gradient-glow: linear-gradient(135deg, hsl(199 89% 48% / 0.2), hsl(217 91% 60% / 0.2));
  --flexauto-shadow-glow: 0 0 30px hsl(199 89% 48% / 0.3);
  --flexauto-glass-bg: hsl(0 0% 100% / 0.8);
  --flexauto-glass-border: hsl(214 32% 85% / 0.5);

  --flexauto-success: 142 76% 36%;
  --flexauto-success-foreground: 0 0% 100%;
}

/* ========================================
   BASE STYLES
   ======================================== */
/* Force theme on body/html */
body.flexauto-theme-dark,
body.flexauto-theme-light,
html.flexauto-theme-dark,
html.flexauto-theme-light,
body.single-flexauto_product.flexauto-theme-dark,
body.single-flexauto_product.flexauto-theme-light,
html.single-flexauto_product.flexauto-theme-dark,
html.single-flexauto_product.flexauto-theme-light,
body.flexauto-single-product.flexauto-theme-dark,
body.flexauto-single-product.flexauto-theme-light {
  background: hsl(var(--flexauto-background)) !important;
  color: hsl(var(--flexauto-foreground)) !important;
}

/* Force background on main content areas */
body.single-flexauto_product,
body.single-flexauto_product .site,
body.single-flexauto_product .site-main,
body.single-flexauto_product .wp-site-blocks,
body.single-flexauto_product .wp-block-group,
body.single-flexauto_product main,
body.single-flexauto_product .site-content,
body.flexauto-single-product,
body.flexauto-single-product .site,
body.flexauto-single-product .site-main,
body.flexauto-single-product .wp-site-blocks,
body.flexauto-single-product .wp-block-group,
body.flexauto-single-product main,
body.flexauto-single-product .site-content {
  background: hsl(var(--flexauto-background)) !important;
  color: hsl(var(--flexauto-foreground)) !important;
}

.flexauto-product-page-clean {
  background: transparent;
  color: hsl(var(--flexauto-foreground));
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.flexauto-form-section {
  background: hsl(var(--flexauto-background));
  min-height: 100vh;
}

/* ========================================
   FORM SECTION (Exakt som exempel-designen)
   ======================================== */
.flexauto-form-section {
  padding: 2rem 1rem;
  padding-bottom: 2rem; /* Sticky nav sits in flow — no extra space needed */
  background: hsl(var(--flexauto-background));
}

.flexauto-form-container {
  max-width: 80rem;
  margin: 0 auto;
  position: relative;
  padding-bottom: 1rem;
}

.flexauto-form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.flexauto-form-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: hsl(var(--flexauto-foreground));
}

@media (min-width: 640px) {
  .flexauto-form-title {
    font-size: 1.875rem;
  }
}

.flexauto-form-subtitle {
  color: hsl(var(--flexauto-muted-foreground));
}

/* Grid layout (exakt som exempel-designen: lg:grid-cols-3) */
.flexauto-product-page-grid {
  display: grid;
  gap: 1.25rem; /* 20px - tätare layout */
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 1024px) {
  .flexauto-product-page-grid {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

/* Form column (lg:col-span-2) – toppjusterad, min-width: 0; innehåll centreras via form-glass */
.flexauto-form-column {
  min-width: 0;
  align-self: start;
}

/* Sidebar column – toppjusterad i grid, ingen marginal så den inte "fäller ner" */
.flexauto-sidebar-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  margin-top: 0;
  padding-top: 0;
}

/* Formulärkort: maxbredd och centrerat så att kortet och fälten inte blir för långa */
.flexauto-form-glass {
  background: var(--flexauto-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--flexauto-glass-border);
  border-radius: 1rem;
  padding: 1.5rem;
  min-height: 400px;
  width: 100%;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .flexauto-form-glass {
    padding: 2rem;
  }
}

/* IPBox: minimal sidpadding så variantkorten kommer närmare kortets kanter */
.flexauto-ipbox-product .flexauto-step-content-wrapper {
  padding-left: 0.75rem; /* 12px - minimal marginal */
  padding-right: 0.75rem;
}
@media (min-width: 640px) {
  .flexauto-ipbox-product .flexauto-step-content-wrapper {
    padding-left: 1rem; /* 16px - lagom marginal */
    padding-right: 1rem;
  }
}

/* Step content */
.flexauto-step-content {
  /* Step content styles */
}

.flexauto-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: hsl(var(--flexauto-foreground));
}

/* Input fields (Step 5) */
.flexauto-step-5-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ========================================
   STEP 5 SUMMARY (when no fields needed)
   ======================================== */
.flexauto-step-5-summary {
  margin-top: 1.5rem;
}

.flexauto-step-5-summary-content {
  background: var(--flexauto-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(var(--flexauto-border));
  border-radius: var(--flexauto-radius);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.flexauto-step-5-summary-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
  background: hsl(var(--flexauto-success) / 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--flexauto-success));
}

.flexauto-step-5-summary-icon svg {
  width: 2rem;
  height: 2rem;
}

.flexauto-step-5-summary-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--flexauto-foreground));
  margin-bottom: 0.75rem;
}

.flexauto-step-5-summary-description {
  font-size: 1rem;
  color: hsl(var(--flexauto-muted-foreground));
  margin-bottom: 2rem;
  line-height: 1.6;
}

.flexauto-step-5-summary-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--flexauto-border));
}

.flexauto-step-5-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.flexauto-step-5-summary-label {
  font-size: 0.875rem;
  color: hsl(var(--flexauto-muted-foreground));
  font-weight: 500;
}

.flexauto-step-5-summary-value {
  font-size: 0.875rem;
  color: hsl(var(--flexauto-foreground));
  font-weight: 600;
  text-align: right;
}

.flexauto-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flexauto-input-label {
  color: hsl(var(--flexauto-foreground));
  font-weight: 500;
}

.flexauto-input {
  background: hsl(var(--flexauto-secondary));
  border: 1px solid hsl(var(--flexauto-border));
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: hsl(var(--flexauto-foreground));
  font-size: 1rem;
  transition: all 0.2s ease;
}

.flexauto-input:focus {
  outline: none;
  border-color: hsl(var(--flexauto-primary));
  box-shadow: 0 0 0 3px hsl(var(--flexauto-primary) / 0.1);
}

.flexauto-input-help {
  font-size: 0.75rem;
  color: hsl(var(--flexauto-muted-foreground));
  margin: 0;
}

/* Form wrapper med glass effect */
#flexauto-form-wrapper {
  background: var(--flexauto-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--flexauto-glass-border);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  min-height: 400px;
}

/* Dölj alla labels och dropdowns - använd option cards istället */
.flexauto-form .form-group label,
.form-group label {
  display: none !important;
}

.flexauto-form .form-group select,
.form-group select {
  display: none !important;
}

/* Visa option cards när de är i aktivt steg */
.flexauto-step-content[data-step] .flexauto-option-cards {
  display: flex !important;
}

/* Dölj option cards som inte är i aktivt steg */
/* KRITISKT: Step 1 ska alltid visa option cards */
.flexauto-step-content[data-step="1"] .flexauto-option-cards {
  display: flex !important;
}

.flexauto-step-content[data-step]:not([data-step="1"]):not([style*="display: block"]) .flexauto-option-cards {
  display: none !important;
}

/* ========================================
   HERO SECTION (Centered)
   ======================================== */
.flexauto-hero-section {
  margin-bottom: 3rem;
  padding: 2rem 1rem;
  text-align: center;
}

.flexauto-hero-content {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.flexauto-hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .flexauto-hero-title {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .flexauto-hero-title {
    font-size: 3.5rem;
  }
}

.gradient-text {
  background: var(--flexauto-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flexauto-product-price-display {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--flexauto-primary));
}

@media (min-width: 640px) {
  .flexauto-product-price-display {
    font-size: 1.75rem;
  }
}

.flexauto-hero-description-box {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  background: hsl(var(--flexauto-card));
  border-radius: 0.75rem;
  border: 2px solid hsl(var(--flexauto-border));
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 
    0 2px 4px -1px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 0 hsl(var(--flexauto-primary) / 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.flexauto-hero-description-box::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 0.75rem;
  padding: 2px;
  background: linear-gradient(135deg, hsl(var(--flexauto-primary) / 0.3), hsl(var(--flexauto-primary) / 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.flexauto-hero-description-box:hover {
  border-color: hsl(var(--flexauto-primary) / 0.6);
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 
    0 4px 6px -2px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 0 hsl(var(--flexauto-primary) / 0.2),
    0 0 20px hsl(var(--flexauto-primary) / 0.1);
}

.flexauto-hero-description-box:hover::before {
  opacity: 1;
}

.flexauto-hero-description-text {
  margin: 0;
  color: hsl(var(--flexauto-foreground));
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
}

@media (min-width: 640px) {
  .flexauto-hero-description-text {
    font-size: 1.125rem;
  }
}

.flexauto-breadcrumb-wrapper {
  max-width: 80rem;
  margin: 1.25rem auto;
  padding: 0 1.25rem;
}

.flexauto-breadcrumb {
  font-size: 0.875rem;
  color: hsl(var(--flexauto-muted-foreground));
}

.flexauto-breadcrumb a {
  color: hsl(var(--flexauto-muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}

.flexauto-breadcrumb a:hover {
  color: hsl(var(--flexauto-primary));
}

.flexauto-hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--flexauto-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flexauto-hero-description {
  max-width: 42rem;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: var(--flexauto-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--flexauto-glass-border);
  font-size: 1.125rem;
  font-weight: 500;
  color: hsl(var(--flexauto-foreground));
}

.flexauto-hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.flexauto-hero-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: hsl(var(--flexauto-primary) / 0.1);
  border: 1px solid hsl(var(--flexauto-primary) / 0.3);
  color: hsl(var(--flexauto-foreground));
}

.flexauto-hero-badge svg {
  width: 1rem;
  height: 1rem;
  color: hsl(var(--flexauto-primary));
}

/* ========================================
   STEP INDICATOR (Exakt som exempel-designen)
   ======================================== */
.flexauto-step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  padding: 1.25rem;
  background: hsl(var(--flexauto-card));
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--flexauto-border));
}

.flexauto-step {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flexauto-step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: hsl(var(--flexauto-secondary));
  color: hsl(var(--flexauto-muted-foreground));
}

.flexauto-step.flexauto-step-active .flexauto-step-number {
  background: hsl(var(--flexauto-primary));
  color: hsl(var(--flexauto-primary-foreground));
  transform: scale(1.1);
  box-shadow: var(--flexauto-shadow-glow);
}

.flexauto-step-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--flexauto-muted-foreground));
  transition: all 0.3s ease;
}

.flexauto-step.flexauto-step-active .flexauto-step-label {
  color: hsl(var(--flexauto-foreground));
  font-weight: 600;
}

.flexauto-step-wrapper {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.flexauto-step {
  display: flex;
  align-items: center;
}

.flexauto-step-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.flexauto-step-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.flexauto-step.active .flexauto-step-circle {
  background: hsl(var(--flexauto-primary));
  color: hsl(var(--flexauto-primary-foreground));
  transform: scale(1.1);
  box-shadow: var(--flexauto-shadow-glow);
}

.flexauto-step.active .flexauto-step-circle::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid hsl(var(--flexauto-primary));
  transform: scale(1.3);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.flexauto-step.completed .flexauto-step-circle {
  background: hsl(var(--flexauto-success));
  color: hsl(var(--flexauto-success-foreground));
}

.flexauto-step:not(.active):not(.completed) .flexauto-step-circle {
  background: hsl(var(--flexauto-secondary));
  color: hsl(var(--flexauto-muted-foreground));
}

.flexauto-step-circle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.flexauto-step-label {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.flexauto-step.active .flexauto-step-label,
.flexauto-step.completed .flexauto-step-label {
  color: hsl(var(--flexauto-foreground));
  font-weight: 600;
}

.flexauto-step:not(.active):not(.completed) .flexauto-step-label {
  color: hsl(var(--flexauto-muted-foreground));
}

.flexauto-step-line {
  width: 4rem;
  height: 2px;
  margin: 0 0.5rem;
  background: hsl(var(--flexauto-secondary));
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .flexauto-step-line {
    width: 6rem;
  }
}

.flexauto-step-line-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: hsl(var(--flexauto-primary));
  transition: width 0.4s ease;
  width: 0%;
}

/* Progress line fylls när föregående steg är completed */
.flexauto-step.completed + .flexauto-step-line .flexauto-step-line-progress {
  width: 100%;
}

/* ========================================
   OPTION CARDS
   ======================================== */
.flexauto-option-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0;
}

.flexauto-option-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  text-align: left;
  transition: all 0.3s ease;
  background: var(--flexauto-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(var(--flexauto-border));
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  pointer-events: auto !important;
  z-index: 1;
  box-sizing: border-box;
}

.flexauto-option-card:hover {
  transform: scale(1.02);
  border-color: hsl(var(--flexauto-muted-foreground) / 0.5);
}

.flexauto-option-card.selected {
  border-color: hsl(var(--flexauto-primary));
  border-width: 2px;
  box-shadow: var(--flexauto-shadow-glow);
}

.flexauto-option-card-badge {
  position: absolute;
  top: -0.625rem;
  right: 1rem;
  padding: 0.125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  background: hsl(var(--flexauto-primary));
  color: hsl(var(--flexauto-primary-foreground));
}

.flexauto-option-card-icon {
  padding: 0.625rem;
  border-radius: 0.5rem;
  background: hsl(var(--flexauto-secondary));
  color: hsl(var(--flexauto-muted-foreground));
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.flexauto-option-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.flexauto-option-card.selected .flexauto-option-card-icon {
  background: hsl(var(--flexauto-primary) / 0.2);
  color: hsl(var(--flexauto-primary));
}

.flexauto-option-card-content {
  flex: 1;
  min-width: 0;
}

.flexauto-option-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.flexauto-option-card-title {
  font-weight: 600;
  color: hsl(var(--flexauto-foreground));
  margin: 0;
}

.flexauto-option-card-description {
  font-size: 0.875rem;
  color: hsl(var(--flexauto-muted-foreground));
  margin: 0;
  line-height: 1.5;
}

.flexauto-option-card-price {
  font-size: 1.125rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--flexauto-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flexauto-option-card-checkmark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: hsl(var(--flexauto-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--flexauto-primary-foreground));
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

.flexauto-option-card.selected .flexauto-option-card-checkmark {
  opacity: 1;
  transform: scale(1);
}

/* Trial-info-rutan: samma bredd som abonnemangskorten (går inte utanför) */
.flexauto-option-cards .flexauto-trial-info-box {
  flex: 0 1 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.flexauto-option-card-checkmark svg {
  width: 1rem;
  height: 1rem;
}

/* ========================================
   ORDER SUMMARY (STICKY SIDEBAR) - Stilren design
   ======================================== */
/* Sidokolumn: toppjusterad, begränsad bredd, sticky */
.flexauto-order-summary {
  position: sticky;
  top: 1.5rem;
  padding: 0;
  border-radius: 1rem;
  background: hsl(var(--flexauto-card));
  border: 1px solid hsl(var(--flexauto-border));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .flexauto-order-summary {
    min-width: 16rem;
    max-width: 22rem;
  }
}

.flexauto-order-summary-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  background: hsl(var(--flexauto-secondary));
  border-bottom: 1px solid hsl(var(--flexauto-border));
  line-height: 1; /* Reset line-height för perfekt alignment */
}

.flexauto-order-summary-icon {
  display: flex; /* Redan där - men säkerställ perfekt centering */
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
  width: 1.25rem; /* 20px - explicit width för konsistens */
  height: 1.25rem; /* 20px - explicit height */
  opacity: 0.8;
}

.flexauto-order-summary-header h3 {
  margin: 0; /* Remove default margins */
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--flexauto-foreground));
  line-height: 1.2; /* Slight breathing room */
}

.flexauto-order-summary-icon img {
  width: 1rem;
  height: 1rem;
  display: block;
}

.flexauto-order-summary-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--flexauto-foreground));
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: uppercase;
}

.flexauto-order-summary-content {
  padding: 0.875rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.flexauto-order-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid hsl(var(--flexauto-border) / 0.15);
}

.flexauto-order-summary-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.flexauto-order-summary-label {
  font-size: 0.625rem;
  color: hsl(var(--flexauto-muted-foreground));
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.flexauto-order-summary-value {
  font-size: 0.6875rem;
  color: hsl(var(--flexauto-foreground));
  font-weight: 600;
  text-align: right;
  line-height: 1.4;
  flex-shrink: 0;
  min-width: 0;
  max-width: 65%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flexauto-order-summary-value:empty::before {
  content: "—";
  color: hsl(var(--flexauto-muted-foreground));
  font-weight: 400;
  opacity: 0.6;
}

.flexauto-order-summary-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid hsl(var(--flexauto-border));
  background: hsl(var(--flexauto-secondary) / 0.15);
}

.flexauto-add-to-cart-button {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: hsl(var(--flexauto-secondary));
  color: hsl(var(--flexauto-muted-foreground));
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.flexauto-add-to-cart-button:not(:disabled) {
  background: hsl(var(--flexauto-primary));
  color: hsl(var(--flexauto-primary-foreground));
  cursor: pointer;
}

.flexauto-add-to-cart-button:not(:disabled):hover {
  background: hsl(var(--flexauto-primary) / 0.9);
  transform: translateY(-1px);
  box-shadow: var(--flexauto-shadow-glow);
}

.flexauto-add-to-cart-button:not(:disabled):active {
  transform: translateY(0);
}

.flexauto-form-content {
  background: hsl(var(--flexauto-card));
  padding: 1.875rem;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--flexauto-border));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flexauto-order-summary-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--flexauto-foreground));
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flexauto-order-summary-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: hsl(var(--flexauto-primary) / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.flexauto-order-summary-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.flexauto-order-summary-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid hsl(var(--flexauto-border));
}

.flexauto-order-summary-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.flexauto-order-summary-item-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.flexauto-order-summary-item-icon svg {
  width: 1rem;
  height: 1rem;
}

.flexauto-order-summary-item-icon.has-value {
  background: hsl(var(--flexauto-primary) / 0.2);
  color: hsl(var(--flexauto-primary));
}

.flexauto-order-summary-item-icon:not(.has-value) {
  background: hsl(var(--flexauto-secondary));
  color: hsl(var(--flexauto-muted-foreground));
}

.flexauto-order-summary-item-content {
  flex: 1;
  min-width: 0;
}

.flexauto-order-summary-item-label {
  font-size: 0.75rem;
  color: hsl(var(--flexauto-muted-foreground));
  margin: 0;
}

.flexauto-order-summary-item-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--flexauto-foreground));
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flexauto-order-summary-item-value:empty::before {
  content: "—";
  color: hsl(var(--flexauto-muted-foreground));
}

.flexauto-order-summary-total {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--flexauto-border));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flexauto-order-summary-total-label {
  color: hsl(var(--flexauto-muted-foreground));
  font-weight: 500;
}

.flexauto-order-summary-total-price {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--flexauto-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   PRODUCT IMAGE
   ======================================== */
.flexauto-product-image-wrapper {
  padding: 1rem;
  border-radius: 1rem;
  background: var(--flexauto-glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--flexauto-glass-border);
  margin-bottom: 1.5rem;
}

.flexauto-product-image-container {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  overflow: hidden;
  background: hsl(var(--flexauto-secondary) / 0.5);
}

.flexauto-product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.flexauto-product-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, hsl(var(--flexauto-background) / 0.9), transparent);
}

.flexauto-product-image-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.flexauto-product-image-badge {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: hsl(var(--flexauto-primary) / 0.2);
  color: hsl(var(--flexauto-primary));
  border: 1px solid hsl(var(--flexauto-primary) / 0.3);
}

.flexauto-product-image-title {
  margin-top: 1rem;
  text-align: center;
}

.flexauto-product-image-title h3 {
  font-weight: 600;
  color: hsl(var(--flexauto-foreground));
  margin: 0 0 0.25rem 0;
}

.flexauto-product-image-title p {
  font-size: 0.875rem;
  color: hsl(var(--flexauto-muted-foreground));
  margin: 0;
}

/* ========================================
   FLOATING STICKY NAV BAR (Tillbaka/Nästa/Lägg i varukorg)
   Samma regler för LiveGo och IPBox – en kodväg, samma utseende och beteende.
   DOKUMENTATION: docs/STICKY_NAVIGATION_IMPLEMENTATION.md
   ======================================== */
.flexauto-sticky-nav-spacer {
  height: 80px;
  min-height: 80px;
  flex-shrink: 0;
}

.flexauto-sticky-nav {
  position: sticky;
  bottom: 1rem;
  margin-top: 2rem;
  z-index: 999;
  width: 100%;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* När baren flyttats till body (JS) – verkligt flytande längst ner i viewport */
.flexauto-sticky-nav-viewport-fixed {
  position: fixed !important;
  bottom: 1rem !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  margin-top: 0 !important;
  z-index: 9999 !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box !important;
}

.flexauto-sticky-nav-inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;  /* Tre kolumner: vänster, mitten (auto), höger */
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 16px 20px;     /* Generös padding för bättre utseende */
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: hsl(var(--flexauto-card));
  border: 1px solid hsl(var(--flexauto-border));
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Sticky nav använder alltid grid (överskrid inte med .flexauto-form-navigation flex) */
.flexauto-sticky-nav .flexauto-form-navigation {
  display: grid;
  justify-content: unset;
}

/* Tillbaka-knapp (vänster) – alltid kolumn 1 */
.flexauto-sticky-nav-inner .flexauto-btn-back {
  grid-column: 1;
  justify-self: start;
}

/* Lägg i varukorg (mitten) – alltid kolumn 2 så den inte hamnar till höger på sista steget */
.flexauto-sticky-nav-inner .flexauto-btn-add-to-cart {
  grid-column: 2;
  justify-self: center;
}

/* Nästa-knapp (höger) – alltid kolumn 3, min bredd så kolumnen inte kollapsar */
.flexauto-sticky-nav-inner .flexauto-btn-next {
  grid-column: 3;
  justify-self: end;
  min-width: 5rem;
}

/* Responsive: Stack på små skärmar */
@media (max-width: 640px) {
  .flexauto-sticky-nav-inner {
    grid-template-columns: 1fr;  /* En kolumn på mobil */
    grid-template-rows: auto auto auto;
    gap: 8px;
  }
  
  .flexauto-btn-back {
    grid-column: 1;
    grid-row: 1;
    justify-self: stretch;
  }
  
  .flexauto-btn-add-to-cart {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
  }
  
  .flexauto-btn-next {
    grid-column: 1;
    grid-row: 3;
    justify-self: stretch;
  }
}

/* ========================================
   FORM NAVIGATION BUTTONS (shared styles)
   ======================================== */
.flexauto-form-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--flexauto-border));
}

/* Success feedback text (shown when all fields are filled) */
.flexauto-success-feedback {
  flex: 1;
  text-align: center;
  color: hsl(var(--flexauto-success));
  font-size: 0.875rem;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  animation: fadeInUp 0.3s ease;
}

.flexauto-success-feedback.show {
  display: flex;
}

.flexauto-success-feedback svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: hsl(var(--flexauto-success));
}

/* ============================================
   DYNAMIC FIELDS SECTION (Step 4)
   Styling för MAC/Username inputs - Matcha option cards!
   ============================================ */
.flexauto-dynamic-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--flexauto-border) / 0.3);
}

.flexauto-dynamic-section .flexauto-subsection-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--flexauto-foreground));
  margin-bottom: 0.5rem;
}

.flexauto-subsection-description {
  font-size: 0.875rem;
  color: hsl(var(--flexauto-muted-foreground));
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Input fields - Styla som "mini option cards" */
.flexauto-dynamic-section .form-group {
  margin-bottom: 1.25rem;
}

.flexauto-dynamic-section label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--flexauto-foreground));
  margin-bottom: 0.5rem;
}

.flexauto-field-help {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: hsl(var(--flexauto-muted-foreground));
  margin-top: 0.25rem;
}

.flexauto-dynamic-section .flexauto-form-input {
  width: 100%;
  padding: 0.875rem 1rem; /* 14px 16px - samma som option cards */
  background: hsl(var(--flexauto-card));
  border: 1px solid hsl(var(--flexauto-border));
  border-radius: 8px; /* Rundade hörn - matcha option cards */
  color: hsl(var(--flexauto-foreground));
  font-size: 0.9375rem; /* 15px */
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.flexauto-dynamic-section .flexauto-form-input::placeholder {
  color: hsl(var(--flexauto-muted-foreground) / 0.6);
}

.flexauto-dynamic-section .flexauto-form-input:hover {
  border-color: hsl(var(--flexauto-border) / 0.8);
  background: hsl(var(--flexauto-card) / 0.9);
}

.flexauto-dynamic-section .flexauto-form-input:focus {
  border-color: hsl(var(--flexauto-primary));
  box-shadow: 0 0 0 3px hsla(var(--flexauto-primary), 0.1);
  background: hsl(var(--flexauto-card));
}

.flexauto-dynamic-section .flexauto-form-input:invalid:not(:placeholder-shown) {
  border-color: hsl(var(--flexauto-destructive));
}

.flexauto-dynamic-section .flexauto-form-input:valid:not(:placeholder-shown) {
  border-color: hsl(var(--flexauto-success) / 0.5);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flexauto-btn-back,
.flexauto-btn-next {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

/* Lägg i varukorg-knapp (mitten) */
.flexauto-btn-add-to-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none;
  background: hsl(var(--flexauto-success));
  color: white;
  box-shadow: 0 2px 12px hsla(var(--flexauto-success) / 0.3);
}

.flexauto-btn-add-to-cart svg {
  width: 20px;
  height: 20px;
}

.flexauto-btn-add-to-cart:hover:not(:disabled) {
  background: hsl(var(--flexauto-success) / 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px hsla(var(--flexauto-success) / 0.4);
}

.flexauto-btn-add-to-cart:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: hsl(var(--flexauto-muted));
  box-shadow: none;
}

.flexauto-btn-back {
  background: transparent;
  border: 1px solid hsl(var(--flexauto-border));
  color: hsl(var(--flexauto-foreground));
}

.flexauto-btn-back:hover:not(:disabled) {
  background: hsl(var(--flexauto-secondary));
  border-color: hsl(var(--flexauto-primary));
}

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

.flexauto-btn-next {
  background: hsl(var(--flexauto-primary));
  color: hsl(var(--flexauto-primary-foreground));
  box-shadow: var(--flexauto-shadow-glow);
}

.flexauto-btn-next:hover:not(:disabled) {
  background: hsl(var(--flexauto-primary) / 0.9);
  transform: translateY(-1px);
}

.flexauto-btn-next:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.flexauto-btn-next:not(:disabled) {
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Pulse animation for Nästa button (trial — draws attention without auto-advancing) */
@keyframes flexautoBtnPulse {
  0%   { box-shadow: 0 0 0 0 hsla(var(--flexauto-primary), .55); }
  70%  { box-shadow: 0 0 0 10px hsla(var(--flexauto-primary), 0); }
  100% { box-shadow: 0 0 0 0 hsla(var(--flexauto-primary), 0); }
}
.flexauto-btn-pulse {
  animation: flexautoBtnPulse 0.8s ease-out 2;
}

/* Add to Cart button (NEW - with green glow when ready!) */
#flexauto-add-to-cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none;
  background: hsl(var(--flexauto-primary));
  color: hsl(var(--flexauto-primary-foreground));
  box-shadow: var(--flexauto-shadow-glow);
}

#flexauto-add-to-cart-btn:not(:disabled):not(.disabled) {
  /* Green glow when ready to submit! */
  box-shadow: 0 0 20px hsl(var(--flexauto-success) / 0.4), 
              0 0 40px hsl(var(--flexauto-success) / 0.2);
  border: 1px solid hsl(var(--flexauto-success) / 0.5);
  animation: pulseGlow 2s ease-in-out infinite;
}

#flexauto-add-to-cart-btn:not(:disabled):not(.disabled):hover {
  background: hsl(var(--flexauto-primary) / 0.9);
  transform: translateY(-2px);
  box-shadow: 0 0 30px hsl(var(--flexauto-success) / 0.6), 
              0 0 60px hsl(var(--flexauto-success) / 0.3);
}

#flexauto-add-to-cart-btn:disabled,
#flexauto-add-to-cart-btn.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none;
  border: none;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px hsl(var(--flexauto-success) / 0.4), 
                0 0 40px hsl(var(--flexauto-success) / 0.2);
  }
  50% {
    box-shadow: 0 0 30px hsl(var(--flexauto-success) / 0.6), 
                0 0 60px hsl(var(--flexauto-success) / 0.3);
  }
}

/* Step indicator - green checkmark on step 4 when complete */
.flexauto-step.completed.step-4-complete .flexauto-step-circle {
  background: hsl(var(--flexauto-success)) !important;
  border-color: hsl(var(--flexauto-success)) !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1023px) {
  .flexauto-product-page-grid {
    grid-template-columns: 1fr;
  }

  .flexauto-product-page-clean {
    grid-template-columns: 1fr !important;
  }

  .flexauto-sidebar-column {
    order: -1;
  }

  .flexauto-order-summary {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  .flexauto-hero-title {
    font-size: 2rem;
  }

  .flexauto-step-indicator {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .flexauto-step-line {
    display: none;
  }

  .flexauto-order-summary {
    position: relative;
    top: 0;
  }

  .flexauto-form-section {
    padding: 1rem 0.5rem;
  }
}

/* ========================================
   IPBOX PRODUCT PAGE
   ======================================== */
/* Formuläret fyller kortet men inte mer – håller centrum i .flexauto-form-glass */
.flexauto-ipbox-product .flexauto-ipbox-form {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.flexauto-ipbox-product .flexauto-form-glass .flexauto-step-content,
.flexauto-ipbox-product .flexauto-form-glass .flexauto-step-content-wrapper {
  max-width: 100%;
  box-sizing: border-box;
}

.flexauto-ipbox-step {
  margin-bottom: 1.5rem;
}

.flexauto-ipbox-step .flexauto-step-title {
  margin-bottom: 0.5rem;
}

.flexauto-ipbox-step .flexauto-step-description {
  margin-bottom: 1rem;
  color: hsl(var(--flexauto-muted-foreground));
  font-size: 0.95rem;
}

.flexauto-ipbox-variant-card.selected,
.flexauto-ipbox-variants .flexauto-option-card.selected {
  border-color: hsl(var(--flexauto-primary));
  box-shadow: var(--flexauto-shadow-glow);
}

.flexauto-ipbox-shipping-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.flexauto-ipbox-shipping-fields .form-row-wide {
  grid-column: 1 / -1;
}

.flexauto-ipbox-shipping-fields .form-row label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.flexauto-ipbox-shipping-fields .form-row input,
.flexauto-ipbox-shipping-fields .form-row select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid hsl(var(--flexauto-border));
  border-radius: 0.5rem;
  background: hsl(var(--flexauto-input));
  color: hsl(var(--flexauto-foreground));
  font-size: 0.95rem;
}

.flexauto-ipbox-shipping-fields .form-row input:focus,
.flexauto-ipbox-shipping-fields .form-row select:focus {
  outline: none;
  border-color: hsl(var(--flexauto-primary));
  box-shadow: 0 0 0 2px hsl(var(--flexauto-primary) / 0.2);
}

/* ========================================
   IPBOX STEP 2: TILLVAL & LEVERANS SUBSECTIONS
   ======================================== */
.flexauto-options-shipping-section {
  /* Huvudcontainer för steg 2 */
}

.flexauto-subsection-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem 0;
  color: hsl(var(--flexauto-foreground));
}

.flexauto-subsection-title:first-of-type {
  margin-top: 0;
}

.flexauto-subsection-description {
  font-size: 0.9rem;
  color: hsl(var(--flexauto-muted-foreground));
  margin-bottom: 1rem;
}

/* Adult subsection */
.flexauto-adult-subsection {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid hsl(var(--flexauto-border));
}

.flexauto-adult-subsection:last-of-type,
.flexauto-adult-subsection + .flexauto-shipping-subsection {
  border-bottom: none;
}

/* Adult cards container */
.flexauto-adult-cards {
  margin-top: 0.75rem;
}

/* Shipping subsection */
.flexauto-shipping-subsection {
  margin-top: 0.5rem;
}

/* ========================================
   COUNTRY SELECT - SNYGG DROPDOWN MED FLAGGOR
   ======================================== */
.flexauto-country-select-wrapper {
  position: relative;
  width: 100%;
}

.flexauto-country-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  border: 2px solid hsl(var(--flexauto-border));
  border-radius: 0.75rem;
  background: hsl(var(--flexauto-input));
  color: hsl(var(--flexauto-foreground));
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.2s ease;
}

.flexauto-country-select:hover {
  border-color: hsl(var(--flexauto-primary) / 0.5);
}

.flexauto-country-select:focus {
  outline: none;
  border-color: hsl(var(--flexauto-primary));
  box-shadow: 0 0 0 3px hsl(var(--flexauto-primary) / 0.2);
}

/* Custom pil för dropdown */
.flexauto-country-select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: hsl(var(--flexauto-muted-foreground));
  transition: transform 0.2s ease;
}

.flexauto-country-select-arrow svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.flexauto-country-select-wrapper:focus-within .flexauto-country-select-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: hsl(var(--flexauto-primary));
}

/* Optgroup styling i dropdown */
.flexauto-country-select optgroup {
  font-weight: 600;
  font-size: 0.85rem;
  color: hsl(var(--flexauto-foreground));
  background: hsl(var(--flexauto-card));
  padding: 0.5rem;
}

.flexauto-country-select optgroup[label*="Norden"] {
  background: linear-gradient(135deg, hsl(var(--flexauto-primary) / 0.1), hsl(var(--flexauto-secondary)));
}

.flexauto-country-select option {
  padding: 0.5rem;
  font-weight: 400;
  font-size: 0.95rem;
}

/* Specifik styling för selected option */
.flexauto-country-select option:checked {
  background: hsl(var(--flexauto-primary));
  color: hsl(var(--flexauto-primary-foreground));
}

/* Hover-effekt i dropdown (webkit) */
.flexauto-country-select option:hover {
  background: hsl(var(--flexauto-primary) / 0.2);
}

.flexauto-ipbox-actions {
  margin-top: 1.5rem;
}

.flexauto-ipbox-add-to-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .flexauto-ipbox-shipping-fields {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   EXTRA SMALL SCREENS (≤ 480px / 375px)
   Tighter padding, smaller text for phones
   ======================================== */
@media (max-width: 480px) {
  .flexauto-form-section {
    padding: 1rem 0.5rem;
  }

  .flexauto-form-glass {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .flexauto-hero-title,
  .flexauto-form-title {
    font-size: 1.5rem;
  }

  .flexauto-hero-description {
    font-size: 0.875rem;
  }

  .flexauto-option-card {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }

  .flexauto-option-card-icon {
    padding: 0.5rem;
  }

  .flexauto-option-card-icon svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .flexauto-option-card-title {
    font-size: 0.9375rem;
  }

  .flexauto-option-card-description {
    font-size: 0.8125rem;
  }

  .flexauto-option-card-price {
    font-size: 0.8125rem;
  }

  .flexauto-step-title {
    font-size: 1.125rem;
  }

  .flexauto-step-description {
    font-size: 0.8125rem;
  }

  /* Order summary sidebar tighter */
  .flexauto-order-summary {
    padding: 1rem;
  }

  .flexauto-order-summary h3 {
    font-size: 1rem;
  }

  /* Sticky nav: tighter padding on small phones */
  .flexauto-sticky-nav {
    padding: 0.625rem 0.75rem;
  }

  .flexauto-sticky-nav-inner {
    gap: 6px;
  }

  .flexauto-sticky-nav-inner button {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
  }

  /* Step indicator compact */
  .flexauto-step-indicator {
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
  }

  .flexauto-step-item {
    font-size: 0.75rem;
  }
}

