/* ========================================
   Checkout Page Styles
   ======================================== */

.checkout-main {
    padding-top: 100px;
    padding-bottom: 80px;
    min-height: 100vh;
}

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.checkout-header {
    text-align: center;
    margin-bottom: 48px;
}

.checkout-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.checkout-steps {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
}

.checkout-step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.checkout-step.active {
    color: var(--primary);
}

.checkout-step.completed {
    color: var(--success);
}

.step-number {
    width: 32px;
    height: 32px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.checkout-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.checkout-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Checkout Layout */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    align-items: start;
}

/* Order Summary (Right Side) */
.order-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    position: sticky;
    top: 120px;
}

.order-summary h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-summary h2 .item-count {
    background: var(--primary);
    color: var(--bg-dark);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.order-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 24px;
    padding-right: 8px;
}

.order-items::-webkit-scrollbar {
    width: 4px;
}

.order-items::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 2px;
}

.order-items::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.order-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-image {
    width: 60px;
    height: 60px;
    background: var(--bg-darker);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-item-image .sigma {
    font-size: 1.5rem;
    color: var(--primary);
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.order-item-details {
    flex: 1;
    min-width: 0;
}

.order-item-title {
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-category {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.order-item-price {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary);
}

.order-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.order-item-remove:hover {
    color: var(--error);
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 48px 24px;
}

.empty-cart .sigma {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

.empty-cart p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Discount Code */
.discount-section {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.discount-form {
    display: flex;
    gap: 12px;
}

.discount-form input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 0.95rem;
}

.discount-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.discount-form input::placeholder {
    color: var(--text-muted);
}

.discount-form button {
    padding: 12px 20px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.discount-form button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.discount-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary);
    border-radius: 8px;
}

.discount-applied .code {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
}

.discount-applied .remove-discount {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.discount-applied .remove-discount:hover {
    color: var(--error);
}

.discount-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Order Totals */
.order-totals {
    margin-bottom: 24px;
}

.order-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-light);
}

.order-row.discount {
    color: var(--success);
}

.order-row.total {
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.order-row.total .amount {
    font-family: var(--font-mono);
    color: var(--primary);
}

/* Payment Section (Left Side) */
.payment-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
}

.payment-section h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.payment-section > p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* Email Input */
.email-section {
    margin-bottom: 32px;
}

.email-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-white);
}

.email-section input {
    width: 100%;
    padding: 16px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 1rem;
}

.email-section input:focus {
    outline: none;
    border-color: var(--primary);
}

.email-section .helper-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payment-method {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.payment-method:hover {
    border-color: var(--text-muted);
}

.payment-method.selected {
    border-color: var(--primary);
}

.payment-method-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
    background: var(--bg-darker);
}

.payment-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-method.selected .payment-radio {
    border-color: var(--primary);
}

.payment-method.selected .payment-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.payment-method-info {
    flex: 1;
}

.payment-method-name {
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 4px;
}

.payment-method-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.payment-method-logo {
    height: 24px;
}

.payment-method-logo img {
    height: 100%;
    width: auto;
}

.payment-method-body {
    padding: 24px;
    display: none;
}

.payment-method.selected .payment-method-body {
    display: block;
}

/* Stripe Card Element */
#card-element {
    padding: 16px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#card-errors {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* PayPal Button Container */
#paypal-button-container {
    min-height: 50px;
}

/* Pay Button */
.pay-button {
    width: 100%;
    padding: 20px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: var(--bg-dark);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 24px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pay-button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.pay-button:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.pay-button .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--bg-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Security Badges */
.security-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.security-badge svg {
    width: 20px;
    height: 20px;
    color: var(--success);
}

/* Guarantee Box */
.guarantee-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
    border: 1px solid var(--success);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.guarantee-box h3 {
    color: var(--success);
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.guarantee-box p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Success Page */
.success-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 80px 20px;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    animation: pop 0.5s ease-out;
}

@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-icon svg {
    width: 50px;
    height: 50px;
    color: white;
}

.success-container h1 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.success-container > p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

.download-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
}

.download-section h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-darker);
    border-radius: 8px;
}

.download-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.download-item-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
}

.download-item-name {
    font-weight: 600;
    color: var(--text-white);
}

.download-btn {
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: var(--bg-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.download-btn:hover {
    background: var(--primary-light);
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.success-note {
    margin-top: 32px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.success-note strong {
    color: var(--text-white);
}

/* Responsive */
@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .order-summary {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .checkout-main {
        padding-top: 80px;
    }

    .checkout-steps {
        gap: 16px;
    }

    .checkout-step span:not(.step-number) {
        display: none;
    }

    .payment-section,
    .order-summary {
        padding: 24px;
    }

    .security-badges {
        flex-direction: column;
        gap: 12px;
    }

    .success-actions {
        flex-direction: column;
    }
}
