/* ===== Amazon Ember Font ===== */
@font-face {
    font-family: 'Amazon Ember';
    src: url('fonts/Amazon Ember.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Amazon Ember';
    src: url('fonts/Amazon Ember Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Amazon Ember';
    src: url('fonts/Amazon Ember Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Amazon Ember';
    src: url('fonts/Amazon Ember Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

:root {
    /* Amazon-style colors from Figma */
    --amazon-header: #131921;
    --amazon-subheader: #232f3e;
    --amazon-orange: #ff8800;
    --amazon-link: #042D53;
    --amazon-badge: #febd69;
    --amazon-badge-text: #000000;

    /* Grays */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --border-gray: #999999;

    /* Risk colors */
    --critical: #dc2626;
    --critical-light: #fef2f2;
    --high: #f97316;
    --high-light: #fff7ed;
}

body {
    font-family: 'Amazon Ember', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
}

/* ===== Header ===== */
.site-header {
    background: var(--amazon-header);
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1355px;
    margin: 0 auto;
    padding: 0 43px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    width: 100%;
}

.header-logo {
    flex-shrink: 0;
}

.header-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--white);
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    height: 32px;
    width: 450px;
}

.search-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #d9d9d9;
    height: 100%;
    width: 70px;
    padding: 0 14px 0 12px;
    border-radius: 8px 0 0 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-dropdown svg {
    transform: rotate(180deg);
}

.search-input {
    flex: 1;
    height: 100%;
    border: none;
    padding: 0 14px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    outline: none;
}

.search-input::placeholder {
    color: #666;
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--amazon-badge);
    height: 100%;
    width: 50px;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    color: #333;
    flex-shrink: 0;
}

.search-button:hover {
    background: #f5a623;
}

.total-badge {
    background: var(--amazon-badge);
    color: var(--amazon-badge-text);
    padding: 8px 25px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 500;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Sub-header ===== */
.sub-header {
    background: var(--amazon-subheader);
    padding: 16px 0;
    position: sticky;
    top: 64px;
    z-index: 99;
}

.sub-header-container {
    max-width: 1355px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.info-icon {
    flex-shrink: 0;
}

.sub-header-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    line-height: 1.4;
    text-align: center;
}

/* ===== Main Content ===== */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 26px 2rem 3rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.breadcrumb-link {
    font-size: 14px;
    color: var(--amazon-link);
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--gray-500);
    font-size: 13px;
}

.breadcrumb-current {
    font-size: 14px;
    color: var(--amazon-orange);
}

/* Page Title */
.page-title {
    font-size: 32px;
    font-weight: 400;
    color: var(--gray-900);
    margin-bottom: 24px;
}

/* Tab Navigation */
.tab-nav {
    margin-bottom: 22px;
    border-bottom: 1px solid var(--gray-300);
}

.tab-item {
    display: inline-flex;
    flex-direction: column;
    gap: 9px;
    padding-bottom: 0;
}

.tab-item-label {
    font-size: 18px;
    font-weight: 500;
    color: var(--gray-900);
}

.tab-item-indicator {
    height: 3px;
    background: var(--amazon-orange);
    border-radius: 2px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.order-count {
    font-size: 14px;
    color: var(--gray-900);
}

.order-count strong {
    font-weight: 500;
}

.year-select {
    font-family: inherit;
    font-size: 14px;
    padding: 4px 12px 5px 11px;
    border: 1px solid var(--border-gray);
    border-radius: 5px;
    background: var(--white);
    cursor: pointer;
    color: var(--gray-900);
    height: 25px;
}

.year-select:focus {
    outline: 2px solid var(--amazon-link);
    outline-offset: -1px;
}

.search-results-info {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.search-results-info #search-results-count {
    font-weight: 600;
}

.search-results-info #search-results-term {
    font-style: italic;
}

/* ===== Order Cards (Amazon-style) ===== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: var(--white);
    border: 1px solid #d3d3d3;
    border-radius: 10px;
    overflow: hidden;
}

.order-card-header {
    background: #eff1f3;
    padding: 20px 24px 19px 26px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    border-radius: 10px 10px 0 0;
}

.order-meta {
    display: flex;
    gap: 27px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.order-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-meta-label {
    font-size: 12px;
    color: #7c7c7c;
    text-transform: uppercase;
    font-weight: 500;
    display: block;
}

.order-meta-value {
    font-size: 12px;
    color: #7c7c7c;
    font-weight: 500;
    display: block;
}

.order-meta-value.link {
    color: var(--amazon-link);
    cursor: pointer;
}

.order-meta-value.link:hover {
    text-decoration: underline;
}

.ship-to-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.chevron-icon {
    width: 13px;
    height: 13px;
    transform: rotate(180deg);
}

.order-id {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.order-id-label {
    font-size: 12px;
    color: #7c7c7c;
    font-weight: 500;
    display: block;
}

.order-id-value {
    font-size: 12px;
    color: var(--amazon-link);
    font-weight: 500;
    display: block;
}

/* Delivery Status */
.delivery-status {
    padding: 21px 26px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Product Section */
.order-card-body {
    padding: 18px 26px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.product-section {
    display: flex;
    gap: 27px;
    align-items: flex-start;
}

.order-icon {
    width: 92px;
    height: 89px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.order-icon.has-image {
    background: none;
}

.order-icon svg {
    width: 40px;
    height: 40px;
    color: var(--gray-500);
}

.order-icon .product-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.order-details {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 320px;
}

.order-item-name {
    font-size: 14px;
    font-weight: 400;
    color: #042D53;
    line-height: 1.4;
}

.order-merchant {
    font-size: 12px;
    color: #7c7c7c;
}

.view-details-btn {
    border: 1px solid #999;
    border-radius: 10px;
    padding: 7px 42px 7px 40px;
    font-size: 14px;
    color: var(--gray-900);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.view-details-btn:hover {
    background: var(--gray-100);
}

/* Risk Badge - positioned in body */
.order-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    align-items: flex-end;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.risk-badge.critical {
    background: var(--critical);
    color: var(--white);
}

.risk-badge.high {
    background: var(--high);
    color: var(--white);
}

.risk-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ===== Expanded Order Details ===== */
.order-expanded {
    background: #eff1f3;
    border-top: 1px solid #d3d3d3;
    padding: 24px 105px 24px 26px;
    display: none;
    border-radius: 0 0 10px 10px;
}

.order-card.expanded .order-expanded {
    display: block;
}

.order-expanded-grid {
    display: flex;
    gap: 31px;
    align-items: flex-start;
}

.order-expanded-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.order-expanded-label {
    font-size: 12px;
    color: #7c7c7c;
    text-transform: uppercase;
    font-weight: 500;
    display: block;
}

.order-expanded-value {
    font-size: 12px;
    color: #7c7c7c;
    font-weight: 500;
    display: block;
    white-space: nowrap;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .site-header {
        height: auto;
        padding: 12px 0;
    }

    .sub-header {
        position: static;
    }

    .header-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .search-bar {
        width: 100%;
        max-width: 450px;
    }

    .order-card-header {
        flex-direction: column;
        gap: 12px;
    }

    .order-id {
        text-align: left;
    }

    .order-card-body {
        flex-direction: column;
        gap: 16px;
    }

    .product-section {
        width: 100%;
    }

    .order-details {
        width: auto;
        flex: 1;
    }

    .view-details-btn {
        width: 100%;
        text-align: center;
    }

    .order-expanded-grid {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .order-expanded-item.cost-center,
    .order-expanded-item.division,
    .order-expanded-item.account-desc {
        width: 100%;
    }
}

/* ===== Accept Box ===== */
.accept-box {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--white);
    border: 1px solid #d3d3d3;
    border-radius: 10px;
    padding: 20px 13px 26px 18px;
    width: 263px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.accept-box.hidden {
    display: none;
}

.accept-title {
    font-size: 12px;
    font-weight: 700;
    color: #eb8107;
    margin: 0;
}

.accept-body {
    font-size: 12px;
    color: var(--gray-900);
    line-height: 1.5;
}

.accept-body p {
    margin: 0;
}

.accept-body em {
    font-style: italic;
}

.accept-btn {
    width: 123px;
    height: 23px;
    border: 1px solid #666;
    border-radius: 10px;
    background: linear-gradient(to top, #f80, #febd69);
    font-size: 10px;
    font-family: inherit;
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accept-btn:hover {
    background: linear-gradient(to top, #e67a00, #f5a623);
}

@media (max-width: 600px) {
    .header-logo img {
        height: 40px;
    }

    .search-bar {
        height: 28px;
    }

    .search-dropdown {
        width: 50px;
        padding: 0 8px;
        font-size: 12px;
    }

    .search-input {
        font-size: 12px;
        padding: 0 10px;
    }

    .search-button {
        width: 40px;
    }

    .main-content {
        padding: 20px 1rem 2rem;
    }

    .sub-header-container,
    .header-container {
        padding: 0 1rem;
    }

    .page-title {
        font-size: 24px;
    }

    .order-meta {
        gap: 16px;
    }

    .order-icon {
        width: 70px;
        height: 70px;
    }

    .product-section {
        gap: 16px;
    }

    .order-card-header {
        padding: 16px;
    }

    .order-card-body {
        padding: 16px;
    }

    .delivery-status {
        padding: 16px 16px 0;
    }

    .order-expanded {
        padding: 16px;
    }
}
