/* assets/css/ds-popup.css */

/* Generic Overlay */
.ds-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: none;
    /* Toggled to flex by JS */
    align-items: center;
    justify-content: center;
    font-family: var(--wp--preset--font-family--body, inherit);
}

.ds-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* Base Box - Glassmorphism style */
.ds-popup-content-box {
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, #6cd5e8 0%, #d3f3af 100%);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    height: auto;
    max-height: 90vh;
    padding: 28px; /* This padding creates the "thick gradient border" look */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: ds-popup-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* If Image is provided */
.ds-popup-modal.has-image .ds-popup-content-box {
    max-width: none;
    flex-direction: row;
    /* Desktop layout: img left, text right */
}

.ds-popup-image-area {
    width: 50%;
    min-height: auto;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #fcfcfc;
}

.has-image .ds-popup-inner-area {
    width: 50%;
}

.ds-popup-inner-area {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    flex: 1;
    background: #fff;
    border-radius: 12px;
}

/* Close Button */
.ds-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    background-color: transparent !important;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000 !important;
    transition: all 0.3s ease;
    z-index: 20;
    padding: 0;
}

.ds-popup-close:hover {
    color: #111;
    transform: rotate(90deg);
}

/* Typography */
.ds-popup-title {
    font-size: 36px;
    font-family: var(--wp--preset--font-family--heading, inherit);
    margin: 0 0 15px 0;
    color: #111;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ds-popup-desc {
    font-size: 15px;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Forms & Inputs */
.ds-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.ds-input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    background: #fff;
    color: #333;
}

.ds-input-group input:focus {
    outline: none;
    border-color: #333;
}

.ds-popup-logo-wrap {
    margin-bottom: 25px;
}

.ds-popup-logo {
    max-height: 40px;
    width: auto;
}

.ds-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.ds-btn:hover {
    background: #333;
    color: #fff;
}

.ds-btn:active {
    transform: scale(0.98);
}

.ds-btn-block {
    width: 100%;
}

/* Responses */
.ds-register-response {
    font-size: 14px;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.ds-success {
    background: #e6f6ee;
    color: #0b7a42;
    border: 1px solid #a6e0c3;
}

.ds-error {
    background: #fcf1f1;
    color: #c00;
    border: 1px solid #fab8b8;
}

/* Product Grid inside Popup */
.ds-popup-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.ds-popup-product-card {
    text-align: center;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #eee;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ds-popup-product-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-5px);
}

.ds-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ds-product-img-wrap img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #f5f5f5;
    margin-bottom: 10px;
}

.ds-product-title {
    font-size: 13px;
    margin: 0 0 5px 0;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.ds-product-price {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.ds-product-price ins {
    text-decoration: none;
    color: #111;
}

/* Workshop */
.ds-workshop-content {
    font-size: 15px;
    color: #444;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Animations */
@keyframes ds-popup-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive constraints */
@media (max-width: 768px) {
    .ds-popup-modal.has-image .ds-popup-content-box {
        flex-direction: column;
        width: 90vw; /* 90vw on mobile maxes out space nicely */
        height: 80vh;
        max-width: none;
        overflow: hidden;
    }

    .ds-popup-image-area {
        width: 100%;
        min-height: 40vh; /* Dedicated ~40% space for image */
        flex: 0 0 40vh;
        background-size: contain;
        background-position: center bottom;
    }

    .has-image .ds-popup-inner-area {
        width: 100%;
        padding: 25px;
        flex: 1;
    }

    .ds-input-group {
        flex-direction: column;
    }
}
