/*
 * TechStore Demo - Stripe-inspired Design
 * Clean, minimal, professional
 */

/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Stripe-inspired palette */
    --primary: #635bff;
    --primary-hover: #5851ea;
    --primary-light: #f6f5ff;

    --success: #0a9b7b;
    --success-light: #d1fae5;

    --warning: #f5a623;
    --danger: #df1b41;

    --text-primary: #1a1f36;
    --text-secondary: #697386;
    --text-muted: #8792a2;

    --bg-white: #ffffff;
    --bg-light: #f7fafc;
    --bg-subtle: #f1f5f9;

    --border: #e3e8ee;
    --border-light: #f0f3f7;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Clean & Minimal */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.logo-text span {
    color: var(--text-muted);
    font-weight: 400;
}

header nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

header nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

header nav a:hover {
    color: var(--text-primary);
}

.test-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    color: #856404;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}

.test-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #856404;
    border-radius: 50%;
}

/* Main Layout */
main.container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    padding: 48px 24px;
    align-items: start;
}

/* Section Titles */
.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s ease;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.product-image {
    height: 140px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 20px;
}

.product-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.product-card .product-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.product-card .price {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.product-card .price .currency {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.btn-add-cart {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-add-cart:hover {
    background: var(--bg-subtle);
    border-color: var(--text-muted);
}

.btn-add-cart.added {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

/* Cart Sidebar */
.cart-sidebar {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: sticky;
    top: 100px;
}

.cart-sidebar h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-sidebar h2 .cart-count {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 100px;
}

.cart-items {
    min-height: 120px;
    margin-bottom: 24px;
}

.empty-cart {
    color: var(--text-muted);
    text-align: center;
    padding: 32px 16px;
    font-size: 14px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--text-secondary);
    font-size: 13px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.15s;
}

.cart-item-remove:hover {
    color: var(--danger);
}

.cart-summary {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.cart-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.cart-row.subtle {
    color: var(--text-secondary);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.btn-checkout {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-checkout:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}

.btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-checkout svg {
    width: 18px;
    height: 18px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 31, 54, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 24px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Form Styles */
.form-section {
    margin-bottom: 24px;
}

.form-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.15s;
    background: var(--bg-white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

/* Order Summary in Modal */
.order-summary {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

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

.order-total {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

/* Pay Button */
.btn-pay {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-pay:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}

.btn-pay svg {
    width: 20px;
    height: 20px;
}

.redirect-notice {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Payment Status */
.payment-status {
    text-align: center;
    padding: 48px 24px;
}

.payment-status.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.payment-status p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Footer */
footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 48px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer code {
    background: var(--bg-subtle);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    gap: 24px;
    font-size: 14px;
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-primary);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 900px) {
    main.container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .cart-sidebar {
        position: static;
    }

    header nav {
        display: none;
    }
}

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

    footer .container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
    }
}
