/* ==========================================================================
   Direct Buy Now - Frontend Stylesheet
   ========================================================================== */

/* --- [1] Predefined Button Styles --- */
.dbn-buy-now-button {
    width: 100%;
    transition: all 0.2s ease;
    margin-top: 10px;
    box-sizing: border-box;
    display: inline-block; /* Fix for alignment */
    text-align: center;
}

.single-product div.product .dbn-buy-now-button {
    width: auto;
    margin-top: 0;
    margin-left: 10px;
}

/* Style 1: Filled (Default) */
.dbn-btn-filled { background-color: #1a73e8 !important; border: 2px solid #1a73e8; color: #fff !important; }
.dbn-btn-filled:hover { background-color: #1765c7; border-color: #1765c7; color: #fff !important; }

/* Style 2: Outline */
.dbn-btn-outline { background-color: transparent !important; border: 2px solid #1a73e8 !important; color: #1a73e8 !important; }
.dbn-btn-outline:hover { background-color: #1a73e8; color: #fff !important; }

/* Style 3: Gradient */
.dbn-btn-gradient { background: linear-gradient(45deg, #3c0074, #4285f4); color: #fff !important; border: none; padding-top: 2px; padding-bottom: 2px; }
.dbn-btn-gradient:hover { opacity: 0.9; color: #fff !important; }
/* The gradient button needs specific padding on single product pages to align with WooCommerce buttons */
.single-product .dbn-btn-gradient { padding: 12px 14px !important; line-height: 1.5; }


/* Style 4: Minimal */
.dbn-btn-minimal { background: transparent; border: none; color: #1a73e8 !important; text-decoration: underline; padding: 10px; }
.dbn-btn-minimal:hover { color: #1765c7 !important; background: transparent; }


/* --- [2] Variation Popup Styles --- */

/* Popup Overlay */
.dbn-popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.dbn-popup-overlay.dbn-is-visible { opacity: 1; visibility: visible; }

/* Popup Content Box */
.dbn-popup-content { background-color: #fff; padding: 25px 30px; border-radius: 8px; position: relative; max-width: 450px; width: 95%; max-height: 90vh; overflow-y: auto; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transform: scale(0.9); transition: transform 0.3s ease; }
.dbn-popup-overlay.dbn-is-visible .dbn-popup-content { transform: scale(1); }

.dbn-popup-title { margin-top: 0; margin-bottom: 10px; font-size: 1.5em; font-weight: 600; color: #333; line-height: 1.2; text-align: center; }

.dbn-popup-info-text { text-align: center; color: #555; margin-top: 0; margin-bottom: 25px; font-size: 0.95em; }

/* Popup Close Button */
.dbn-close-popup { position: absolute; top: 10px; right: 15px; font-size: 28px; line-height: 1; cursor: pointer; color: #555; font-weight: bold; transition: color 0.2s ease; }
.dbn-close-popup:hover { color: #000; }

/* --- [3] Form Elements Inside Popup --- */
.dbn-attribute-fieldset { border: none; padding: 0; margin: 0 0 20px 0; text-align: center; }
.dbn-attribute-legend { font-weight: bold; margin-bottom: 12px; font-size: 1em; padding: 0; color: #444; display: block; }

.dbn-radio-group { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.dbn-radio-group input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.dbn-radio-group label {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 14px;
    line-height: 1.5;
    background-color: #f9f9f9;
    color: #333;
}
.dbn-radio-group label:hover { border-color: #999; background-color: #f0f0f0; }
.dbn-radio-group input[type="radio"]:checked + label {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
    font-weight: bold;
}

/* --- [4] Popup Footer --- */
.dbn-popup-footer { margin-top: 25px; padding-top: 20px; border-top: 1px solid #eee; display: flex; flex-direction: column; align-items: stretch; gap: 15px; }
.dbn-variation-price { text-align: center; }
.dbn-variation-price .price { font-size: 1.5em; font-weight: bold; color: #2c3e50; white-space: nowrap; }

/* Ensure the popup button is full-width and applies styles */
#dbn-popup-buy-now {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 20px !important; /* Use important to override theme defaults if necessary */
    height: auto;
    line-height: 1.5;
    margin: 0;
}
#dbn-popup-buy-now:disabled { opacity: 0.5; cursor: not-allowed; background-image: none !important; background-color: #ccc !important; border-color: #ccc !important; color: #666 !important; }

/* --- [5] Utility --- */
.dbn-spinner { border: 4px solid #f3f3f3; border-top: 4px solid #3498db; border-radius: 50%; width: 40px; height: 40px; animation: dbn-spin 0.5s linear infinite; margin: 20px auto; }
@keyframes dbn-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }