@media (max-width: 1536px) {
  .pricing .box {
    width: 100%;
  }
}

/* Responsive Form Layout */
/* Desktop layout - maintain horizontal structure for wide screens */
@media (min-width: 1200px) {
  .form-group.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
  }
  
  .form-group.row .col-sm-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
  }
  
  .step .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
  }
}

/* Tablet layout - 2 column approach */
@media (min-width: 768px) and (max-width: 1199px) {
  .form-group.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
  }
  
  .form-group.row .col-sm-4:first-child {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: bold;
  }
  
  .form-group.row .col-sm-4:nth-child(2),
  .form-group.row .col-sm-4:nth-child(3) {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 10px;
    padding-left: 10px;
  }
}

/* Mobile Sticky Plan Tabs - Only visible on mobile */
@media (max-width: 767px) {
  .mobile-plan-tabs {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none; /* Initially hidden */
    transition: all 0.3s ease;
  }
  
  /* Ensure proper spacing for footer when mobile tabs are visible */
  body.mobile-tabs-active .content {
    padding-bottom: 3rem; /* Extra space when tabs are active */
  }
  
  .mobile-plan-tabs.has-calculations {
    display: block; /* Show when calculations exist */
  }
  
  .tab-container {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .plan-tab {
    flex: 1;
    min-width: 100px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
  }
  
  .plan-tab:hover {
    border-color: #ced4da;
    transform: translateY(-1px);
  }
  
  .plan-tab.active {
    background: rgb(148, 111, 68);
    border-color: rgb(148, 111, 68);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(148, 111, 68, 0.3);
  }
  
  .tab-header {
    text-align: center;
    margin-bottom: 0.25rem;
  }
  
  .tab-title {
    font-weight: 600;
    font-size: 0.9rem;
  }
  
  .tab-price-container {
    text-align: center;
    margin-bottom: 0.25rem;
  }
  
  .tab-price {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
  }
  
  .plan-tab.active .tab-price {
    opacity: 1;
  }
  
  .tab-subtitle {
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: center;
    margin-bottom: 0.25rem;
  }
  
  .plan-tab.active .tab-subtitle {
    opacity: 0.9;
  }
  
  .tab-commission {
    font-size: 0.65rem;
    opacity: 0.8;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
    min-height: 16px;
  }
  
  .plan-tab.active .tab-commission {
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
  }
  
  /* Initially show all cards on mobile (stacked behavior) */
  .plan-card {
    display: flex !important;
    transition: all 0.3s ease;
  }
  
  /* Only apply single-card view when tabs switching is active */
  body.mobile-tabs-active .plan-card {
    display: none;
    opacity: 0;
    transform: translateY(10px);
  }
  
  body.mobile-tabs-active .plan-card.active-plan {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Smooth tab price updates */
  .tab-price {
    transition: all 0.2s ease;
  }
  
  /* Card appear animation */
  @keyframes cardSlideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .plan-card.active-plan {
    animation: cardSlideIn 0.3s ease;
  }
}

/* Hide mobile tabs on desktop/tablet */
@media (min-width: 768px) {
  .mobile-plan-tabs {
    display: none;
  }
  
  .plan-card {
    display: flex !important;
  }
}


/* Comparison Modal Styles */
.comparison-table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.comparison-table {
  min-width: 600px;
  margin-bottom: 0;
}

.comparison-table .feature-column {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
  border-right: 2px solid #e9ecef;
  min-width: 180px;
}

.comparison-table .plan-column {
  text-align: center;
  min-width: 150px;
  padding: 0;
}

.plan-header {
  padding: 1rem;
  color: white;
  border-radius: 0.5rem 0.5rem 0 0;
}

.plan-header.stain-plan {
  background: rgb(157, 124, 85);
}

.plan-header.premium-plan {
  background: #6ca135;
}

.plan-header.premium-plus-plan {
  background: #df8a30;
}

.plan-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.plan-price {
  font-size: 0.8rem;
  opacity: 0.9;
}

.feature-name {
  font-weight: 500;
  color: #495057;
  border-right: 2px solid #e9ecef;
}

.feature-value {
  text-align: center;
  padding: 0.75rem;
}

.feature-value i {
  font-size: 1.2rem;
}

.comparison-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.comparison-actions .btn-buy {
  flex: 1;
  min-width: 150px;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

/* Mobile comparison modal adjustments */
@media (max-width: 767px) {
  .comparison-table {
    font-size: 0.8rem;
  }
  
  .plan-header {
    padding: 0.75rem 0.5rem;
  }
  
  .plan-title {
    font-size: 0.8rem;
  }
  
  .plan-price {
    font-size: 0.7rem;
  }
  
  .feature-value {
    padding: 0.5rem 0.25rem;
  }
  
  .comparison-actions {
    flex-direction: column;
  }
  
  .comparison-actions .btn-buy {
    min-width: auto;
  }
}

/* Mobile layout - vertical structure */
@media (max-width: 767px) {
  .step .row {
    display: none; /* Hide the headers row on mobile */
  }
  
  .form-group.row {
    display: block;
    margin: 0;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
  }
  
  .form-group.row .col-sm-4 {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin-bottom: 0.75rem;
  }
  
  .form-group.row .col-sm-4:first-child {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: #495057;
    margin-bottom: 1rem;
  }
  
  .form-group.row .col-sm-4:nth-child(2) label,
  .form-group.row .col-sm-4:nth-child(3) label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #6c757d;
  }
  
  .form-group.row .col-sm-4:last-child {
    margin-bottom: 0;
  }
  
  /* Add labels for mobile */
  .form-group.row .col-sm-4:nth-child(2)::before {
    content: "# of Items";
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #6c757d;
  }
  
  .form-group.row .col-sm-4:nth-child(3)::before {
    content: "Amount Paid";
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #6c757d;
  }
  
  /* Special styling for Total Paid row */
  .form-group.row:last-of-type {
    background-color: #e9ecef;
    border: 2px solid #6c757d;
    margin-top: 1.5rem;
  }
  
  .form-group.row:last-of-type .col-sm-4:first-child {
    color: #212529;
    font-size: 1.2rem;
  }
  
  /* Ensure form controls have proper spacing on mobile */
  .form-control {
    margin-bottom: 0;
  }
  
  /* Step container spacing for mobile */
  .step {
    padding: 0.5rem;
  }
  
  /* CRITICAL FIX: Override fixed heights with high specificity */
  .flip-container {
    min-height: auto !important; /* Override fixed height for better mobile experience */
    height: auto !important;
  }
  
  /* Override the inline CSS with maximum specificity */
  .pricing .flip-container .front {
    min-height: auto !important; /* Override 580px fixed height */
    height: auto !important;
  }
  
  .pricing .flip-container .front .box {
    height: auto !important;
    min-height: auto !important;
    display: block !important; /* Override flex layout for better content flow */
  }
  
  .pricing .flip-container .front .box-content {
    height: auto !important; /* CRITICAL: Override 540px fixed height */
    min-height: auto !important;
    display: block !important; /* Override flex to allow natural flow */
    padding: 1rem !important; /* Better mobile padding */
  }
  
  /* Make all content sections flexible on mobile */
  .pricing .flip-container .front .box-content h2,
  .pricing .flip-container .front .box-content .card-subtitle,
  .pricing .flip-container .front .box-content h6,
  .pricing .flip-container .front .box-content .center-content {
    height: auto !important;
    flex-shrink: 1 !important; /* Allow content to shrink naturally */
    margin-bottom: 1rem !important;
  }
  
  /* CRITICAL: Ensure buttons are always visible */
  .pricing .flip-container .front .box-content .btn-container {
    height: auto !important; /* Override 100px fixed height */
    margin-top: 1.5rem !important; /* Ensure proper spacing */
    flex-shrink: 0 !important; /* Never allow buttons to be hidden */
    position: static !important; /* Ensure normal document flow */
  }
  
  /* Ensure button styling remains intact */
  .pricing .flip-container .front .box-content .btn-container .select-plan-btn {
    display: inline-block !important;
    width: auto !important;
    padding: 0.75rem 1.5rem !important;
    margin: 0 !important;
  }
}

/* Desktop - now uses dynamic heights like mobile */
@media (min-width: 768px) {
  /* Allow dynamic heights on desktop too - JavaScript will handle sizing */
  .pricing .flip-container .front {
    min-height: auto !important; /* Changed from fixed 580px to auto */
    height: auto !important;
  }
  
  .pricing .flip-container .front .box-content {
    height: auto !important; /* Changed from fixed 540px to auto */
    min-height: auto !important;
    display: flex !important; /* Maintain desktop flex layout */
    flex-direction: column !important;
  }
  
  .pricing .flip-container .front .box-content .btn-container {
    height: auto !important; /* Changed from fixed 100px to auto */
    margin-top: auto !important; /* Push buttons to bottom */
    flex-shrink: 0 !important;
    padding: 1rem 0 !important;
  }
}

  .container-xl, .container-lg, .container-md, .container-sm, .container {
    max-width: 100%;
  }

  .h2, h2 {
      font-size: 1.8rem;
  }

    .qty-container {
      display: flex;
      align-items: center;
      position: relative;
      padding-left: 5px;
      margin-bottom: 12px;
      cursor: pointer;
      font-size: 20px;
      user-select: none;
      font-weight: 700;
      color: rgb(21, 21, 21);
      align-self: center;
    }

     .quantity {
      margin-left: 10px;
      padding: 5px;
      font-size: 16px;
      border: 1px solid #ddd;
      border-radius: 5px;
    }

  .pricing .box {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
  }

  .btn-container {
      display: flex;
      justify-content: center;
      gap: 10px;
      margin-top: auto;
  }

.btn-now {
    display: inline-block;
    padding: 8px 15px 8px 15px;
    border-radius: 50px;
    color: #fff;
    transition: none;
    font-size: 16px;
    font-weight: 400;
    font-family: "Nunito", sans-serif;
    font-weight: 600;
    transition: 0.3s;
    border: 1px solid rgb(148, 111, 68);
    background: rgb(148, 111, 68);
}

.btn-now:hover {
  color: rgb(148, 111, 68);
  text-decoration: none;
  background: #F0F0F0;
}

h2 {
margin-bottom : 2rem !important;
}


  .box-content {
      flex-grow: 1;
  }

  .price-range {
      margin-bottom: 1rem;
  }

.price-range {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  text-align: left;
}

.radio-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 20px;
  user-select: none;
  font-weight: 700;
  color: rgb(21, 21, 21);
  justify-content: space-between;
}

.radio-container small {
  font-size: 14px;
}

.radio-container input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: #eee;
  border-radius: 50%;
}

.radio-container input:checked~.checkmark {
  background-color: #2196F3;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.radio-container input:checked~.checkmark:after {
  display: block;
}

.checkmark:after {
  top: 9px;
  left: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}

.radio-container .qty-container {
  display: flex;
  align-items: center;
}

.radio-container .qty-container span {
  margin-right: 5px;
  font-size: 16px;
  font-weight: 400;
}

.radio-container select {
  margin-left: 10px;
  padding: 5px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.radio-container input[type="number"] {
  display: none;
  margin-left: 10px;
  width: 60px;
  padding: 5px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 5px;
  text-align: center;
}