:root {
    /* LUXURY TECH & REFINED PALETTE */
    --luxury-bg: #fcfcfd;
    --panel-bg: #ffffff;
    --border-refined: rgba(0, 0, 0, 0.07);
    --text-primary: #111111;
    --text-secondary: #666666;
    --brand-blue: #1a73e8;
    --accent-glow: 0 4px 20px rgba(0, 0, 0, 0.02);
    --form-bg-tint: #f8fafc;

    /* Base Architecture & Variables */
    --background: var(--luxury-bg);
    --foreground: var(--text-primary);
    --muted-foreground: var(--text-secondary);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: var(--border-refined);
    --border: var(--border-refined);
    --ring: var(--brand-blue);

    --radius: 0.75rem;
    --apple-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--luxury-bg);
    color: var(--text-primary);
    padding-bottom: 120px;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --- Global Animations --- */
@keyframes revealContainer {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Navigation System --- */
nav, .nav-container {
    background: rgba(252, 252, 253, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-refined);
    box-shadow: var(--accent-glow);
}

.nav-logo {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User Identity Display Badge */
.user-identity-badge {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.2;
    padding-right: 10px;
    border-right: 1px solid var(--border-refined);
}

.user-identity-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-identity-role {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-tab, .nav-link {
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    width: fit-content !important;
}

.nav-tab.active, .nav-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.admin-console-btn, .admin-panel-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-refined);
    padding: 6px 14px;
    border-radius: 16px;
    background: var(--panel-bg);
    transition: all 0.2s ease;
    width: fit-content !important;
}

.admin-console-btn:hover, .admin-panel-link:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

/* --- Search Bar Integration --- */
.nav-search-bar {
    flex-grow: 1;
    max-width: 450px;
    margin: 0 20px;
    display: flex;
    gap: 6px;
}

.search-input {
    height: 34px;
    border-radius: 17px;
    border: 1px solid var(--border-refined);
    padding: 0 14px;
    width: 100%;
    outline: none;
    background: #ffffff;
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--text-primary);
}

.btn-search {
    background: #111111;
    color: #ffffff;
    height: 34px;
    padding: 0 14px;
    border-radius: 17px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    width: fit-content !important;
    transition: background 0.2s ease;
}

.btn-search:hover {
    background: #222222;
}

.btn-clear {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border-refined);
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0 12px;
    height: 34px;
    border-radius: 17px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    width: fit-content !important;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

/* --- Authentication Card & Form Styles --- */
.auth-container {
    width: 100%;
    max-width: 380px;
    background: var(--panel-bg);
    border: 1px solid var(--border-refined);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--accent-glow);
    box-sizing: border-box;
    margin: 40px auto;
    animation: revealContainer 0.6s var(--apple-ease) forwards;
}

.auth-brand {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
}

.auth-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.3px;
    text-align: center;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

/* Center form actions inside forms */
.form-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 12px;
}

.form-label-refined {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: block;
}

.form-input-pill {
    height: 36px;
    border-radius: 18px;
    border: 1px solid var(--border-refined);
    padding: 0 14px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    background: #ffffff;
    font-size: 13px;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.form-input-pill:focus {
    border-color: var(--text-primary);
}

.form-textarea-pill {
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-refined, #e2e8f0);
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary, #111827);
    background: #ffffff;
    resize: vertical;
    min-height: 75px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-textarea-pill:focus {
    border-color: var(--text-primary, #111827);
}

/* BASE BUTTON CONSTRAINTS */
button, 
input[type="submit"], 
input[type="button"], 
.btn-console-action, 
.btn-console-procure, 
.btn-cart, 
.btn-console-details {
    background: #111111;
    color: #ffffff;
    height: 34px;
    padding: 0 18px !important;
    border-radius: 17px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    width: fit-content !important;
    max-width: max-content;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    margin: 8px auto 0 auto;
    transition: background 0.2s ease;
}

button:hover, 
input[type="submit"]:hover, 
input[type="button"]:hover, 
.btn-console-action:hover, 
.btn-console-procure:hover, 
.btn-cart:hover {
    background: #222222;
    color: #ffffff;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
}

.auth-links a {
    color: var(--brand-blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.alert-toast {
    background: #e6f4ea;
    color: #137333;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

/* --- Storefront Layout & Hero Section --- */
.storefront-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    animation: revealContainer 0.8s var(--apple-ease) forwards;
}

.storefront-hero, .premium-intro {
    text-align: center;
    padding: 10px 0 20px 0;
    max-width: 650px;
    margin: 0 auto;
}

.hero-title, .premium-intro h1 { 
    font-size: 28px; 
    font-weight: 600; 
    letter-spacing: -0.4px; 
    color: var(--text-primary);
    margin-bottom: 8px; 
}

.hero-subtitle, .premium-intro p {
    color: var(--text-secondary);
    font-size: 13px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

/* --- Category Filter Strip --- */
.filter-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-refined);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.filter-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: var(--panel-bg);
    border: 1px solid var(--border-refined);
    transition: all 0.2s ease;
    width: fit-content !important;
}

.filter-chip:hover, .filter-chip.active {
    background-color: #111111;
    color: #ffffff;
    border-color: #111111;
}

/* --- Sector & Product Grid Styling --- */
.sector-block {
    background: var(--panel-bg);
    border: 1px solid var(--border-refined);
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: var(--accent-glow);
}

.sector-header {
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-refined);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sector-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sector-count {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
}

.sector-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 20px;
}

/* Tech / Product Cards */
.tech-card, .product-card {
    background: var(--panel-bg); 
    border: 1px solid var(--border-refined);
    border-radius: 10px; 
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tech-card:hover, .product-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.tech-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tech-id {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.tech-badge-rating {
    font-size: 11px;
    font-weight: 500;
    color: #d4af37;
}

.tech-main-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tech-glyph-avatar {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border-refined);
}

.tech-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tech-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.tech-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.tech-action-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-refined);
}

.tech-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Secondary Button Variant */
.btn-console-details {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-refined);
}

.btn-console-details:hover { 
    background: rgba(0, 0, 0, 0.04);
}

/* --- Showcase Cards --- */
.showcase-card {
    background: var(--panel-bg, #ffffff);
    border: 1px solid var(--border-refined, rgba(0, 0, 0, 0.07));
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--accent-glow);
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* --- Cart & Checkout Layout System --- */
.cart-header-meta {
    margin-bottom: 20px;
}

.checkout-grid-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Payment Accordion Options */
.payment-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-card-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-refined, #e2e8f0);
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-card-option:hover {
    border-color: var(--text-primary, #111827);
}

.payment-card-option.active {
    border-color: #111111;
    background-color: var(--form-bg-tint);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.payment-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-title {
    font-size: 13px;
    font-weight: 500;
}

.logo-wrapper {
    width: 80px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.payment-logo-fixed {
    max-height: 28px !important;
    max-width: 75px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

.payment-instruction-box {
    margin-top: 14px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-refined, #e2e8f0);
}

.instruction-text {
    font-size: 12px;
    color: var(--text-secondary, #475569);
    margin: 0;
}

/* Sidebar Order Items List */
.sticky-sidebar {
    position: sticky;
    top: 80px;
}

.order-summary-card {
    padding: 20px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--border-refined, #e2e8f0);
    box-shadow: var(--accent-glow);
}

.summary-heading {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
}

.order-summary-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
    margin-bottom: 12px;
}

.order-items-list-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 16px;
}

.order-items-list-container::-webkit-scrollbar {
    width: 4px;
}

.order-items-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.order-item-row-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.order-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* Fixed Product Thumbnail Box */
.cart-thumb-box {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--border-refined, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.cart-item-thumb-placeholder {
    font-size: 22px;
}

.order-item-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-title-text {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.product-unit-price {
    font-size: 12px;
    color: #64748b;
}

/* Mini Quantity Selector Component */
.qty-control-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.qty-label {
    font-size: 11px;
    color: #64748b;
}

.quantity-controls-mini {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.qty-btn-mini {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #f1f5f9 !important;
    color: #111827 !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    cursor: pointer;
}

.qty-btn-mini:hover {
    background: #e2e8f0 !important;
}

.qty-input-mini {
    width: 32px;
    height: 24px;
    border: none;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    outline: none;
    color: #0f172a;
    -moz-appearance: textfield;
}

.qty-input-mini::-webkit-outer-spin-button,
.qty-input-mini::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.remove-item-link {
    font-size: 11px;
    color: #ef4444;
    text-decoration: none;
    margin-left: 6px;
}

.remove-item-link:hover {
    text-decoration: underline;
}

.order-item-total-col {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    padding-left: 10px;
}

/* Calculation Breakdown Table */
.summary-breakdown-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
    margin-bottom: 20px;
}

.summary-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #475569;
}

.total-row-highlight {
    border-top: 1px dashed #cbd5e1;
    padding-top: 10px;
    margin-top: 4px;
    font-size: 15px;
    color: #0f172a;
}

.total-amount-text {
    font-size: 18px;
    color: #d97706;
}

/* Place Order Checkout Button Override */
.btn-place-order-checkout {
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    border-radius: 22px !important;
    background: #111111 !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-top: 16px !important;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-align: center;
}

.btn-place-order-checkout:hover {
    background: #222222 !important;
}

.btn-place-order-checkout:active {
    transform: scale(0.99);
}

/* Empty State Card */
.empty-results-card {
    text-align: center;
    padding: 48px 24px;
    max-width: 500px;
    margin: 40px auto;
}

/* --- Responsive Media Queries --- */
@media (max-width: 968px) {
    nav, .nav-container { padding: 12px 20px; flex-direction: column; gap: 12px; }
    .nav-search-bar { margin: 8px 0; width: 100%; max-width: 100%; }
    .nav-links { flex-wrap: wrap; justify-content: center; width: 100%; }
    .user-identity-badge { border-right: none; padding-right: 0; text-align: center; }
}

@media (max-width: 850px) {
    .checkout-grid-layout {
        grid-template-columns: 1fr;
    }
    .form-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Password Match Validation Indicator Styles */
.form-input-pill.input-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.form-input-pill.input-success {
    border-color: #16a34a !important;
    background-color: #f0fdf4 !important;
}

.validation-message {
    font-size: 11px;
    font-weight: 500;
    margin-top: 6px;
    display: none;
    transition: all 0.2s var(--apple-ease);
}

.validation-message.error {
    display: block;
    color: #dc2626;
}

.validation-message.success {
    display: block;
    color: #16a34a;
}