/* Frontend Styles for PDM WooCommerce Addon */

/* Popup Overlay */
.pdm-popup {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content (Standard Suggestion Popup) */
.pdm-popup-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.pdm-close {
    position: absolute;
    right: 25px;
    top: 20px;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    z-index: 10;
}

.pdm-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

/* Grid Layout */
.pdm-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.pdm-extra-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: box-shadow 0.3s;
    background: #fafafa;
}

.pdm-extra-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.pdm-extra-img img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    margin-bottom: 15px;
}

.pdm-extra-item h4 {
    margin: 10px 0 5px;
    font-size: 16px;
    color: #333;
}

.pdm-extra-item .price {
    font-weight: bold;
    color: #2271b1;
    margin-bottom: 15px;
    display: block;
}

.pdm-extra-message {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-height: 60px;
    resize: none;
}

/* Buttons */
.pdm-extra-item button,
.pdm-extra-link {
    display: block;
    width: 100%;
    background-color: #313B31;
    color: #fff;
    border: none;
    padding: 15px 1em;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    font-family: "Adamina", Sans-serif;
    font-size: 15px;
    text-transform: lowercase;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.pdm-extra-item button:hover,
.pdm-extra-link:hover {
    background-color: #3a4046;
    color: #fff;
    opacity: 0.9;
}

/* --- PREMIUM RELATIONSHIP POPUP --- */

#pdm-suggestion-popup .pdm-premium-popup {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    padding: 70px 50px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 95%;
    position: relative;
    overflow: hidden;
    animation: pdmPopIn 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Poppins', sans-serif;
}

@keyframes pdmPopIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pdm-popup-header {
    margin-bottom: 50px;
}

.pdm-popup-header h2 {
    font-size: 38px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    letter-spacing: -1.5px;
}

.pdm-header-line {
    width: 80px;
    height: 5px;
    background: linear-gradient(90deg, #2271b1, #3cacf1);
    margin: 0 auto;
    border-radius: 10px;
}

.pdm-rel-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 50px 0;
}

/* Principal Side */
.pdm-principal-side {
    position: relative;
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pdm-principal-side:hover {
    transform: scale(1.05) translateY(-10px);
}

.pdm-principal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(34, 113, 177, 0.2) 0%, transparent 70%);
    z-index: -1;
    animation: pdmPulse 5s infinite ease-in-out;
}

@keyframes pdmPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.pdm-principal-frame {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 12px solid #fff;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    background: #fff;
}

.pdm-principal-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.pdm-principal-side:hover .pdm-principal-frame img {
    transform: scale(1.15);
}

.pdm-product-badge {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Connector */
.pdm-rel-connector {
    width: 100px;
    display: flex;
    justify-content: center;
    color: #3b82f6;
    z-index: 1;
    animation: pdmFlow 2.5s infinite ease-in-out;
}

@keyframes pdmFlow {

    0%,
    100% {
        transform: translateX(-5px);
        opacity: 0.4;
    }

    50% {
        transform: translateX(10px);
        opacity: 0.9;
    }
}

/* Extra Side / Messenger Card */
.pdm-extra-side {
    z-index: 3;
}

.pdm-messenger-card {
    background: #fff;
    border-radius: 32px;
    width: 320px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: pdmSlideInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) calc(0.2s);
    text-align: left;
}

@keyframes pdmSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pdm-messenger-header {
    background: #f8fafc;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.pdm-extra-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pdm-extra-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pdm-extra-info {
    display: flex;
    flex-direction: column;
}

.pdm-extra-label {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.pdm-status {
    font-size: 12px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.pdm-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.pdm-messenger-body {
    padding: 24px;
    background: #fff;
}

.pdm-chat-bubble {
    background: #f1f5f9;
    padding: 20px 24px;
    border-radius: 24px 24px 24px 4px;
    color: #334155;
    font-size: 16px;
    line-height: 1.6;
    position: relative;
    font-style: italic;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pdm-chat-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -12px;
    width: 24px;
    height: 24px;
    background: #f1f5f9;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    z-index: -1;
}

/* Footer & mobile */
.pdm-popup-footer {
    margin-top: 50px;
    color: #94a3b8;
    font-size: 15px;
}

@media (max-width: 900px) {
    .pdm-rel-showcase {
        flex-direction: column;
        gap: 40px;
        margin: 30px 0;
    }

    .pdm-rel-connector {
        transform: rotate(90deg);
        width: auto;
        height: 60px;
        animation: pdmFlowVertical 2.5s infinite ease-in-out;
    }

    @keyframes pdmFlowVertical {

        0%,
        100% {
            transform: rotate(90deg) translateX(-5px);
            opacity: 0.4;
        }

        50% {
            transform: rotate(90deg) translateX(10px);
            opacity: 0.9;
        }
    }

    .pdm-principal-frame {
        width: 200px;
        height: 200px;
    }

    .pdm-messenger-card {
        width: 100%;
        max-width: 320px;
    }
}