/* Reset y base */

.mh-b2b-wrapper {
    display: grid;
    grid-template: 200px max-content 1fr / 1fr;
}

.mh-b2b-hero-image{
    grid-area: 1 / 1 / 3 / 2;
}

/* Container principal */
.mh-b2b-container {
    grid-area: 2 / 1 / 4 / 2;
    display: flex;
    width: 96dvw;
    max-width: 900px;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 30px;
    box-shadow: -1px 5px 9px 1px #ccc;
    margin: 1rem  auto 30px;
    background: #fff;
    z-index: 1;
    position: relative;
}

/* Grupos de campos */

.mh-b2b-form-group{
  position: relative;
}

.mh-b2b-form-group.mh-b2b-full-width {
    width: 100%;
    grid-column: span 2;
}

.mh-b2b-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.mh-b2b-form{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mh-b2b-form-group-link {
  font-weight: 400;
  font-style: normal;
  letter-spacing: normal;
  line-height: normal;

  color: #374151;
  font-size: 0.9rem;
  text-align: left;
  align-items: flex-end;
  margin-left: 5px;
}

.mh-b2b-form-group-checkbox-content{
  display: grid;
  grid-template-columns: max-content 1fr;
}

@media (max-width: 600px) {
    .mh-b2b-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .mh-b2b-container {
        margin: 10px;
        padding: 30px 8px;
    }
    
    header {
        padding: 30px 20px 20px;
    }
    
    .mh-b2b-form {
        padding: 0 20px 30px;
    }
}

/* Labels */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

label.mh-b2b-required::after {
    content: " *";
    color: #a92525;
    font-weight: 600;
}

/* Inputs y selects */
input[type="number"],
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select {
    box-sizing: border-box;
    width: 100%;
    padding: 5px 16px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: white;
    color: #374151;
  	margin-bottom: 0
}

select {
    padding-inline-end: 0;
}

input[type="number"]::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="number"].mh-b2b-error,
input[type="text"].mh-b2b-error,
input[type="email"].mh-b2b-error,
input[type="tel"].mh-b2b-error,
input[type="date"].mh-b2b-error,
select.mh-b2b-error {
    border-color: #a92525;
}

input[type="number"].mh-b2b-success,
input[type="text"].mh-b2b-success,
input[type="email"].mh-b2b-success,
input[type="tel"].mh-b2b-success,
input[type="date"].mh-b2b-success,
select.mh-b2b-success {
    border-color: #10b981;
}

/* Gender fieldset styles */
.mh-b2b-gender-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.mh-b2b-gender-fieldset legend {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
    padding: 0;
}

/* Checkbox fieldset styles */
.mh-b2b-checkbox-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.mh-b2b-checkbox-fieldset legend {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
    padding: 0;
}

.mh-b2b-checkbox-fieldset legend.mh-b2b-required::after {
    content: " *";
    color: #a92525;
    font-weight: 600;
}

.mh-b2b-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.mh-b2b-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #000;
    margin: 0;
    cursor: pointer;
}

.mh-b2b-checkbox-item label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    font-size: 0.9rem;
}

.mh-b2b-radio-group {
    margin-top: 1rem;
    display: flex;
    gap: 30px;
    align-items: center;
}

.mh-b2b-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    margin: 0;
}

.mh-b2b-radio-item label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Mensajes de error */
.mh-b2b-error-message {
    color: #a92525;
    font-size: 0.8rem;
    margin-top: 4px;
    min-height: 16px;
    display: block;
}
.mh-b2b-error-message.hidden {
   opacity: 0;
}

/* Botones */
.mh-b2b-form-actions {
    margin-top: 30px;
    text-align: center;
}

.mh-b2b-btn {
    padding: 14px 32px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 160px;
}

.mh-b2b-btn-primary {
    font-family: inherit;
    width: 100%;
    background-color: #000;
    color: white;
}

.mh-b2b-btn-primary:hover {
    background-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.mh-b2b-btn-primary:active {
    transform: translateY(0);
}

.mh-b2b-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #ccc;
    margin-right: 10px;
}

.mh-b2b-btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

/* Mensaje de éxito */
.mh-b2b-success-message {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 16px;
    margin-top: 20px;
    text-align: center;
}

.mh-b2b-success-message h3 {
    color: #166534;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.mh-b2b-success-message p {
    color: #15803d;
    font-size: 0.9rem;
}

.mh-b2b-hero-img{
    display: block;
    width: 100%;
    height: auto;
    max-width: unset;
}

.mh-b2b-subTitle,
.mh-b2b-title {
    margin: 0 auto;
    text-align: center;
    font-size: 25px;
    font-weight: 400;
}

.mh-b2b-subTitle {
    margin-bottom: 32px;
    font-size: 16px;
}
/* Responsive adjustments */
@media (max-width: 480px) {

    
    .mh-b2b-subtitle {
        font-size: 0.9rem;
    }
    
    .mh-b2b-radio-group {
        gap: 20px;
    }
    
    .mh-b2b-btn {
        padding: 12px 24px;
        min-width: 140px;
        font-size: 0.95rem;
    }
}

/* Focus states for accessibility */
input:focus,
select:focus,
button:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Loading state */
.mh-b2b-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Custom select arrow */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
}

/* Modal Styles */
.mh-b2b-modal {
    padding: 0;
    margin: auto;
    border: none;
    background: transparent;
    max-width: 500px;
    width: 90vw;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;

    z-index: 1000;
}

.mh-b2b-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: backdropFadeIn 0.3s ease-out;
}

.mh-b2b-modal-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.mh-b2b-modal-header {
    padding: 24px 24px 0 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.mh-b2b-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mh-b2b-modal-icon-success {
    background-color: #F0FDF4;
}

.mh-b2b-modal-icon-error {
    background-color: #FEF2F2;
}

.mh-b2b-modal-close {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mh-b2b-modal-close:hover {
    background-color: #F3F4F6;
    color: #374151;
}

.mh-b2b-modal-close:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

.mh-b2b-modal-body {
    padding: 16px 24px 24px 24px;
    flex: 1;
}

.mh-b2b-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.4;
}

.mh-b2b-modal-description {
    color: #6B7280;
    line-height: 1.5;
    margin: 0;
}

.mh-b2b-modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Modal animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal closing animation */
.mh-b2b-modal.closing {
    animation: modalSlideOut 0.2s ease-in forwards;
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* Responsive modal styles */
@media (max-width: 480px) {
    .mh-b2b-modal {
        width: 95vw;
        max-width: none;
    }
    
    .mh-b2b-modal-header,
    .mh-b2b-modal-body,
    .mh-b2b-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .mh-b2b-modal-footer {
        flex-direction: column;
    }
    
    .mh-b2b-modal-footer .mh-b2b-btn {
        width: 100%;
        justify-content: center;
    }
    
    .mh-b2b-modal-title {
        font-size: 1.125rem;
    }
}


/* Hide modal by default */
.mh-b2b-modal:not([open]) {
    display: none;
}

.mh-b2b-form-tootip{ 
  position: absolute;
  padding: 16px;
  background-color: #fff0ca;
  color: #666;
  bottom: -38%;
  z-index: 2;
  display: none;
  border-radius: 3px;
}

.mh-b2b-form-tootip::before{
  content: "";
  width: 15px;
  height: 15px;
  background-color: #fff0ca;
  position: absolute;
  top: -8px;
  transform: rotate(45deg);;
}
