/* Wrapper for the trigger button */
.prdt-stry-wrapper {
    margin: 15px 0;
    display: block;
}

/* --- BUTTON STYLES --- */

/* We chain the classes (.button.alt) to make this selector stronger 
   than the default WooCommerce/Theme styles.
*/
button.prdt-stry-trigger.button.alt,
.prdt-stry-bottom-close {
    /* --- COLOR THEME --- */
    /* Normal State */
    background-color: var(--theme-palette-color-8);
    border: 2px solid var(--theme-palette-color-1);
    color: var(--theme-palette-color-1);

    /* --- HOVER THEME --- */
    transition: all 0.3s ease;
    width: 100%;
}

button.prdt-stry-trigger.button.alt:hover,
.prdt-stry-bottom-close:hover {
    background-color: var(--theme-palette-color-1);
    border-color: var(--theme-palette-color-8);
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* --- SHAPE & LAYOUT --- */
button.prdt-stry-trigger.button.alt,
.prdt-stry-bottom-close {
    padding: 5px 35px;

    /* RECTANGLE SHAPE (Overrides theme border-radius) */
    border-radius: 0;

    font-weight: 600;
    font-size: .7rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
    line-height: normal;

    /* Ensure no theme overrides these */
    margin-top: 0;
    margin-bottom: 0;
}

/* --- 1. MODAL CONTAINER --- */
.prdt-stry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}

.prdt-stry-modal.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

/* --- 2. OVERLAY --- */
.prdt-stry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* --- 3. THE BOX (Mobile Default = Full Screen) --- */
.prdt-stry-box {
    position: relative;
    background: #fff;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* MOBILE: Full Screen */
    width: 100%;
    height: 100%;
    border-radius: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.prdt-stry-modal.is-open .prdt-stry-box {
    transform: translateY(0);
}

/* --- 4. CONTENT SCROLL AREA --- */
.prdt-stry-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 60px 25px 100px;
    -webkit-overflow-scrolling: touch;
}

/* --- 5. TYPOGRAPHY --- */
.prdt-stry-title {
    margin: 0 0 20px;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.prdt-stry-body {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #444;
}

/* --- 6. CLOSE X BUTTON (Top Right) --- */
.prdt-stry-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    z-index: 20;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prdt-stry-close .dashicons {
    font-size: 24px;
    color: #999;
    transition: color 0.3s;
}

.prdt-stry-close:hover .dashicons {
    color: #333;
}

/* --- 7. STICKY FOOTER (Mobile Only) --- */
.prdt-stry-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
    text-align: center;
    pointer-events: none;
    z-index: 15;
}

.prdt-stry-bottom-close {
    pointer-events: auto;
    width: 100%;
    max-width: 300px;
}

/* =========================================
   DESKTOP STYLES (Screens > 768px)
   ========================================= */
@media (min-width: 768px) {

    .prdt-stry-box {
        /* Desktop Popup */
        width: 90%;
        max-width: 600px;
        height: auto;
        max-height: 85vh;

        border-radius: 0;
        /* Rectangle */
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);

        transform: scale(0.95);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s;
    }

    .prdt-stry-modal.is-open .prdt-stry-box {
        transform: scale(1);
        opacity: 1;
    }

    .prdt-stry-content {
        padding: 40px 40px 30px;
    }

    /* Hide sticky footer on desktop */
    .prdt-stry-footer {
        display: none;
    }
}

/* --- THEMES (Dark Mode Support) --- */
.prdt-stry-theme-dark .prdt-stry-box {
    background-color: #1a1a1a;
    color: #fff;
}

.prdt-stry-theme-dark .prdt-stry-body {
    color: #ccc;
}

.prdt-stry-theme-dark .prdt-stry-title {
    color: #fff;
}

.prdt-stry-theme-dark .prdt-stry-close .dashicons {
    color: #aaa;
}

.prdt-stry-theme-dark .prdt-stry-close:hover .dashicons {
    color: #fff;
}

.prdt-stry-theme-dark .prdt-stry-footer {
    background: linear-gradient(to top, #1a1a1a 70%, rgba(26, 26, 26, 0));
}