﻿
:root {
    --color-primary: #3f1c46;
    --plum-light: #5a2864;
    --plum-deep: #2a1230;
    --sand: #e3dfdc;
    --sand-light: #f0ede9;
    --sand-dark: #ababab;
    --cream: #faf8f5;
    --text-dark: #1a0e1e;
    --text-mid: #5a4f60;
    --gold: #c9a96e;
    --gold-light: #e8d5a3;
    --font-calisto: 'Calisto MT';
    --font-outfit: 'Outfit';
}

/* ── SECTION WRAPPER ── */
.order-history-section {
    padding-block: 1rem 5rem;
}

.breadcrumb {
    color: #777;
/*    margin-bottom: 2rem;*/
    font-size: 0.9rem;
}

    .breadcrumb a {
        color: #777;
        text-decoration: none;
    }

        .breadcrumb a:hover {
            color: var(--color-primary);
        }

.breadcrumb-sep {
    margin: 0 0.5rem;
    color: var(--sand-dark);
}

/* ── STATS STRIP ── */
.stats-strip {
    display: flex;
    align-items: center;
    background: var(--color-primary);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    gap: 0;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-num {
    font-family: var(--font-calisto), 'Cormorant Garamond', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 300;
    color: var(--gold-light);
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(227, 223, 220, 0.45);
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(227, 223, 220, 0.12);
    flex-shrink: 0;
}

/* ── TOOLBAR ── */
.order-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.toolbar-left {
    flex: 1;
    min-width: 0;
}

.filter-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--sand);
    flex-wrap: wrap;
}

.filter-tab {
    font-family: 'Outfit', 'Jost', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sand-dark);
    background: none;
    border: none;
    padding: 0.65rem 1.1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

    .filter-tab:hover {
        color: var(--color-primary);
    }

    .filter-tab.active {
        color: var(--color-primary);
        border-bottom-color: var(--color-primary);
    }

.toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--sand-dark);
    pointer-events: none;
}

.search-input {
    border: 1px solid var(--sand);
    background: var(--cream);
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    color: var(--text-dark);
    outline: none;
    width: 200px;
    transition: border-color 0.2s;
}

    .search-input:focus {
        border-color: var(--color-primary);
    }

    .search-input::placeholder {
        color: var(--sand-dark);
    }

.sort-select {
    border: 1px solid var(--sand);
    background: var(--cream);
    padding: 0.5rem 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    color: var(--text-mid);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

    .sort-select:focus {
        border-color: var(--color-primary);
    }

/* ── ORDER CARD ── */
.order-card {
    border: 1px solid var(--sand);
    background: var(--cream);
    margin-bottom: 1rem;
    transition: border-color 0.25s;
}

    .order-card:hover {
        border-color: var(--sand-dark);
    }

    .order-card.expanded {
        border-color: rgba(63, 28, 70, 0.25);
    }

/* Card Header */
.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--sand-light);
    background: var(--sand-light);
    gap: 16px;
}

.order-meta-group {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.order-id-block,
.order-date-block,
.order-items-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sand-dark);
}

.order-id-val {
    font-family: var(--font-calisto), 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-primary);
    letter-spacing: 0.02em;
}

.order-date-val,
.order-items-val {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-primary);
}

.order-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Status Badges */
.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 8px 12px;
    white-space: nowrap;
}

.status-processing {
    background: rgba(201, 169, 110, 0.15);
    color: #7a5c1e;
    border: 1px solid rgba(201, 169, 110, 0.4);
}

.status-shipped {
    background: rgba(15, 80, 65, 0.08);
    color: #0f5041;
    border: 1px solid rgba(15, 80, 65, 0.25);
}

.status-delivered {
    background: rgba(63, 28, 70, 0.08);
    color: var(--color-primary);
    border: 1px solid rgba(63, 28, 70, 0.2);
}

.status-cancelled {
    background: rgba(150, 50, 50, 0.08);
    color: #7a1f1f;
    border: 1px solid rgba(150, 50, 50, 0.2);
}

.status-pending {
    background: rgba(200, 170, 50, 0.1);
    color: #6b5300;
    border: 1px solid rgba(200, 170, 50, 0.3);
}

/* Toggle Button */
.toggle-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--sand-dark);
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.25s, border-color 0.25s;
}

    .toggle-btn svg {
        width: 14px;
        height: 14px;
        color: var(--text-mid);
        transition: transform 0.3s ease;
    }

    .toggle-btn:hover {
        background: var(--sand);
    }

.order-card.expanded .toggle-btn {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transition:500ms ease;
}

    .order-card.expanded .toggle-btn .arrow-black{
        display:none;
    }

    .order-card.expanded .toggle-btn .arrow-white {
        display: block !important;
        transform: rotate(180deg);
    }
    /*.order-card.expanded .toggle-btn svg {
        color: var(--sand);
        transform: rotate(180deg);
    }*/
    /* Preview Row */
    .order-preview {
        display: flex;
        gap: 0;
        padding: 1rem 1.4rem;
        border-bottom: 1px solid var(--sand-light);
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
    }

.preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-img {
    width: 52px;
    height: 52px;
    overflow: hidden;
    border: 1px solid var(--sand);
    background: var(--sand-light);
    flex-shrink: 0;
}

    .preview-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-name {
    font-family:var(--font-calisto);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-primary);
    margin: 0;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-meta {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-mid);
    margin: 0;
}

.preview-more {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-primary);
    padding: 6px 12px;
    border: 1px solid rgba(63, 28, 70, 0.2);
    white-space: nowrap;
    align-self: center;
}

/* Card Footer */
.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem;
    gap: 16px;
    flex-wrap: wrap;
}

.order-total-block {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.order-total-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sand-dark);
}

.order-total-val {
    font-family: var(--font-calisto), 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-primary);
}

.order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-order-action {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 8px 18px;
    text-decoration: none;
    border: 1px solid;
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
    white-space: nowrap;
}

.btn-track {
    background: none;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

    .btn-track:hover {
        background: var(--color-primary);
        color: var(--sand);
    }

.btn-reorder {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--sand);
}

    .btn-reorder:hover {
        background: var(--plum-deep);
        border-color: var(--plum-deep);
    }

.btn-cancel {
    background: none;
    border-color: var(--sand-dark);
    color: var(--text-mid);
}

    .btn-cancel:hover {
        border-color: #7a1f1f;
        color: #7a1f1f;
    }

/* ── EXPANDED DETAIL ── */
.order-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s ease;
}

    .order-detail.open {
        max-height: 1000px;
    }

.detail-rule {
    height: 1px;
    background: var(--sand);
    margin: 0 1.4rem;
}

.detail-items {
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--sand-light);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--sand-light);
}

    .detail-item:last-child {
        border-bottom: none;
    }

.detail-item-img {
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid var(--sand);
    background: var(--sand-light);
    flex-shrink: 0;
}

    .detail-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

.detail-item-info {
    flex: 1;
}

.detail-item-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0 0 4px;
    font-family: var(--font-calisto), 'Cormorant Garamond', Georgia, serif;
    color: var(--color-primary);
}

.detail-item-meta {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-mid);
    margin: 0;
    line-height: 1.5;
}

.detail-item-price {
    font-family: var(--font-calisto), 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-primary);
    flex-shrink: 0;
}

/* Detail Bottom: shipping + summary */
.detail-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--sand-light);
}

.detail-shipping,
.detail-summary {
    padding: 1.2rem 1.4rem;
}

.detail-shipping {
    border-right: 1px solid var(--sand);
}

.detail-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sand-dark);
    margin-bottom: 8px;
}

.detail-address {
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--text-dark);
    line-height: 1.7;
    margin: 0;
}

.detail-tracking {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-primary);
    letter-spacing: 0.06em;
    margin: 0;
}

.detail-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--text-mid);
    padding: 5px 0;
    border-bottom: 1px solid rgba(204, 199, 194, 0.4);
}

    .detail-sum-row:last-child {
        border-bottom: none;
    }

    .detail-sum-row.discount span:last-child {
        color: #1a7a4a;
        font-weight: 500;
    }

    .detail-sum-row.total {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--color-primary);
        padding-top: 10px;
        margin-top: 4px;
        border-top: 1px solid var(--sand-dark);
        border-bottom: none;
    }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--cream);
    border: 1px solid var(--sand);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--sand-dark);
}

    .empty-icon svg {
        width: 100%;
        height: 100%;
    }

.empty-title {
    font-family: var(--font-calisto), 'Cormorant Garamond', Georgia, serif;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.empty-body {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-mid);
    line-height: 1.8;
    max-width: 480px;
    margin: 0 auto 2rem;
}

.btn-explore {
    display: inline-block;
    background: var(--color-primary);
    color: var(--sand);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 14px 36px;
    transition: background 0.3s;
}

    .btn-explore:hover {
        background: var(--plum-deep);
    }


/* ============================================
   RESPONSIVE
============================================ */

/* Tablets ≤ 992px */
@media (max-width: 992px) {

    .stats-strip {
        padding: 1.2rem 1rem;
    }

    .stat-num {
        font-size: 1.5rem;
    }

    .order-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-right {
        width: 100%;
    }

    .search-input {
        width: 100%;
        flex: 1;
    }

    .detail-bottom {
        grid-template-columns: 1fr;
    }

    .detail-shipping {
        border-right: none;
        border-bottom: 1px solid var(--sand);
    }

    .order-meta-group {
        gap: 1rem;
    }
}

/* Mobiles ≤ 768px */
@media (max-width: 768px) {

    .order-history-section {
        padding-block: 1.5rem 3rem;
    }

    .stats-strip {
        padding: 1rem;
        gap: 0;
    }

    .stat-num {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .order-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .order-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .order-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .order-actions {
        width: 100%;
    }

    .btn-order-action {
        flex: 1;
        text-align: center;
    }

    .preview-name {
        max-width: 100px;
    }
}

/* Small mobiles ≤ 480px */
@media (max-width: 480px) {

    .stats-strip {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0;
        row-gap: 0;
    }

    .stat-item {
        flex: 0 0 50%;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(227, 223, 220, 0.1);
    }

    .stat-divider {
        display: none;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .filter-tab {
        font-size: 0.7rem;
        padding: 0.55rem 0.75rem;
    }

    .toolbar-right {
        flex-direction: column;
        gap: 8px;
    }

    .search-input,
    .sort-select {
        width: 100%;
    }

    .order-meta-group {
        gap: 0.75rem;
    }

    .order-id-val {
        font-size: 0.95rem;
    }

    .order-preview {
        padding: 0.875rem 1rem;
    }

    .order-card-header,
    .order-card-footer,
    .detail-items,
    .detail-shipping,
    .detail-summary {
        padding-inline: 1rem;
    }

    .detail-rule {
        margin-inline: 1rem;
    }

    .detail-item {
        flex-wrap: wrap;
    }

    .detail-item-price {
        margin-left: auto;
    }
}
