/* Contact Form Popup Styles */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.popup-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 5px 10px 0;
    border-radius: 12px 12px 0 0;
}

.popup-close {
    background: none;
    border: 1px solid #c4cd26;
    font-size: 3em;
    cursor: pointer;
    color: #c4cd26;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    padding-bottom: 4px;
}

.popup-close:hover {
    background: #f0f0f0;
    color: #92b332;
}

.popup-body {
    padding: 10px 30px 20px;
    display: flex;
    gap: 20px;
}


.warranty-form-container a.cd-upload-btn
{
    color: #c3cc21;
    
}
.codedropz-upload-inner h3
{
    font-weight: 500;
}
/* Contact Form Header (Green Section) */
.contact-form-header {
    flex: 0 0 40%;
    min-width: 300px;
    text-align: center;
    justify-items: center;
}

.contact-form-header span.ask-about {
    font-size: 18px;
    color: #505050;
    margin: 10px 0 10px 0;
    font-weight: 700;

}

.contact-form-header .product-name {

    margin: 0 0 20px 0;
    line-height: 1.2;
    font-weight: 500;
    font-size: 35px;
}

.contact-form-header p {
    color: #505050;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.balanced-body-logo {
    text-align: left;
    padding-top: 30px;
    transition: transform 0.6s ease;
    
}

.balanced-body-logo img {
    max-width: 200px;
    height: auto;
}
.balanced-body-logo.balanced-body-logo:hover{
    transform: scale(1.02);
}
/* Contact Form Fields (Red Section) */
.contact-form-fields {
    flex: 0 0 57%;
    min-width: 400px;
}

.wpcf7-form {
    margin: 0;
}

.form-fields-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
}

.field-grid-3x1 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.field-row-full {
    width: 100%;
}

.mt-15 {
	margin-top:15px;
}

/* Inline embed: strona kontaktu, wpisy/strony z shortcode CF7 (ten sam formularz co popup) */
span.form-message {
    display: block;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -1px;
}

span.form-message2 {
    display: block;
    font-weight: 300;
    font-size: 16px;
    margin-bottom:15px;
}

.contact-form-container,
.contact-form-fields .wpcf7,
.entry-content .wpcf7:has(.field-grid-3x1):not(.contact-form-container .wpcf7),
.entry-content .wpcf7:has(.submit-section):not(.contact-form-container .wpcf7) {
    position: relative;
    border-radius: 10px;
    padding: 30px;
    font-size: 14px;
    border: 3px solid #c4cd26;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.contact-form-container {
    display: flex;
    flex-direction: column;
}

/* CF7 wewnątrz .contact-form-container (strona kontakt) — jedna ramka na rodzicu */
.contact-form-container .wpcf7 {
    border: none;
    padding: 0;
    margin: 0;
    max-width: none;
}

.contact-form-container .wpcf7:before {
    display: none;
}

.entry-content .wpcf7:has(.field-grid-3x1):not(.contact-form-container .wpcf7),
.entry-content .wpcf7:has(.submit-section):not(.contact-form-container .wpcf7) {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    width: 100%;
}

.contact-form-container:before,
.entry-content .wpcf7:has(.field-grid-3x1):not(.contact-form-container .wpcf7):before {
    content: "";
    position: absolute;
    right: 18px;
    bottom: -25px;
    width: 59px;
    height: 42px;
    background: #fff url(../../img/wiadomosc.jpg) no-repeat center/45px 36px;
    border-radius: 6px;
}

.contact-form-container .form-field label,
.entry-content .wpcf7-form .form-field label,
.contact-form-fields .wpcf7-form .form-field label {
    display: block;
    padding-left: 15px;
    line-height: 2;
}

.entry-content .wpcf7-form .submit-section .left-column {
    flex: 1;
    min-width: 200px;
    text-align: left;
}

.entry-content .wpcf7-response-output {
    margin: 1em 0 0;
}

@media (max-width: 768px) {
    .contact-form-container:before,
    .entry-content .wpcf7:has(.field-grid-3x1):not(.contact-form-container .wpcf7):before {
        right: 18px;
        bottom: -25px;
    }
}

/* Form Input Styles */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #c4cd26 !important;
    border-radius: 10px !important;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}
input.input
 {
    border: 1px solid #c4cd26 !important;
    border-radius: 10px !important;
    background-color: #fff !important;
}
.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form textarea:focus {
    outline: none;
    border-color: #c4cd26;
    box-shadow: 0 0 0 3px rgba(164, 198, 57, 0.1);
}

.wpcf7-form input::placeholder,
.wpcf7-form textarea::placeholder {
    color: #999;
    font-weight: 400;
}

.wpcf7-form textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* Submit Section */
.submit-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.wpcf7-form input[type="submit"] {
    background: #c4cd26;
    color: #505050;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpcf7-form input[type="submit"]:hover {
    background: #c4cd26;
    color: #505050;
    opacity: 0.7;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(164, 198, 57, 0.3);
}
.right-column {
    font-size: 14px;
    display: flex;
    flex-direction: row-reverse;
}
.privacy-notice {
    padding-top: 7px;
}

.privacy-notice a {
    color: #505050!important;
    text-decoration: underline;
    text-decoration-color: rgb(195, 204, 33);
    transition: color 0.3s ease;
}

.privacy-notice a:hover {
    color: #505050;
    opacity: 0.7;
}

/* Error and Success Messages */
.wpcf7-not-valid-tip {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

.wpcf7-validation-errors {
    background: #fee;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.wpcf7-mail-sent-ok {
    background: #d4edda;
    border: 1px solid #c4cd26!important;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .popup-content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-height: calc(100vh - 60px);
        margin: 0;
    }
    
    .popup-body {
        flex-direction: column;
        gap: 30px;
     }
    
    .contact-form-header,
    .contact-form-fields {
        min-width: auto;
    }
    

    
    .field-grid-2x2,
    .field-grid-3x1 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }
    
    .submit-section {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .wpcf7-form input[type="submit"] {
        width: 100%;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {

    
    
    .contact-form-header h2.product-name {
        font-size: 1.6em;
    }
    
    .wpcf7-form input[type="text"],
    .wpcf7-form input[type="email"],
    .wpcf7-form input[type="tel"],
    .wpcf7-form textarea {
        padding: 12px 15px;
        font-size: 0.95em;
    }
}

/* Popup Animations */
.popup-overlay {
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.popup-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    animation: overlayFadeIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.popup-overlay.closing {
    animation: overlayFadeOut 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.popup-content {
    transform: translate(-50%, -50%) scale(0.7) rotateY(15deg);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.active .popup-content {
    animation: popupSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translate(-50%, -50%) scale(1) rotateY(0deg);
}

.popup-overlay.closing .popup-content {
    animation: popupSlideOut 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
    transform: translate(-50%, -50%) scale(0.8) rotateY(-10deg);
}

/* Close Button Animation */
.popup-close {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.popup-close::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(196, 205, 38, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: #f0f0f0;
    color: #92b332;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(146, 179, 50, 0.3);
}

.popup-close:hover::before {
    width: 100%;
    height: 100%;
}

.popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Form Field Animations */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
    position: relative;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(196, 205, 38, 0.15);
}

/* Submit Button Enhanced Animation */
.wpcf7-form input[type="submit"] {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.wpcf7-form input[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateY(-50%);
    transition: left 0.6s ease;
}

.wpcf7-form input[type="submit"]:hover {
    background: #92b332;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(196, 205, 38, 0.4);
}

.wpcf7-form input[type="submit"]:hover::before {
    left: 100%;
}

.wpcf7-form input[type="submit"]:active {
    transform: translateY(-1px) scale(0.98);
}

/* Stagger Animation for Form Elements */
.popup-overlay.active .contact-form-header,
.popup-overlay.active .contact-form-fields > * {
    animation: slideInUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.popup-overlay.active .contact-form-header {
    animation-delay: 0.1s;
}

.popup-overlay.active .field-grid-2x2 > :nth-child(1) {
    animation-delay: 0.2s;
}

.popup-overlay.active .field-grid-2x2 > :nth-child(2) {
    animation-delay: 0.25s;
}

.popup-overlay.active .field-grid-2x2 > :nth-child(3) {
    animation-delay: 0.3s;
}

.popup-overlay.active .field-grid-2x2 > :nth-child(4) {
    animation-delay: 0.35s;
}

.popup-overlay.active .field-row-full {
    animation-delay: 0.4s;
}

.popup-overlay.active .submit-section {
    animation-delay: 0.5s;
}

/* Keyframes */
@keyframes overlayFadeIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

@keyframes overlayFadeOut {
    0% {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
    100% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes popupSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7) rotateY(15deg);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05) rotateY(5deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    }
}

@keyframes popupSlideOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotateY(-10deg);
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
