/* Modal overlay */
#wcbnpc-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    overflow-y: auto;
}

/* Modal content */
#wcbnpc-modal .wcbnpc-modal-content {
    background: #fff;
    margin: 50px auto;
    padding: 30px 20px;
    max-width: 600px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow-y: auto;
}
.form-row.form-row-wide.wcbnpc-row.wcbnpc-shipping-field input#billing_state {
    display: none;
}
/* Close button */
.wcbnpc-close {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: #000;
    color: #fff;
    padding: 0px 10px;
    border-radius: .175em;
}
.wcbnpc-badge {
    position: absolute;
    font-size: 12px;
    padding: 2px 7px;
    border-radius: .375em;
    color: #fff;
    font-weight: 550;
}
.wcbnpc-order-summary {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
}
.wcbnpc-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
}
.wcbnpc-summary-row.total {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    font-size: 17px;
}
.wcbnpc-title {
    text-align: center;
}
/* Product summary at top */
.wcbnpc-product-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}
.wcbnpc-product-image {
    position: relative;
}
.wcbnpc-product-summary img {
    width: 150px;
    height: auto;
    border-radius: 8px;
}

.wcbnpc-product-summary .wcbnpc-product-info {
    font-size: 15px;
}

.wcbnpc-product-summary .wcbnpc-product-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.wcbnpc-product-summary .wcbnpc-product-price {
    font-weight: 500;
    color: #333;
}

/* Input field style */
.wcbnpc-row {
    margin-bottom: 18px;
    float: left;
    box-sizing: border-box;
    padding: 0 10px;
}
.form-row-wide.wcbnpc-col-12 { width: 100%; clear:none!important;}
.form-row-wide.wcbnpc-col-6  { width: 49%; clear:none!important; margin-right: 5px!important;}
.form-row-wide.wcbnpc-col-4  { width: 33.333%; clear:none!important;}
.form-row-wide.wcbnpc-col-3  { width: 25%; clear:none!important;}
.wcbnpc-row.wcbnpc-has-error input,
.wcbnpc-row.wcbnpc-has-error select,
.wcbnpc-row.wcbnpc-has-error textarea {
  border-color: #cc0000 !important;
  box-shadow: 0 0 0 1px #cc0000 !important;
}

.wcbnpc-row input[type="text"],
.wcbnpc-row input[type="email"],
.wcbnpc-row input[type="tel"],
.wcbnpc-row select {
    width: -webkit-fill-available;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f8f8;
    font-size: 15px;
    transition: border-color 0.2s ease;
}
.wcbnpc-row .select2-selection__rendered {
    padding: 0px !important;
}
button.wp-block-button.wc-block-components-product-button.wc-block-components-product-button__button.button.wcbnpc-buy-now {
    padding: 1rem 2.25rem;
    border-radius: 9999px;
    color: #fff;
    cursor: pointer;
}
button.wcbnpc-buy-now.button.alt.wp-element-button {
    display: inline-block;
    width: 100%;
    grid-column: 3 / 3;
    justify-self: start;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-size: var(--wp--preset--font-size--medium);
    line-height: inherit;
}
.wcbnpc-row input:focus,
.wcbnpc-row select:focus {
    border-color: #666;
    outline: none;
    background-color: #fff;
}

/* Placeholder-style label inside input */
.wcbnpc-row label {
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    font-size: 14px;
}

/* Custom checkbox style */
.wcbnpc-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 0;
    cursor: pointer;
}

.wcbnpc-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #000;
    cursor: pointer;
}

/* Radio button styles */
.wcbnpc-shipping-methods,
.wcbnpc-payment-methods {
    margin-top: 30px;
    padding: 0 10px;
}

.wcbnpc-shipping-methods label,
.wcbnpc-payment-methods label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-weight: 500;
}

.wcbnpc-shipping-methods input[type="radio"],
.wcbnpc-payment-methods input[type="radio"] {
    transform: scale(1.2);
    cursor: pointer;
}

/* Section titles */
.wcbnpc-section-heading {
    font-size: 17px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 10px;
}

/* Error messages */
.wcbnpc-error {
    color: #d63638;
    font-size: 13px;
    margin-top: 4px;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

/* Error animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Submit button */
#wcbnpc-checkout-form button[type="submit"] {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s ease;
}

#wcbnpc-checkout-form button[type="submit"]:hover {
    background-color: #333;
}
.wcbnpc-product-summary {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 16px;
  margin-bottom: 24px;
  position: relative;
}

.wcbnpc-product-image img {
  max-width: 100px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.wcbnpc-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.wcbnpc-product-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.wcbnpc-product-price {
  font-size: 16px;
  color: #2e7d32;
  font-weight: 500;
  margin-top: 6px;
}

.wcbnpc-product-qty {
  margin-left: 6px;
  color: #555;
  font-weight: 400;
  font-size: 14px;
}

.wcbnpc-sale-badge {
  display: inline-block;
  background: #e53935;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
  width: fit-content;
  position: absolute;
}
.select2-container {
    z-index: 9999 !important;
}
.select2-dropdown {
    z-index: 9999 !important;
}
.wcbnpc-modal-content {
    overflow: visible !important;
}
.wcbnpc-error {
    border: 1px solid #dc3232 !important;
    background: #fff0f0;
}
.wcbnpc-error-message {
    color: #dc3232;
    font-size: 13px;
    margin-top: 4px;
}
.wcbnpc-row .select2-container--default .select2-selection--single {
    background-color: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f8f8;
    font-size: 15px;
    transition: border-color 0.2s ease;
    height: auto;
}
.wcbnpc-row .select2-selection__arrow{
    height: 100%!important;
}

/* Hide shipping fields by default */
.wcbnpc-shipping-field {
    display: none;
}

/* Responsive */
@media (max-width: 640px) {
    #wcbnpc-modal .wcbnpc-modal-content {
        margin: auto;
        padding: 20px;
    }

    .wcbnpc-product-summary {
        flex-direction: row;
        align-items: flex-start;
    }

    .wcbnpc-product-summary img {
        width: 100%;
        max-width: 100px;
    }
    .wcbnpc-row {
        width: 100% !important;
        padding: 0;
    }
}
