/* grid */
.pfm-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 8px;
}
/* label wraps input + card to make whole card clickable */
.pfm-product-option {
    display: block;
    cursor: pointer;
    margin: 0; padding: 0;
}
.pfm-product-option input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none;
    width: 1px; height: 1px;
}
.pfm-product-card {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;    
    display: flex;
    flex-direction: column;
}
.pfm-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.10);
}
.pfm-product-media {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f3f4f6;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.pfm-product-media img {
    width: 100%; height: 100%; object-fit: contain;
    display: block;
    transition: transform .3s ease;
    background-color: #fff;
}
.pfm-product-body {
    padding: 25px 20px 20px;
    position: relative;    
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    gap: 20px;
    
}
.pfm-product-desc {
    font-size: 0.84rem;
    line-height: 1.2rem;
    color: #4b5563;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pfm-product-meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.pfm-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: #529996; /* brand dark green */
}
.pfm-price-compare {
    font-size: 0.85rem;
    color: #6b7280;
    text-decoration: line-through;
    margin-left: 6px;
}
.pfm-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.pfm-badge.instock  { background: #fdbb87; color: #000; } /* peach */
.pfm-badge.outstock { background: #8fa2ca; color: #fff; } /* lavender */

/* selected state — style the card when its radio is checked */
.pfm-product-option input[type="radio"]:checked + .pfm-product-card {
    border-color: #529996; /* brand dark green */
    box-shadow: 0 0 0 3px rgba(82,153,150,0.25);
}

/* compact spacing with GF */
.gfield.airtable-products .gfield_description,
.gfield.airtable-products .gfield_choice {
    margin-top: 6px;
}

.pfm-product-brand {
    font-family: var(--e-global-typography-04bdbf2-font-family), Sans-serif;
    font-size: 12px;
    font-weight: var(--e-global-typography-04bdbf2-font-weight);
    text-transform: var(--e-global-typography-04bdbf2-text-transform);
    line-height: var(--e-global-typography-04bdbf2-line-height);
    letter-spacing: var(--e-global-typography-04bdbf2-letter-spacing);
    color: var(--e-global-color-accent);
    background-color: #FFF1E6;
    width: fit-content;
    display: flex;
    padding: 5px 10px;
    border-radius: 8px;    
    position: absolute;
    top: -15px;
    left: 20px;
}

.pfm-product-title {
    font-family: var(--e-global-typography-ef7b596-font-family), Sans-serif;
    font-size: 20px;
    font-weight: 800;
    line-height: 24px;
    letter-spacing: 0.1px;
    color: var(--e-global-color-secondary);
}

.pfm-product-media {
    border-bottom: 1px solid #e4e4e4;
}

.pfm-product-button-text {
    background-color: var(--e-global-color-accent);
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-size: var(--e-global-typography-accent-font-size);
    font-weight: var(--e-global-typography-accent-font-weight);
    text-transform: var(--e-global-typography-accent-text-transform);
    line-height: var(--e-global-typography-accent-line-height);
    color: var(--e-global-color-cc18669);
    border-radius: 10px 10px 10px 10px;
    padding: 10px 25px 10px 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}

.pfm-product-card:hover span.pfm-product-button-text {
    background: var(--e-global-color-5769fa8);
}

.pfm-products-grid {
    margin-top: 30px;
    margin-bottom: 30px;
}

.pfm-product-footer{
    display: flex;
    flex-direction: column;
}

.pfm-section-title, .pfm-section-title h3 {
    color: var(--e-global-color-15987e1);
    font-size: 32px !important;
    line-height: 38px !important;
    margin-bottom: 10px !important;
}

.pfm-section-title em {
    position: relative;
    display: inline-block;
    color: var(--e-global-color-accent);
}

.pfm-section-title em::before {
    content: '';
    width: 0;
    height: 100%;
    display: block;
    background: #FFF1E6;
    position: absolute;
    z-index: -1;
    left: -5px;
    right: -5px;    
    transition: width .6s ease-in-out;
    animation: full-width 0.6s ease-in-out forwards;
}

@keyframes full-width {
    from {
        width: 0;
    }
    to {
        width: calc(100% + 10px);
    }
}


.pfm-section-subtitle {
    font-family: var(--e-global-typography-45104e2-font-family), Sans-serif;
    font-size: var(--e-global-typography-45104e2-font-size);
    line-height: var(--e-global-typography-45104e2-line-height);
}

.airtable-products hr {
    margin-top: 40px !important;
    margin-bottom: 40px !important;
    border-color: #e4e4e4;
}

.pfm-products-section--upgrade > .pfm-section-title em{
    color: var(--e-global-color-primary);
}

.pfm-products-section--upgrade > .pfm-section-title em::before {
    background: #f2f6ff;
}

.pfm-product-cost-to-you {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 5px;
}

.pfm-product-cost-to-you span.pfm-product-price {
    font-weight: 600;
    color: #333;
    font-size: 24px;
    line-height: 24px;
}

span.pfm-product-price-text {
    max-width: 40px;
    font-size: 12px;
    font-weight: 500;
    font-style: italic;
    line-height: 12px;
}

.pfm-info-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.pfm-product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.pfm-product-popup-content {
    background: white;
    padding: 20px;
    border-radius: 5px;
    position: relative;
}

.pfm-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* Fondo del popup */
.pfm-product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Fondo oscuro con transparencia */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Asegura que esté por encima de otros elementos */
}

/* Contenido del popup */
.pfm-product-popup-content {
    background: #ffffff; /* Fondo blanco */
    padding: 20px; /* Espaciado interno */
    border-radius: 10px; /* Bordes redondeados */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Sombra para darle profundidad */
    max-width: 500px; /* Ancho máximo */
    width: 90%; /* Ancho relativo para pantallas pequeñas */
    text-align: center; /* Centrar el texto */
    position: relative; /* Necesario para posicionar el botón de cierre */
}

/* Botón de cierre */
.pfm-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #333; /* Color del botón */
    cursor: pointer;
    transition: color 0.3s ease;
}

.pfm-popup-close:hover {
    color: #ff0000; /* Cambia el color al pasar el mouse */
}

/* Animación de entrada del popup */
.pfm-product-popup-content {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .pfm-product-popup-content {
        padding: 15px;
        font-size: 14px;
    }
}

/* Spinner styles */
.pfm-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pfm-product-button-text.loading {
    pointer-events: none;
    opacity: 0.8;
}

.pfm-product-option.loading {
    pointer-events: none;
}

.pfm-product-option.loading .pfm-product-card {
    opacity: 0.7;
}

.gf_progressbar_wrapper {
    margin-bottom: 40px;
}

.gform_wrapper.gravity-theme .gf_progressbar_percentage.percentbar_blue{
    background-color: var(--e-global-color-6dcb352) !important;
}

.gform_wrapper.gravity-theme .gf_progressbar_blue {
    background: #f5f5f5 !important;
}

.gf_progressbar_title {
    display: none;
}