/* =========================================================
   DARK THRONE
   ORDER HISTORY
   BLACK / WHITE / ORANGE
========================================================= */


:root {

    --black: #080808;

    --black-2: #101010;

    --black-3: #171717;

    --black-4: #202020;

    --orange: #ff7a00;

    --orange-dark: #d95f00;

    --white: #ffffff;

    --white-soft: #dddddd;

    --gray: #999999;

    --border: rgba(255, 255, 255, 0.09);

}


/* =========================================================
   RESET
========================================================= */

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}


html {

    scroll-behavior: smooth;

}


body {

    min-height: 100vh;

    background:
        radial-gradient(
            circle at top right,
            rgba(255, 122, 0, 0.08),
            transparent 30%
        ),
        var(--black);

    color: var(--white);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

}


button,
a {

    font-family: inherit;

}


button {

    cursor: pointer;

}


/* =========================================================
   PAGE
========================================================= */

.history-page {

    width: min(
        1180px,
        calc(100% - 32px)
    );

    margin: 0 auto;

    padding:
        30px
        0
        80px;

}


/* =========================================================
   BREADCRUMB
========================================================= */

.breadcrumb-container {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 42px;

    font-size: 14px;

}


.breadcrumb-container a {

    color: var(--white-soft);

    text-decoration: none;

    transition: 0.2s ease;

}


.breadcrumb-container a:hover {

    color: var(--orange);

}


.breadcrumb-container span {

    color: var(--gray);

}


.breadcrumb-container span:last-child {

    color: var(--orange);

    font-weight: 600;

}


/* =========================================================
   HEADER
========================================================= */

.history-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;

    margin-bottom: 35px;

}


.section-label {

    display: block;

    color: var(--orange);

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 2px;

    margin-bottom: 9px;

}


.history-heading h1 {

    font-size: clamp(
        32px,
        5vw,
        54px
    );

    line-height: 1;

    margin-bottom: 13px;

}


.history-heading p {

    color: var(--gray);

    font-size: 15px;

}


.history-icon {

    width: 76px;

    height: 76px;

    min-width: 76px;

    border-radius: 20px;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        rgba(255, 122, 0, 0.12);

    border:
        1px solid
        rgba(255, 122, 0, 0.3);

    color: var(--orange);

    font-size: 28px;

}


/* =========================================================
   SUMMARY
========================================================= */

.history-summary {

    display: grid;

    grid-template-columns:
        repeat(
            3,
            1fr
        );

    gap: 18px;

    margin-bottom: 45px;

}


.summary-card {

    min-height: 110px;

    display: flex;

    align-items: center;

    gap: 17px;

    padding: 20px;

    background:
        linear-gradient(
            145deg,
            #171717,
            #101010
        );

    border:
        1px solid var(--border);

    border-radius: 16px;

}


.summary-icon {

    width: 50px;

    height: 50px;

    min-width: 50px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 13px;

    color: var(--orange);

    background:
        rgba(255, 122, 0, 0.12);

}


.summary-card span {

    display: block;

    color: var(--gray);

    font-size: 12px;

    margin-bottom: 6px;

}


.summary-card strong {

    display: block;

    color: var(--white);

    font-size: 25px;

}


/* =========================================================
   ORDERS
========================================================= */

.orders-section {

    margin-top: 20px;

}


.orders-top {

    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    gap: 20px;

    margin-bottom: 22px;

}


.orders-top h2 {

    font-size: 28px;

}


.refresh-button {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 11px 17px;

    border:
        1px solid
        var(--border);

    border-radius: 10px;

    background:
        var(--black-3);

    color: var(--white);

    transition: 0.2s ease;

}


.refresh-button:hover {

    border-color:
        var(--orange);

    color:
        var(--orange);

}


/* =========================================================
   ORDER CARD
========================================================= */

.orders-container {

    display: flex;

    flex-direction: column;

    gap: 18px;

}


.order-card {

    background:
        linear-gradient(
            145deg,
            #181818,
            #0f0f0f
        );

    border:
        1px solid
        var(--border);

    border-radius: 18px;

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        transform 0.2s ease;

}


.order-card:hover {

    border-color:
        rgba(255, 122, 0, 0.35);

    transform:
        translateY(-2px);

}


/* =========================================================
   ORDER TOP
========================================================= */

.order-top {

    padding: 23px;

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 20px;

    border-bottom:
        1px solid
        var(--border);

}


.order-number-label {

    color: var(--gray);

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 1.5px;

    margin-bottom: 7px;

}


.order-number {

    font-size: 20px;

    font-weight: 800;

}


.order-date {

    margin-top: 7px;

    color: var(--gray);

    font-size: 13px;

}


/* =========================================================
   STATUS
========================================================= */

.status-badge {

    display: inline-flex;

    align-items: center;

    gap: 7px;

    padding:
        8px
        12px;

    border-radius: 999px;

    font-size: 12px;

    font-weight: 700;

}


.status-new {

    color: #ff9a3d;

    background:
        rgba(255, 122, 0, 0.12);

}


.status-processing {

    color: #ff9a3d;

    background:
        rgba(255, 122, 0, 0.12);

}


.status-shipped {

    color: #ffad5c;

    background:
        rgba(255, 122, 0, 0.14);

}


.status-delivered {

    color: #ffffff;

    background:
        rgba(255, 255, 255, 0.10);

}


/* =========================================================
   ORDER PRODUCTS
========================================================= */

.order-products {

    padding: 20px 23px;

    display: flex;

    flex-direction: column;

    gap: 12px;

}


.order-product {

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 12px;

    border-radius: 13px;

    background:
        rgba(255, 255, 255, 0.035);

}


.product-image {

    width: 70px;

    height: 70px;

    min-width: 70px;

    border-radius: 10px;

    object-fit: cover;

    background:
        #252525;

}


.product-info {

    flex: 1;

    min-width: 0;

}


.product-name {

    font-size: 15px;

    font-weight: 700;

    margin-bottom: 6px;

}


.product-meta {

    color: var(--gray);

    font-size: 12px;

    line-height: 1.6;

}


.product-price {

    color: var(--white);

    font-weight: 700;

    white-space: nowrap;

}


/* =========================================================
   TIMELINE
========================================================= */

.order-timeline {

    padding:
        20px
        23px;

    border-top:
        1px solid
        var(--border);

    border-bottom:
        1px solid
        var(--border);

}


.timeline-track {

    position: relative;

    display: grid;

    grid-template-columns:
        repeat(
            4,
            1fr
        );

}


.timeline-line {

    position: absolute;

    left: 12%;

    right: 12%;

    top: 15px;

    height: 2px;

    background:
        #333;

}


.timeline-progress {

    position: absolute;

    left: 12%;

    top: 15px;

    height: 2px;

    background:
        var(--orange);

    transition:
        width 0.4s ease;

}


.timeline-step {

    position: relative;

    z-index: 2;

    text-align: center;

}


.timeline-dot {

    width: 30px;

    height: 30px;

    margin:
        0 auto
        8px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        #292929;

    border:
        2px solid
        #444;

    color: #777;

    font-size: 11px;

}


.timeline-step.completed
.timeline-dot,

.timeline-step.active
.timeline-dot {

    background:
        var(--orange);

    border-color:
        var(--orange);

    color:
        #111;

}


.timeline-label {

    color: #777;

    font-size: 10px;

    font-weight: 700;

}


.timeline-step.completed
.timeline-label,

.timeline-step.active
.timeline-label {

    color:
        var(--white);

}


/* =========================================================
   ORDER BOTTOM
========================================================= */

.order-bottom {

    padding:
        20px
        23px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

}


.order-total-label {

    color: var(--gray);

    font-size: 12px;

    margin-bottom: 4px;

}


.order-total {

    font-size: 21px;

    font-weight: 800;

}


.view-order-button {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    border: none;

    padding:
        12px
        17px;

    border-radius: 10px;

    background:
        var(--orange);

    color:
        #111;

    font-weight: 800;

    transition:
        0.2s ease;

}


.view-order-button:hover {

    background:
        #ff8b1f;

    transform:
        translateY(-1px);

}


/* =========================================================
   STATE
========================================================= */

.history-state {

    padding:
        70px
        20px;

    text-align: center;

    background:
        #111;

    border:
        1px solid
        var(--border);

    border-radius: 18px;

}


.history-state h2,
.history-state h3 {

    margin:
        16px
        0
        8px;

}


.history-state p {

    color:
        var(--gray);

    font-size: 14px;

}


.empty-icon {

    width: 70px;

    height: 70px;

    margin: 0 auto;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        rgba(255, 122, 0, 0.1);

    color:
        var(--orange);

    font-size: 27px;

}


.shop-button {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    margin-top: 22px;

    padding:
        12px
        18px;

    border-radius: 10px;

    border: none;

    text-decoration: none;

    background:
        var(--orange);

    color:
        #111;

    font-weight: 800;

}


.error-state {

    border-color:
        rgba(255, 80, 80, 0.2);

}


/* =========================================================
   SPINNER
========================================================= */

.spinner {

    width: 35px;

    height: 35px;

    margin: 0 auto;

    border:
        3px solid
        #333;

    border-top-color:
        var(--orange);

    border-radius: 50%;

    animation:
        spin 0.8s linear infinite;

}


@keyframes spin {

    to {

        transform:
            rotate(360deg);

    }

}


/* =========================================================
   MODAL
========================================================= */

.order-modal {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

}


.order-modal[hidden] {

    display: none;

}


.modal-overlay {

    position: absolute;

    inset: 0;

    background:
        rgba(0, 0, 0, 0.82);

    backdrop-filter:
        blur(5px);

}


.modal-card {

    position: relative;

    z-index: 2;

    width: min(
        700px,
        100%
    );

    max-height: 90vh;

    overflow-y: auto;

    padding: 28px;

    border-radius: 20px;

    background:
        #151515;

    border:
        1px solid
        var(--border);

}


.modal-close {

    position: absolute;

    right: 18px;

    top: 18px;

    width: 38px;

    height: 38px;

    border: none;

    border-radius: 50%;

    background:
        #252525;

    color:
        var(--white);

    font-size: 17px;

}


.modal-close:hover {

    background:
        var(--orange);

    color:
        #111;

}


.modal-header {

    padding-right: 50px;

    margin-bottom: 25px;

}


.modal-header h2 {

    font-size: 26px;

    margin-bottom: 7px;

}


.modal-header p {

    color:
        var(--gray);

    font-size: 13px;

}


.modal-content {

    display: flex;

    flex-direction: column;

    gap: 20px;

}


.modal-section {

    padding: 18px;

    border:
        1px solid
        var(--border);

    border-radius: 14px;

    background:
        rgba(255, 255, 255, 0.025);

}


.modal-section h3 {

    font-size: 15px;

    margin-bottom: 14px;

    color:
        var(--orange);

}


.address-box {

    color:
        var(--white-soft);

    line-height: 1.7;

    font-size: 14px;

}


.modal-product {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 10px 0;

    border-bottom:
        1px solid
        var(--border);

}


.modal-product:last-child {

    border-bottom: none;

}


.modal-product img {

    width: 58px;

    height: 58px;

    border-radius: 8px;

    object-fit: cover;

}


.modal-product-info {

    flex: 1;

}


.modal-product-name {

    font-size: 14px;

    font-weight: 700;

}


.modal-product-meta {

    margin-top: 5px;

    color:
        var(--gray);

    font-size: 12px;

}


.modal-product-price {

    font-weight: 700;

}


.price-row {

    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding: 7px 0;

    color:
        var(--gray);

    font-size: 14px;

}


.price-row.total {

    margin-top: 8px;

    padding-top: 14px;

    border-top:
        1px solid
        var(--border);

    color:
        var(--white);

    font-size: 17px;

    font-weight: 800;

}


.price-row.total strong {

    color:
        var(--orange);

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (
    max-width: 760px
) {

    .history-page {

        width:
            min(
                100% - 22px,
                1180px
            );

        padding-top:
            22px;

    }


    .history-header {

        align-items:
            flex-start;

    }


    .history-icon {

        width: 58px;

        height: 58px;

        min-width: 58px;

        border-radius: 15px;

        font-size: 22px;

    }


    .history-summary {

        grid-template-columns:
            1fr;

    }


    .orders-top {

        align-items:
            flex-start;

    }


    .order-top {

        flex-direction:
            column;

    }


    .order-bottom {

        align-items:
            flex-start;

        flex-direction:
            column;

    }


    .view-order-button {

        width: 100%;

        justify-content:
            center;

    }


    .product-price {

        font-size: 13px;

    }


    .timeline-label {

        font-size: 8px;

    }


    .timeline-dot {

        width: 26px;

        height: 26px;

    }


    .timeline-line,
    .timeline-progress {

        top: 13px;

    }

}


@media (
    max-width: 480px
) {

    .history-heading h1 {

        font-size: 31px;

    }


    .history-heading p {

        font-size: 13px;

    }


    .order-top,
    .order-products,
    .order-timeline,
    .order-bottom {

        padding:
            17px;

    }


    .product-image {

        width: 58px;

        height: 58px;

        min-width: 58px;

    }


    .modal-card {

        padding: 20px;

    }

}
/* =========================================================
   MOBILE INPUT ZOOM FIX
   Prevent iPhone Safari from zooming when fields are tapped
   ========================================================= */

input,
select,
textarea,
button {
    font-size: 16px;
}

input,
select,
textarea {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* =========================================================
   CURRENT HISTORY.JS CARD COMPATIBILITY
   ========================================================= */

.order-card-header {
    padding: 23px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
}

.order-label {
    display: block;
    color: var(--gray);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 7px;
}

.order-card-header h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
}

.order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.order-status.status-new,
.order-status.status-processing {
    color: #ff9a3d;
    background: rgba(255, 122, 0, 0.12);
}

.order-status.status-shipped {
    color: #ffad5c;
    background: rgba(255, 122, 0, 0.14);
}

.order-status.status-delivered {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.10);
}

.order-card-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 20px 23px;
}

.order-info {
    min-width: 0;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.order-info span {
    display: block;
    color: var(--gray);
    font-size: 11px;
    margin-bottom: 6px;
}

.order-info strong {
    display: block;
    color: var(--white);
    font-size: 14px;
    word-break: break-word;
}

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 18px 23px;
    border-top: 1px solid var(--border);
}

.view-order-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--orange);
    color: #111;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
}

.view-order-btn:hover {
    background: #ff8b1f;
    transform: translateY(-1px);
}

.modal-order-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 122, 0, 0.07);
}

.modal-order-status span {
    color: var(--gray);
    font-size: 13px;
}

.modal-order-status strong {
    color: var(--orange);
    font-size: 14px;
}

.modal-products {
    display: flex;
    flex-direction: column;
}

.modal-product > div {
    flex: 1;
    min-width: 0;
}

.modal-product small {
    display: block;
    margin-top: 5px;
    color: var(--gray);
    line-height: 1.5;
}

.modal-total {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 12px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.modal-total strong:last-child {
    color: var(--orange);
}

.modal-section p {
    margin: 7px 0;
    color: var(--white-soft);
    line-height: 1.55;
    font-size: 14px;
}

@media (max-width: 760px) {

    .order-card-header {
        flex-direction: column;
        padding: 18px;
    }

    .order-card-body {
        grid-template-columns: 1fr;
        padding: 17px;
    }

    .order-card-footer {
        padding: 17px;
        justify-content: stretch;
    }

    .view-order-btn {
        width: 100%;
    }

    .modal-order-status {
        align-items: flex-start;
        flex-direction: column;
    }

}
