/* WooCommerce Buy in 1 Click Styles */
.buyin1cl-wrapper {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
    clear: both;
}

.buyin1cl-input-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    width: 100%;
}

.buyin1cl-phone-input {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    border: 1px solid #ddd !important;
    height: auto !important;
    outline: none;
    background: #f5f5f5 !important;
    padding: 10px 12px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

/* High specificity for button to override theme styles */
button.buyin1cl-btn,
.buyin1cl-input-group button.buyin1cl-btn,
.buyin1cl-wrapper button.buyin1cl-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 90px !important;
    max-width: 200px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    height: auto !important;
    outline: none !important;
    padding: 10px 15px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-width: 1px !important;
    border-style: solid !important;
    margin: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

button.buyin1cl-btn:hover,
.buyin1cl-input-group button.buyin1cl-btn:hover,
.buyin1cl-wrapper button.buyin1cl-btn:hover {
    opacity: 0.9 !important;
    transform: none !important;
}

button.buyin1cl-btn:disabled,
.buyin1cl-input-group button.buyin1cl-btn:disabled,
.buyin1cl-wrapper button.buyin1cl-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.buyin1cl-message {
    margin-top: 10px;
    display: none;
    padding: 10px;
    border-radius: 4px;
}

.buyin1cl-message p {
    margin: 0;
}

.buyin1cl-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.buyin1cl-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.buyin1cl-loop-btn {
    display: flex !important;
    width: 100% !important;
    justify-content: center;
    align-items: center;
    margin-top: 8px !important;
    background-color: #fe8346 !important;
    border-color: #fe8346 !important;
    color: #fff !important;
}

.buyin1cl-loop-btn:hover,
.buyin1cl-loop-btn:focus {
    background-color: #e86f35 !important;
    border-color: #e86f35 !important;
    color: #fff !important;
}

/* Keep the action area aligned when product titles and prices have different heights. */
.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
}

.woocommerce ul.products li.product > .woocommerce-LoopProduct-link {
    flex: 1 1 auto;
}

.woocommerce ul.products li.product > .button,
.woocommerce ul.products li.product > .buyin1cl-loop-btn {
    flex: 0 0 auto;
}

.buyin1cl-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    inset: 0;
    padding: 20px;
    align-items: center;
    justify-content: center;
}

.buyin1cl-modal.is-open {
    display: flex;
}

.buyin1cl-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.buyin1cl-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.buyin1cl-modal__close {
    position: absolute;
    top: 6px;
    right: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #333;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.buyin1cl-modal__title {
    margin: 0 30px 8px 0;
    font-size: 20px;
    line-height: 1.3;
}

.buyin1cl-modal__price {
    margin-bottom: 16px;
}

.buyin1cl-modal__variations {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.buyin1cl-modal__variation-field {
    display: grid;
    gap: 5px;
    font-weight: 600;
}

.buyin1cl-modal__variation-select {
    width: 100%;
    min-height: 40px;
    padding: 6px 10px;
    box-sizing: border-box;
}

.buyin1cl-modal__form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.buyin1cl-modal__phone {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
}

.buyin1cl-modal__submit {
    flex: 0 0 auto !important;
    width: auto !important;
}

/* Responsive */
@media (max-width: 768px) {
    .buyin1cl-input-group {
        gap: 8px;
    }
    
    button.buyin1cl-btn,
    .buyin1cl-input-group button.buyin1cl-btn {
        font-size: 0.875em !important;
        padding: 8px 12px !important;
        flex: 0 0 auto !important;
        width: auto !important;
    }
    
    .buyin1cl-phone-input {
        flex: 1 1 0 !important;
        width: auto !important;
    }
}

@media (max-width: 480px) {
    .buyin1cl-input-group {
        gap: 6px;
    }
    
    button.buyin1cl-btn,
    .buyin1cl-input-group button.buyin1cl-btn {
        font-size: 0.813em !important;
        padding: 8px 10px !important;
        min-width: 80px !important;
        flex: 0 0 auto !important;
        width: auto !important;
    }
    
    .buyin1cl-phone-input {
        flex: 1 1 0 !important;
        width: auto !important;
    }

    .buyin1cl-modal {
        padding: 12px;
    }

    .buyin1cl-modal__dialog {
        max-height: calc(100vh - 24px);
        padding: 24px 18px 18px;
    }

    .buyin1cl-modal__form {
        gap: 6px;
    }

    .buyin1cl-modal__submit {
        min-width: 80px !important;
        padding: 8px 10px !important;
        font-size: .813em !important;
    }
}
