/**
 * PopupNewsletter Custom - Styles
 * Version: 1.0.0
 */

/* ============================================
   PROMO BAR - CAROUSEL
   ============================================ */

#pnc-promo-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10001; /* SOPRA lo sticky header del tema (che è 10000) */
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.pnc-promo-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

/* Carousel Arrows */
.pnc-carousel-arrow {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.pnc-carousel-arrow:hover {
    opacity: 1;
    transform: scale(1.1);
}

.pnc-carousel-arrow svg {
    width: 20px;
    height: 20px;
}

/* Carousel Wrapper */
.pnc-carousel-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 24px;
}

.pnc-carousel-track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carousel Messages */
.pnc-carousel-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    text-align: center;
}

.pnc-carousel-message.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: none;
    top: auto;
    left: auto;
}

.pnc-carousel-message:hover {
    opacity: 0.8;
}

/* Link message */
a.pnc-carousel-message:hover {
    text-decoration: none;
}

/* Close button (hidden) */
.pnc-promo-bar-close {
    position: fixed;
    top: 8px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    width: 30px;
    height: 30px;
    display: none; /* HIDDEN */
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: inherit;
    opacity: 0.9;
    transition: all 0.3s ease;
    z-index: 100000;
}

/* Add body padding when promo bar is visible */
body.pnc-promo-bar-visible {
    /* Padding rimosso - gestito dallo sticky header */
}

/* Push Thelma sticky header down when promo bar is visible */
body.pnc-promo-bar-visible .mkdf-page-header.mkdf-sticky-header {
    top: 50px !important;
    transition: top 0.3s ease;
}

body.pnc-promo-bar-visible .mkdf-page-header.mkdf-sticky-header.mkdf-sticky-header-appear {
    top: 50px !important;
    transition: top 0.3s ease;
}

/* Ensure sticky header is always below promo bar */
body.pnc-promo-bar-visible header.mkdf-page-header {
    top: 50px !important;
}

body.pnc-promo-bar-visible .mkdf-sticky-header {
    top: 50px !important;
}

/* Compensate for admin bar if present */
body.admin-bar.pnc-promo-bar-visible .mkdf-page-header.mkdf-sticky-header.mkdf-sticky-header-appear {
    top: 82px !important; /* 50px promo + 32px admin bar */
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    #pnc-promo-bar {
        padding: 8px 5px;
        z-index: 10001; /* Sopra tutto */
    }

    .pnc-promo-bar-container {
        gap: 5px;
        max-width: 100%;
    }

    .pnc-carousel-arrow {
        padding: 0px;
        flex-shrink: 0;
    }

    .pnc-carousel-arrow svg {
        width: 14px;
        height: 14px;
    }

    .pnc-carousel-message {
        font-size: 11px;
        white-space: normal;
        max-width: 100%;
        line-height: 1.3;
        padding: 0 2px;
    }

    .pnc-carousel-wrapper {
        min-height: 20px;
        flex: 1;
        overflow: hidden;
    }

    /* Push content down on mobile */
    body.pnc-promo-bar-visible {
        padding-top: 45px !important;
    }

    /* Header normale (non sticky) deve essere sotto la promo bar */
    body.pnc-promo-bar-visible .mkdf-page-header {
        margin-top: 0 !important;
        z-index: 10000 !important; /* Sotto la promo bar */
    }

    /* Push Thelma sticky header down on mobile quando diventa sticky */
    body.pnc-promo-bar-visible .mkdf-page-header.mkdf-sticky-header {
        top: 45px !important;
        transition: top 0.3s ease;
    }

    body.pnc-promo-bar-visible .mkdf-page-header.mkdf-sticky-header.mkdf-sticky-header-appear {
        top: 45px !important;
        transition: top 0.3s ease;
    }

    body.pnc-promo-bar-visible header.mkdf-page-header.mkdf-sticky-header {
        top: 45px !important;
    }

    body.admin-bar.pnc-promo-bar-visible .mkdf-page-header.mkdf-sticky-header.mkdf-sticky-header-appear {
        top: 77px !important; /* 45px promo + 32px admin bar */
    }
}

/* ============================================
   POPUP NEWSLETTER - 2-COLUMN LAYOUT
   ============================================ */

#pnc-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

#pnc-popup-container {
    position: relative;
    max-width: 900px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: popupSlideIn 0.4s ease;
    overflow: hidden;
}

@keyframes popupSlideIn {
    from {
        transform: scale(0.9) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Popup Close Button */
.pnc-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-weight: 300;
}

.pnc-popup-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: rotate(90deg);
}

/* Inner Container - 2 Columns */
.pnc-popup-inner {
    display: flex;
    flex-direction: row;
    min-height: 500px;
}

/* Left Column: Image */
.pnc-popup-image-col {
    flex: 0 0 45%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.pnc-popup-image-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Right Column: Content + Form */
.pnc-popup-content-col {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Header */
.pnc-popup-header {
    margin-bottom: 30px;
    text-align: center;
}

.pnc-popup-header h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 15px 0;
    letter-spacing: -0.5px;
}

.pnc-popup-header p {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

/* Simple Form */
.pnc-simple-form {
    margin-bottom: 20px;
}

.pnc-simple-form input[type="email"] {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.pnc-simple-form input[type="email"]:focus {
    border-color: #000000;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.pnc-simple-form button[type="submit"] {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.pnc-simple-form button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.pnc-simple-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Privacy Text */
.pnc-popup-privacy {
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
    margin-top: 15px;
}

.pnc-popup-privacy a {
    text-decoration: underline;
    color: inherit;
}

.pnc-popup-privacy a:hover {
    text-decoration: none;
}

/* Form Response Messages */
.pnc-form-response {
    margin-top: 12px;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.pnc-form-response.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pnc-form-response.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pnc-form-response p {
    margin: 0;
}

/* ============================================
   RESPONSIVE - TABLET & MOBILE
   ============================================ */

/* Tablet: Stack columns vertically */
@media screen and (max-width: 900px) {
    .pnc-popup-inner {
        flex-direction: column;
        min-height: auto;
    }

    .pnc-popup-image-col {
        flex: 0 0 auto;
        height: 300px;
    }

    .pnc-popup-content-col {
        padding: 40px 30px;
    }

    .pnc-popup-header h2 {
        font-size: 24px;
    }

    .pnc-popup-header p {
        font-size: 14px;
    }
}

/* Mobile: Hide desktop popup, show mobile version */
@media screen and (max-width: 768px) {
    #pnc-popup-overlay {
        display: none !important;
    }
}

/* Popup Mobile - Full Screen */
#pnc-popup-mobile {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #ffffff !important;
    z-index: 9999999 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

#pnc-popup-mobile .pnc-mobile-close {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#pnc-popup-mobile .pnc-mobile-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: rotate(90deg);
}

/* Mobile Image */
#pnc-popup-mobile .pnc-popup-image-mobile {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

#pnc-popup-mobile .pnc-popup-image-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mobile Content */
#pnc-popup-mobile .pnc-popup-content-mobile {
    padding: 35px 25px;
}

/* Hide mobile popup on desktop */
@media screen and (min-width: 769px) {
    #pnc-popup-mobile {
        display: none !important;
    }
}
