/* Fixed Donation Bar Styles */

/* Wrapper handles positioning */
.dnf-fixed-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    /* Lowered from 99999999 to play nice with mini-carts */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

/* Ensure all internal elements use border-box */
.dnf-fixed-wrapper * {
    box-sizing: border-box;
}

/* 
 * Toggle Head (The Visible Bar) 
 */
.dnf-bar-toggle {
    background-color: #fff;
    /* White clean background */
    padding: 10px 0;
    /* Minimal padding */
    display: flex;
    justify-content: center;
    /* Center everything */
    align-items: center;
    cursor: pointer;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    /* Subtle shadow */
    border-top: 3px solid var(--dnf-main-color);
    /* Thinner border */
    position: relative;
}

.dnf-bar-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dnf-bar-title {
    font-size: 14px;
    /* Smaller, subtle font */
    font-weight: 600;
    color: #333;
    /* Neutral color, not main color */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dnf-bar-icon {
    font-size: 16px;
    color: var(--dnf-main-color);
    /* Only icon is colored */
    display: flex;
    align-items: center;
}

/* Arrow positioned absolutely to the right or subtle next to text? 
   User asked for subtle centered. Let's keep arrow but small.
*/
.dnf-bar-arrow {
    font-size: 12px;
    color: #999;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

/* Hover effect */
.dnf-bar-toggle:hover .dnf-bar-title {
    color: var(--dnf-main-color);
}

/* 
 * Expandable Panel 
 */
.dnf-bar-panel {
    background-color: #fff;
    padding: 20px;
    /* Equal padding top/bottom/left/right */
    display: none;
    /* Hidden by default */
    border-top: 1px solid #eee;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* Form Layout */
.dnf-fixed-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    /* Align inputs and button bottom */
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.dnf-fixed-row {
    display: flex;
    gap: 15px;
    flex: 1;
    align-items: flex-end;
    /* Align inputs and button to bottom */
}

.dnf-fixed-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
    justify-content: flex-end;
    /* Ensure content pushed to bottom */
}

.dnf-fixed-col label {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Inputs */
.dnf-fixed-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #f9f9f9;
    height: 48px !important;
    max-height: 48px !important;
    /* Fixed height for alignment */
    transition: all 0.2s;
}

.dnf-fixed-input:focus {
    border-color: var(--dnf-main-color);
    outline: none;
    background: #fff;
}

/* Price Wrapper */
.dnf-fixed-price-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dnf-fixed-currency {
    position: absolute;
    left: 14px;
    color: #666;
    font-weight: 600;
    z-index: 2;
}

.dnf-fixed-price-wrapper input {
    padding-left: 28px;
    /* Space for currency */
}

/* Price Hint (Min/Max) */
.dnf-fixed-hint {
    font-size: 11px;
    color: #888;
    height: 14px;
    /* Prevent jump */
    position: absolute;
    bottom: -18px;
    left: 0;
}

/* Submit Button */
.dnf-fixed-submit {
    flex: 1;
    background-color: var(--dnf-main-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    height: 48px !important;
    max-height: 48px !important;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s ease;
    /* Strict Centering */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    /* Reset line-height to avoid offset */
    white-space: nowrap;
}

.dnf-fixed-submit:hover {
    filter: brightness(1.1);
}

.dnf-fixed-submit.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Close Button (Visible inside panel) */
.dnf-fixed-close {
    position: absolute;
    top: -20px;
    /* Pull it up slightly out of panel or inside? User wants "x". Inside top right is standard or sticky out. */
    right: 15px;
    width: 24px;
    height: 24px;
    background: #eee;
    color: #666;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    display: none;
    /* JS toggles it? Or keeping it visible? HTML has generic display. */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding-bottom: 2px;
}

.dnf-fixed-close:hover {
    background: #ddd;
    color: #333;
}

/* 
 * Active State (Open)
 */
.dnf-fixed-wrapper.open .dnf-bar-toggle {
    display: none;
}

.dnf-fixed-wrapper.open .dnf-bar-panel {
    display: block;
    animation: dnfSlideUp 0.3s ease-out;
}

.dnf-fixed-wrapper.open .dnf-fixed-close {
    display: flex;
    top: 10px;
    /* Position inside panel */
    right: 10px;
}


@keyframes dnfSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

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

/* 
 * Responsive 
 */
@media (max-width: 768px) {
    .dnf-fixed-form {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding-top: 15px;
    }

    .dnf-fixed-row {
        flex-direction: column;
        /* Stack inputs on mobile */
        gap: 15px;
    }

    .dnf-fixed-col {
        width: 100%;
    }

    .dnf-fixed-submit {
        width: 100%;
        margin-top: 10px;
    }

    .dnf-fixed-wrapper.open {
        max-height: 85vh;
        /* Prevent covering full screen */
        overflow-y: auto;
    }

    .dnf-fixed-close {
        top: 10px;
        right: 10px;
    }
}