/* =====================================================
   Investintech Store - Checkout Styles
   Responsive design optimized for all devices
   ===================================================== */

/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

/* Header */
.site-header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-top-bar {
    background: #f57c00;
    height: 4px;
}

.header-main {
    background: #ffffff;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
}

.header-main-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo img {
    height: 36px;
}

.header-nav {
    display: flex;
    gap: 25px;
}

.header-nav a {
    color: #333333;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: #f57c00;
}

.header-nav .has-dropdown {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: #666;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-outline {
    color: #333;
    background: transparent;
    border: 2px solid #333;
}

.btn-outline:hover {
    background: #333;
    color: #fff;
}

.btn-orange {
    color: #fff;
    background: #f57c00;
    border: 2px solid #f57c00;
}

.btn-orange:hover {
    background: #e65100;
    border-color: #e65100;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* Checkout Container */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
}

.checkout-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Sections */
.order-summary,
.billing-section {
    padding: 30px;
}

.order-summary {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

h2 {
    margin: 0 0 20px 0;
    font-size: 1.375rem;
    color: #1a365d;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 .icon {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

h2 .icon svg,
h3 .icon svg {
    display: block;
}

h3 {
    margin: 20px 0 15px 0;
    font-size: 1.125rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

h3 .icon {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

/* Items Table */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.items-table th,
.items-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.items-table th {
    background: #edf2f7;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.items-table td {
    vertical-align: top;
}

.items-table .text-center {
    text-align: center;
}

.items-table .text-right {
    text-align: right;
}

.text-muted {
    color: #718096;
}

/* Order Totals */
.order-totals {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}

/* Coupon Applied Banner */
.coupon-applied {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    color: #276749;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coupon-applied .coupon-icon {
    font-size: 1.2rem;
}

/* Original price strikethrough */
.original-price {
    text-decoration: line-through;
    color: #a0aec0;
    font-size: 0.85em;
    margin-right: 6px;
}

/* Discount row */
.discount-row {
    color: #276749;
}

.discount-value {
    color: #276749;
    font-weight: 600;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f7;
}

.total-row:last-child {
    border-bottom: none;
}

.grand-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #003366;
    padding-top: 15px;
    border-top: 2px solid #003366;
    margin-top: 10px;
}

.grand-total small {
    font-size: 0.875rem;
    font-weight: 400;
    color: #718096;
}

/* Form Styles */
.checkout-form {
    margin-top: 20px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group.full-width {
    width: 100%;
}

label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.9375rem;
}

.required {
    color: #e53e3e;
}

.optional {
    color: #a0aec0;
    font-weight: 400;
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

input::placeholder {
    color: #a0aec0;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.help-text {
    font-size: 0.8125rem;
    color: #718096;
    margin-top: 6px;
}

.error-message {
    color: #e53e3e;
    font-size: 0.8125rem;
    margin-top: 6px;
    display: none;
}

.error-message.visible {
    display: block;
}

.form-group.has-error input,
.form-group.has-error select {
    border-color: #e53e3e;
}

/* Payment Section */
.payment-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

/* Currency Selection */
.currency-selection {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.currency-selection > label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 0.9375rem;
    text-align: center;
}

.currency-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.currency-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

/* USD Button - Blue */
.currency-btn[data-currency="USD"] {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(25, 118, 210, 0.3);
}

.currency-btn[data-currency="USD"]:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.currency-btn[data-currency="USD"].active {
    background: linear-gradient(135deg, #0d47a1 0%, #002171 100%);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.5), 0 0 0 3px rgba(25, 118, 210, 0.3);
}

/* Local Currency Button - Orange */
.currency-btn:not([data-currency="USD"]) {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 124, 0, 0.3);
}

.currency-btn:not([data-currency="USD"]):hover {
    background: linear-gradient(135deg, #e65100 0%, #d84315 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 124, 0, 0.4);
}

.currency-btn:not([data-currency="USD"]).active {
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
    box-shadow: 0 6px 20px rgba(245, 124, 0, 0.5), 0 0 0 3px rgba(245, 124, 0, 0.3);
}

.currency-btn .currency-code {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.currency-btn .currency-amount {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 4px 0;
}

.currency-btn .currency-name {
    font-size: 0.6875rem;
    opacity: 0.85;
}

@media (max-width: 480px) {
    .currency-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .currency-btn {
        width: 100%;
        max-width: 200px;
    }
}

.stripe-element {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
}

.stripe-element.StripeElement--focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.stripe-element.StripeElement--invalid {
    border-color: #e53e3e;
}

.accepted-cards {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: #718096;
    font-size: 0.875rem;
}

.accepted-cards img {
    height: 24px;
    opacity: 0.8;
}

/* Buttons */
.form-actions {
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 1.0625rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 124, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e65100 0%, #d84315 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 124, 0, 0.4);
}

.btn-primary:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-large {
    width: 100%;
    padding: 18px 32px;
    font-size: 1.125rem;
}

.btn-secondary {
    background: white;
    color: #003366;
    border: 2px solid #003366;
}

.btn-secondary:hover {
    background: #f7fafc;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.spinner.large {
    width: 48px;
    height: 48px;
    border-width: 4px;
    border-color: rgba(0, 51, 102, 0.2);
    border-top-color: #003366;
}

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

/* Security Notice */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px;
    background: #f0fff4;
    border-radius: 8px;
    color: #276749;
    font-size: 0.875rem;
}

/* Sidebar */
.checkout-sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-box h3 {
    margin: 0 0 15px 0;
    font-size: 1.0625rem;
    color: #1a365d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.benefits-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.benefits-list li {
    padding: 8px 0;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trust-badges {
    text-align: center;
}

.trust-badges img {
    max-width: 100%;
    height: auto;
}

/* Sidebar Order Summary */
.sidebar-summary {
    border: 2px solid #003366;
}

.sidebar-totals {
    margin-top: 5px;
}

.sidebar-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9375rem;
    color: #4a5568;
    border-bottom: 1px solid #edf2f7;
}

.sidebar-total-row:last-child {
    border-bottom: none;
}

.sidebar-discount-row {
    color: #276749;
}

.sidebar-grand-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: #003366;
    padding-top: 10px;
    margin-top: 5px;
    border-top: 2px solid #003366;
    border-bottom: none;
}

.sidebar-grand-total small {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #718096;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
}

.modal-content h3 {
    margin: 20px 0 10px;
    justify-content: center;
}

.modal-content p {
    color: #718096;
}

/* Thank You Page */
.thankyou-container {
    max-width: 800px;
    margin: 0 auto;
}

.success-header {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-radius: 12px;
    margin-bottom: 30px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #48bb78;
    color: white;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.success-header h1 {
    margin: 0 0 10px;
    color: #276749;
}

.success-message {
    color: #2f855a;
    font-size: 1.125rem;
}

.confirmation-box,
.license-box,
.next-steps,
.support-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.order-info {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: #718096;
}

.info-row .value {
    font-weight: 600;
}

/* License Box */
.license-box {
    border: 2px solid #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, white 100%);
}

.important-notice {
    background: #fffbeb;
    border-left: 4px solid #f6ad55;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.license-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.license-product {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.license-key {
    display: flex;
    align-items: center;
    gap: 10px;
}

.license-key code {
    flex: 1;
    padding: 12px 15px;
    background: #1a365d;
    color: #68d391;
    font-family: 'Courier New', monospace;
    font-size: 1.125rem;
    letter-spacing: 1px;
    border-radius: 6px;
    word-break: break-all;
}

.btn-copy {
    padding: 10px 15px;
    background: #edf2f7;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #e2e8f0;
}

.btn-copy.copied {
    background: #c6f6d5;
    color: #276749;
}

.email-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #ebf8ff;
    border-radius: 8px;
    color: #2b6cb0;
}

/* Next Steps */
.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

.steps-list li {
    padding: 20px 0 20px 60px;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
}

.steps-list li:last-child {
    border-bottom: none;
}

.steps-list li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 20px;
    width: 40px;
    height: 40px;
    background: #003366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.steps-list li strong {
    display: block;
    font-size: 1.0625rem;
    margin-bottom: 8px;
}

.steps-list li p {
    color: #718096;
    margin: 0 0 10px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Error Page */
.error-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-container h1 {
    color: #c53030;
    margin-bottom: 20px;
}

.error-container .error-message {
    display: block;
    font-size: 1.125rem;
    color: #718096;
    margin-bottom: 30px;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.support-info {
    color: #718096;
}

/* Footer */
.site-footer {
    margin-top: 40px;
}

.footer-main {
    background: #3d3d3d;
    padding: 50px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    background: #3d3d3d;
    padding: 20px 0;
    border-top: 1px solid #555;
}

.footer-bottom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.footer-legal a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.footer-legal a:not(:last-child)::after {
    content: "|";
    margin-left: 8px;
    color: #666;
}

.footer-legal a:hover {
    color: #ffffff;
}

.footer-copyright {
    color: #b0b0b0;
    font-size: 0.8125rem;
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .btn-primary,
    .btn-secondary,
    .btn-copy,
    .action-buttons {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .confirmation-box,
    .license-box,
    .next-steps,
    .support-box {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .checkout-sidebar {
        order: -1;
        position: static;
    }
    
    .sidebar-box {
        margin-bottom: 15px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-top {
        display: none;
    }
    
    .header-main-content {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .main-content {
        padding: 20px 0;
    }
    
    .order-summary,
    .billing-section {
        padding: 20px;
    }
    
    .form-row.two-columns {
        grid-template-columns: 1fr;
    }
    
    .items-table {
        font-size: 0.875rem;
    }
    
    .items-table th,
    .items-table td {
        padding: 10px 8px;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .order-summary,
    .billing-section {
        padding: 15px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select {
        padding: 12px 14px;
    }
    
    .btn-large {
        padding: 16px 24px;
    }
    
    .license-key {
        flex-direction: column;
    }
    
    .license-key code {
        width: 100%;
        font-size: 0.9375rem;
    }
    
    .steps-list li {
        padding-left: 50px;
    }
    
    .steps-list li::before {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
}
