/**
* Hyperpay Saved Cards Styles
*/

/* Payment Fields on Checkout */
.hyperpay-payment-fields {
    margin: 20px 0;
}

.hyperpay-saved-cards-section {
    margin: 20px 0;
}

.hyperpay-saved-cards-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.hyperpay-saved-cards-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hyperpay-saved-card-item {
    margin: 0 0 10px 0;
    padding: 0;
}

.hyperpay-saved-card-item label {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.hyperpay-saved-card-item label:hover {
    border-color: #999;
    background: #f9f9f9;
}

.hyperpay-saved-card-item input[type="radio"]:checked + .hyperpay-card-details {
    color: inherit;
}

.hyperpay-saved-card-item input[type="radio"]:checked ~ * {
    color: inherit;
}

.hyperpay-saved-card-item label:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #f0f6fc;
}

.hyperpay-saved-card-item input[type="radio"] {
    margin: 0 15px 0 0;
    flex-shrink: 0;
}

.hyperpay-card-details {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
    position: relative;
}

.hyperpay-card-brand {
    font-weight: 600;
    min-width: 80px;
}

.hyperpay-card-number {
    font-family: monospace;
    font-size: 16px;
}

.hyperpay-card-expiry {
    font-size: 13px;
    color: #666;
}

.hyperpay-remove-card-checkout {
    margin-left: auto;
    color: #dc3545;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background 0.2s;
}

.hyperpay-remove-card-checkout:hover {
    background: #fee;
    color: #c82333;
}

.hyperpay-remove-card-checkout .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.hyperpay-new-card-option label {
    border-style: dashed;
}

.hyperpay-save-card-option {
    margin: 20px 0;
    padding: 0;
}

.hyperpay-consent-box {
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e3e8ee;
    border-radius: 8px;
}

.hyperpay-consent-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 15px;
}

.hyperpay-consent-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Subscription notice */
.hyperpay-subscription-notice {
    padding: 15px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 5px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #856404;
}

.hyperpay-subscription-notice .dashicons {
    color: #ffc107;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.hyperpay-subscription-notice strong {
    display: block;
    margin-bottom: 5px;
}

/* Required checkbox styling for subscriptions */
.hyperpay-save-card-option[data-is-subscription="1"] .hyperpay-consent-box {
    background: #e7f3ff;
    border-color: #007cba;
}

.hyperpay-save-card-option[data-is-subscription="1"] .hyperpay-consent-label strong {
    color: #007cba;
}

/* Validation error animation */
.hyperpay-consent-box.hyperpay-validation-error {
    background: #fee;
    border-color: #d63638;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.hyperpay-consent-details {
    margin-left: 28px;
    padding-left: 15px;
    border-left: 3px solid #007cba;
}

.hyperpay-consent-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px 0;
    color: #333;
    font-size: 14px;
}

.hyperpay-consent-info .dashicons {
    color: #007cba;
    flex-shrink: 0;
    margin-top: 2px;
}

.hyperpay-consent-benefits {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.hyperpay-consent-benefits li {
    padding: 6px 0;
    color: #2c5530;
    font-size: 13px;
}

.hyperpay-consent-note {
    margin: 12px 0 0 0;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.hyperpay-consent-note small {
    color: #666;
    line-height: 1.6;
}

.hyperpay-consent-note a {
    color: #007cba;
    text-decoration: underline;
}

.hyperpay-guest-notice {
    margin: 15px 0;
    padding: 15px;
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    border-radius: 3px;
}

.hyperpay-guest-notice .description {
    margin: 0;
    color: #856404;
}

.hyperpay-guest-notice a {
    color: #007cba;
    text-decoration: underline;
}

/* My Account Saved Cards Page */
.hyperpay-my-account-saved-cards {
    margin: 20px 0;
}

.hyperpay-my-account-saved-cards h2 {
    margin: 0 0 20px 0;
}

.hyperpay-no-saved-cards {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    text-align: center;
    color: #666;
}

.hyperpay-saved-cards-table {
    width: 100%;
    border-collapse: collapse;
}

.hyperpay-saved-cards-table th,
.hyperpay-saved-cards-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.hyperpay-saved-cards-table th {
    font-weight: 600;
    background: #f9f9f9;
}

.hyperpay-saved-cards-table td[data-title]::before {
    content: attr(data-title) ": ";
    font-weight: 600;
    display: none;
}

.hyperpay-delete-card {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

.hyperpay-delete-card:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .hyperpay-card-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .hyperpay-saved-cards-table thead {
        display: none;
    }

    .hyperpay-saved-cards-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 5px;
    }

    .hyperpay-saved-cards-table td {
        display: block;
        text-align: right;
        padding: 10px;
        border: none;
    }

    .hyperpay-saved-cards-table td[data-title]::before {
        display: inline;
        float: left;
    }
}

