/* =================================================================
   PART 2: PAYMENT SYSTEM CSS - EXTENDS PART 1 MODERN DARK THEME
   Design Principles: Match Part 1 exactly - Dark theme, accent colors, responsive
   ================================================================= */

/* PAYMENT METHODS SECTION */
.wc-checkout-section {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Payment Methods List */
.wc-payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.wc-payment-method-item {
    background: #222;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.wc-payment-method-item:hover {
    background: #2a2a2a;
    border-color: rgba(255, 184, 0, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wc-payment-method-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wc-payment-method-item label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    width: 100%;
}

.wc-payment-method-item label span {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Selected Payment Method */
.wc-payment-method-item input[type="radio"]:checked+label {
    color: #FFB800;
}

.wc-payment-method-item input[type="radio"]:checked+label:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #FFB800;
    background: #FFB800;
    margin-right: 12px;
    position: relative;
}

.wc-payment-method-item input[type="radio"]:checked+label:after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
}

.wc-payment-method-item input[type="radio"]:checked~.wc-payment-desc {
    max-height: 100px;
    opacity: 1;
    margin-top: 8px;
}

.wc-payment-method-item input[type="radio"]:checked~.wc-payment-desc {
    display: block;
}

/* Payment Method Icons */
.wc-payment-icon {
    width: 40px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Payment Method Description */
.wc-payment-desc {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 8px;
    line-height: 1.4;
    padding-left: 32px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

/* Order Review Section */
.wc-order-review {
    background: #222;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.wc-order-review h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px;
}

.wc-order-review h4 svg {
    color: #FFB800;
    width: 16px;
    height: 16px;
}

.wc-order-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.wc-order-details p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wc-order-details p:last-child {
    border-bottom: none;
}

.wc-order-details p strong {
    color: #9ca3af;
    font-weight: 500;
    font-size: 14px;
}

.wc-order-details p span {
    color: #fff;
    font-size: 14px;
    text-align: right;
}

.wc-order-details p span.wc-total-price {
    color: #FFB800;
    font-weight: 700;
    font-size: 18px;
}

/* Payment Action Buttons */
.wc-payment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.wc-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 184, 0, 0.3);
    transform: translateY(-1px);
}

.wc-back-btn svg {
    width: 16px;
    height: 16px;
}

/* Payment Processing Section */
.wc-payment-processing {
    text-align: center;
    padding: 40px 20px;
}

.wc-processing-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 184, 0, 0.2);
    border-top-color: #FFB800;
    border-radius: 50%;
    animation: paymentSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes paymentSpin {
    to {
        transform: rotate(360deg);
    }
}

.wc-processing-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.wc-processing-subtext {
    color: #9ca3af;
    font-size: 14px;
}

/* Payment Success Section */
.wc-payment-success {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.wc-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 50%;
    margin: 0 auto 20px;
}

.wc-success-icon svg {
    color: #00ff88;
    width: 40px;
    height: 40px;
}

.wc-success-title {
    text-align: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.wc-success-message {
    text-align: center;
    color: #9ca3af;
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.wc-order-summary {
    background: #222;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.wc-order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wc-order-summary-row:last-child {
    border-bottom: none;
}

.wc-order-summary-label {
    color: #9ca3af;
    font-size: 14px;
}

.wc-order-summary-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.wc-order-summary-value.wc-success-total {
    color: #FFB800;
    font-size: 18px;
    font-weight: 800;
}

/* Payment Error Section */
.wc-payment-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.wc-error-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.wc-error-header svg {
    color: #ff4444;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.wc-error-title {
    color: #ff4444;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.wc-error-message {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    padding-left: 30px;
}

.wc-retry-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.wc-retry-button:hover {
    background: rgba(255, 68, 68, 0.25);
    transform: translateY(-1px);
}

/* Payment Pending Section */
.wc-payment-pending {
    text-align: center;
    padding: 30px 20px;
}

.wc-pending-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(255, 184, 0, 0.1);
    border: 2px solid rgba(255, 184, 0, 0.3);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: pendingPulse 2s infinite;
}

@keyframes pendingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.wc-pending-icon svg {
    color: #FFB800;
    width: 40px;
    height: 40px;
}

.wc-pending-title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}

.wc-pending-message {
    color: #9ca3af;
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Payment Method Specific Styling */
.wc-payment-method-item[data-gateway-id="cod"] label:before {
    content: "💵";
    font-size: 20px;
    margin-right: 12px;
}

.wc-payment-method-item[data-gateway-id="paypal"] label:before {
    content: "🔵";
    font-size: 20px;
    margin-right: 12px;
}

.wc-payment-method-item[data-gateway-id="stripe"] label:before {
    content: "💳";
    font-size: 20px;
    margin-right: 12px;
}

.wc-payment-method-item[data-gateway-id="bacs"] label:before {
    content: "🏦";
    font-size: 20px;
    margin-right: 12px;
}

.wc-payment-method-item[data-gateway-id="cheque"] label:before {
    content: "📄";
    font-size: 20px;
    margin-right: 12px;
}

/* Loading Overlay */
#wc-payment-loader {
    z-index: 1000000 !important;
}

/* Form Pre-filled Styling */
.wc-form-input[data-prefilled="true"] {
    border-color: rgba(0, 255, 136, 0.3) !important;
    background: rgba(0, 255, 136, 0.05) !important;
}

/* Empty States */
.wc-no-payment-methods {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Payment Status Badges */
.wc-payment-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-payment-status.wc-status-success {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.wc-payment-status.wc-status-pending {
    background: rgba(255, 184, 0, 0.1);
    color: #FFB800;
    border: 1px solid rgba(255, 184, 0, 0.3);
}

.wc-payment-status.wc-status-failed {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

/* Payment Security Notice */
.wc-payment-security {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
}

.wc-payment-security p {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ff88;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.wc-payment-security p svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* =================================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATION
   ================================================================= */
@media (max-width: 640px) {
    .wc-payment-method-item {
        padding: 14px;
    }

    .wc-payment-method-item label {
        font-size: 14px;
    }

    .wc-payment-icon {
        width: 36px;
        height: 22px;
    }

    .wc-payment-desc {
        font-size: 12px;
        padding-left: 28px;
    }

    .wc-order-review {
        padding: 16px;
    }

    .wc-order-details p {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .wc-order-details p span {
        text-align: left;
        width: 100%;
    }

    .wc-payment-actions {
        flex-direction: column;
    }

    .wc-back-btn {
        width: 100%;
        justify-content: center;
    }

    .wc-success-icon {
        width: 60px;
        height: 60px;
    }

    .wc-success-icon svg {
        width: 30px;
        height: 30px;
    }

    .wc-pending-icon {
        width: 60px;
        height: 60px;
    }

    .wc-pending-icon svg {
        width: 30px;
        height: 30px;
    }

    .wc-payment-method-item input[type="radio"]:checked+label:before {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .wc-payment-method-item input[type="radio"]:checked+label:after {
        left: 24px;
        width: 7px;
        height: 7px;
    }
}

/* Tablet Optimization */
@media (min-width: 641px) and (max-width: 1024px) {
    .wc-payment-methods-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Desktop Enhancements */
@media (min-width: 1025px) {
    .wc-payment-method-item {
        padding: 18px 20px;
    }

    .wc-payment-methods-list {
        gap: 14px;
    }
}

/* =================================================================
   ANIMATIONS FOR SMOOTH TRANSITIONS
   ================================================================= */
.wc-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.wc-slide-in-right {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wc-slide-in-left {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =================================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================================= */
.wc-payment-method-item:focus-within {
    outline: 2px solid #FFB800;
    outline-offset: 2px;
}

.wc-back-btn:focus {
    outline: 2px solid #FFB800;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wc-payment-method-item {
        border-width: 2px;
    }

    .wc-order-review {
        border-width: 2px;
    }

    .wc-back-btn {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .wc-payment-method-item,
    .wc-back-btn,
    .wc-success-icon,
    .wc-pending-icon {
        transition: none;
        animation: none;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}

/* =================================================================
   PRINT STYLES
   ================================================================= */
@media print {
    .wc-cart-modal {
        position: relative;
        display: block !important;
    }

    .wc-cart-overlay,
    .wc-cart-close,
    .wc-back-btn,
    .wc-payment-actions {
        display: none !important;
    }

    .wc-payment-method-item input[type="radio"] {
        position: static;
        opacity: 1;
        width: auto;
        height: auto;
    }
}