/**
 * SocialME Blesta Connection - Checkout Styles
 * Modern, clean checkout design
 */

/* =====================================================
   CHECKOUT WRAPPER
   ===================================================== */
.sbc-checkout-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: inherit;
}

/* Widen the whole checkout to 1600px on large screens (960px+ viewport) */
@media (min-width: 960px) {
    .sbc-checkout-wrapper {
        max-width: 1600px;
    }
}

.sbc-checkout-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

@media (max-width: 768px) {
    .sbc-checkout-form {
        padding: 20px;
    }
}

/* =====================================================
   GRID LAYOUT
   ===================================================== */
.sbc-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 992px) {
    .sbc-checkout-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* =====================================================
   SECTION TITLES
   ===================================================== */
.sbc-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sbc-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #FD5A23;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}

.sbc-payment-title {
    margin-top: 30px;
}

/* =====================================================
   FORM GROUPS
   ===================================================== */
.sbc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .sbc-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.sbc-form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.sbc-form-group.sbc-full-width {
    grid-column: 1 / -1;
}

.sbc-form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.sbc-required {
    color: #e74c3c;
}

.sbc-form-group input,
.sbc-form-group textarea,
.sbc-form-group select {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    font-family: inherit;
}

.sbc-form-group input:focus,
.sbc-form-group textarea:focus,
.sbc-form-group select:focus {
    outline: none;
    border-color: #FD5A23;
    box-shadow: 0 0 0 3px rgba(253, 90, 35, 0.1);
}

.sbc-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.sbc-form-group .sbc-field-note {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.sbc-form-group-error input,
.sbc-form-group-error textarea,
.sbc-form-group-error select {
    border-color: #e74c3c;
}

/* Loading state for input fields - spinner on right side ONLY */
.sbc-loading {
    padding-right: 40px !important;
}

/* Spinner using pseudo-element - NO rotation of input itself */
.sbc-form-group:has(> .sbc-loading)::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    margin-top: -10px;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FD5A23;
    border-radius: 50%;
    animation: sbc-spin 1s linear infinite;
    pointer-events: none;
}

@keyframes sbc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =====================================================
   CART ITEMS
   ===================================================== */
.sbc-cart-items {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.sbc-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    transition: opacity 0.3s ease;
}

/* Remove button */
.sbc-cart-item-remove {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    border: 1px solid #fc5a53 !important;
    background: #fc5a53 !important;
    color: #fff !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    margin-right: 12px !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
}

.sbc-cart-item-remove:hover {
    background: transparent !important;
	color: #fc5a53 !important;
}

.sbc-cart-item-remove:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.sbc-cart-item-remove span {
    position: relative;
    top: -1px;
}

.sbc-cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sbc-cart-item:first-child {
    padding-top: 0;
}

.sbc-cart-item-details {
    flex: 1;
}

.sbc-cart-item-name {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.sbc-cart-item-term {
    display: block;
    font-size: 13px;
    color: #666;
}

.sbc-cart-item-qty {
    font-size: 14px;
    color: #666;
    padding: 0 20px;
}

.sbc-cart-item-price {
    font-weight: 600;
    color: #00A149;
    font-size: 16px;
}

/* =====================================================
   DOMAIN SECTION (for hosting/VPS)
   ===================================================== */
.sbc-domain-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e8f4fd 100%);
    border: 2px solid #0284c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.sbc-domain-section label {
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 8px;
    display: block;
}

.sbc-domain-section input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #7dd3fc;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sbc-domain-section input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    outline: none;
}

.sbc-domain-section input:invalid {
    border-color: #fca5a5;
}

.sbc-domain-section .sbc-field-note {
    color: #0369a1;
    font-size: 13px;
    margin-top: 8px;
    display: block;
}

/* =====================================================
   CART TOTALS
   ===================================================== */
.sbc-cart-totals {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.sbc-cart-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 15px;
}

.sbc-cart-totals-row:not(:last-child) {
    border-bottom: 1px solid #e9ecef;
}

.sbc-cart-total {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    padding-top: 15px;
    border-top: 2px solid #dee2e6 !important;
    margin-top: 10px;
}

.sbc-cart-total span:last-child {
    color: #00A149;
}

/* =====================================================
   COUPON
   ===================================================== */
.sbc-coupon-box {
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.sbc-coupon-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #1a1a1a;
}

.sbc-coupon-row {
    display: flex;
    gap: 8px;
}

.sbc-coupon-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    text-transform: uppercase;
}

.sbc-coupon-row input::placeholder {
    text-transform: none;
    color: #adb5bd;
}

.sbc-coupon-row input:focus {
    outline: none;
    border-color: #00A149;
}

.sbc-coupon-status {
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
}

.sbc-coupon-msg.success {
    color: #00A149;
}

.sbc-coupon-msg.error {
    color: #dc3545;
}

.sbc-cart-discount {
    color: #00A149;
    font-weight: 600;
}

/* =====================================================
   TERMS ACCEPTANCE
   ===================================================== */
.sbc-terms-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.sbc-terms-box input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.sbc-terms-box a {
    color: #00A149;
    text-decoration: underline;
}

.sbc-terms-box a:hover {
    text-decoration: none;
}

.sbc-terms-box.sbc-form-group-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 1px #dc3545;
}

/* =====================================================
   PAYMENT LOGOS (wide strip under the checkout button)
   ===================================================== */
.sbc-payment-logos {
    display: flex;
    justify-content: center;
    margin: 12px 0 16px;
}

.sbc-payment-logos img {
    max-width: 100%;
    height: auto;
    width: 100%;
    max-height: 60px;
    object-fit: contain;
}

/* =====================================================
   PAYMENT GATEWAYS
   ===================================================== */
.sbc-payment-gateways {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.sbc-payment-option {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sbc-payment-option:hover {
    border-color: #FD5A23;
    background: #fff5f2;
}

.sbc-payment-option-selected {
    border-color: #FD5A23;
    background: #fff5f2;
}

.sbc-payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sbc-payment-option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sbc-payment-option-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 16px;
}

.sbc-payment-option-desc {
    font-size: 13px;
    color: #666;
}

.sbc-payment-option-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FD5A23;
    opacity: 0;
    transition: opacity 0.2s;
}

.sbc-payment-option-selected .sbc-payment-option-icon {
    opacity: 1;
}

.sbc-no-gateways {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.sbc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 10px;
}

.sbc-btn-primary {
    background: #FD5A23;
    color: #fff;
}

.sbc-btn-primary:hover {
    background: #e54d1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 90, 35, 0.3);
}

#sbc-checkout-submit,
.sbc-btn-checkout {
    display: flex;
    width: 100%;
    max-width: 420px;
    margin: 16px auto 0;
    background: #00a149;
    color: #fff;
    border: 2px solid #00a149;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
}

#sbc-checkout-submit:hover,
.sbc-btn-checkout:hover {
    background: #008a3d;
    border-color: #008a3d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 161, 73, 0.3);
}

#sbc-checkout-submit:disabled,
.sbc-btn-checkout:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sbc-btn-checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sbc-btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sbc-btn-loading .dashicons {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =====================================================
   MESSAGES
   ===================================================== */
.sbc-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.sbc-message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* =====================================================
   EMPTY CART
   ===================================================== */
.sbc-empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.sbc-empty-cart-message {
    max-width: 400px;
    margin: 0 auto;
}

.sbc-empty-cart .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #ccc;
    margin-bottom: 20px;
}

.sbc-empty-cart h3 {
    font-size: 24px;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.sbc-empty-cart p {
    color: #666;
    margin-bottom: 25px;
}

/* =====================================================
   CHECKOUT NOTICE
   ===================================================== */
.sbc-checkout-notice {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sbc-checkout-notice .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #00A149;
}

/* =====================================================
   FORM MESSAGES AREA
   ===================================================== */
#sbc-form-messages {
    margin-top: 20px;
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */
@media (max-width: 768px) {
    .sbc-checkout-wrapper {
        margin: 20px auto;
        padding: 0 15px;
    }

    .sbc-checkout-form {
        padding: 20px;
        border-radius: 8px;
    }

    .sbc-section-title {
        font-size: 18px;
    }

    .sbc-cart-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .sbc-cart-item-qty {
        padding: 0 10px;
    }

    .sbc-btn-checkout {
        font-size: 16px;
        padding: 14px 24px;
    }
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.sbc-loading {
    opacity: 0.6;
    pointer-events: none;
}

.sbc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top-color: #FD5A23;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* =====================================================
   DOMAIN FIELDS INSIDE CART ITEMS
   ===================================================== */
.sbc-cart-item[data-requires-domain="1"] {
    flex-wrap: wrap;
}

.sbc-cart-item-domains {
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #dee2e6;
}

.sbc-domain-field-wrapper {
    margin-bottom: 12px;
}

.sbc-domain-field-wrapper:last-child {
    margin-bottom: 0;
}

.sbc-cart-item-domains .sbc-form-group {
    margin-bottom: 0;
}

.sbc-cart-item-domains label {
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 6px;
    display: block;
}

.sbc-cart-item-domains input.sbc-domain-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #7dd3fc;
    border-radius: 6px;
    font-size: 14px;
    background: #f0f9ff;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.sbc-cart-item-domains input.sbc-domain-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    outline: none;
    background: #fff;
}

.sbc-cart-item-domains input.sbc-domain-input::placeholder {
    color: #94a3b8;
}

.sbc-cart-item-domains .sbc-field-note {
    font-size: 11px;
    color: #0369a1;
    margin-top: 5px;
    display: block;
}

.sbc-cart-item-domains .sbc-form-group-error input.sbc-domain-input {
    border-color: #e74c3c;
    background: #fef2f2;
}

/* Mobile adjustments for domain fields */
@media (max-width: 768px) {
    .sbc-cart-item-domains {
        margin-top: 12px;
        padding-top: 12px;
    }

    .sbc-cart-item-domains input.sbc-domain-input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}
