/* =========================================================
   MEelo - My Orders Page
   REAL-TIME ORDER TRACKING + PAYMENT STATUS
   ========================================================= */

.my-orders-page {
    min-height: 70vh;
    padding: 55px 0 80px;
    background: #fafafa;
}


/* =========================================================
   PAGE HEADING
   ========================================================= */

.orders-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.orders-heading h1 {
    margin: 0 0 7px;
    color: #171717;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 800;
}

.orders-heading p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.orders-shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 0 18px;
    border-radius: 10px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

.orders-shop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.14);
}


/* =========================================================
   STATES
   ========================================================= */

.orders-state {
    max-width: 600px;
    margin: 30px auto;
    padding: 45px 25px;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.orders-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f2f2f2;
    font-size: 27px;
}

.orders-state h2 {
    margin: 0 0 9px;
    color: #171717;
    font-size: 22px;
}

.orders-state p {
    margin: 0 0 22px;
    color: #777;
    font-size: 14px;
    line-height: 1.6;
}

.orders-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.orders-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.14);
}


/* =========================================================
   LOADING
   ========================================================= */

.orders-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 15px;
    border: 3px solid #ddd;
    border-top-color: #111;
    border-radius: 50%;
    animation: ordersSpin 0.8s linear infinite;
}

@keyframes ordersSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   ORDERS LIST
   ========================================================= */

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}


/* =========================================================
   ORDER CARD
   ========================================================= */

.order-card {
    overflow: hidden;
    border: 1px solid #e7e7e7;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 7px 25px rgba(0, 0, 0, 0.04);
}

.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid #eeeeee;
    background: #fcfcfc;
}

.order-card-id {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-card-id span {
    color: #777;
    font-size: 12px;
}

.order-card-id strong {
    color: #171717;
    font-size: 14px;
    word-break: break-all;
}


/* =========================================================
   ORDER HEADER TEXT
   ========================================================= */

.order-label {
    display: block;
    margin-bottom: 4px;
    color: #777;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.order-id {
    display: block;
    color: #171717;
    font-size: 14px;
    font-weight: 800;
    word-break: break-all;
}


/* =========================================================
   STATUS
   ========================================================= */

.order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 20px;
    background: #f1f1f1;
    color: #333;
    font-size: 12px;
    font-weight: 700;
}

.order-status.pending {
    background: #fff3cd;
    color: #7a5b00;
}

.order-status.confirmed {
    background: #e8f1ff;
    color: #1557a0;
}

.order-status.shipped {
    background: #eee8ff;
    color: #5738a5;
}

.order-status.delivered {
    background: #e8f7ed;
    color: #21733b;
}

.order-status.cancelled {
    background: #ffe8e8;
    color: #a52828;
}


/* =========================================================
   REAL-TIME TRACKING
   ========================================================= */

.order-tracking {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid #eeeeee;
    background: #fff;
}

.tracking-line {
    position: absolute;
    top: 34px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #e5e5e5;
    z-index: 0;
}

.tracking-step {
    position: relative;
    z-index: 1;
    min-width: 0;
    text-align: center;
}

.tracking-dot {
    width: 25px;
    height: 25px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #777;
    font-size: 11px;
    font-weight: 800;
}

.tracking-step.completed .tracking-dot {
    border-color: #21733b;
    background: #21733b;
    color: #fff;
}

.tracking-step.active .tracking-dot {
    border-color: #111;
    background: #111;
    color: #fff;
}

.tracking-content strong {
    display: block;
    color: #777;
    font-size: 11px;
    line-height: 1.3;
}

.tracking-step.completed .tracking-content strong,
.tracking-step.active .tracking-content strong {
    color: #222;
}

.tracking-content small {
    display: block;
    margin-top: 3px;
    color: #777;
    font-size: 9px;
}

.cancelled-tracking {
    display: block;
    padding: 18px 22px;
}

.tracking-cancelled {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tracking-cancelled .tracking-dot {
    flex: 0 0 auto;
    margin: 0;
    border-color: #a52828;
    background: #ffe8e8;
    color: #a52828;
}

.tracking-cancelled strong {
    display: block;
    color: #a52828;
    font-size: 14px;
}

.tracking-cancelled small {
    display: block;
    margin-top: 3px;
    color: #777;
    font-size: 12px;
}


/* =========================================================
   ORDER BODY
   ========================================================= */

.order-card-body {
    padding: 22px;
}

.order-products {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 22px;
}

.order-product {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding-bottom: 13px;
    border-bottom: 1px solid #eeeeee;
}

.order-product:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.order-product-image {
    width: 64px;
    height: 64px;
    overflow: hidden;
    object-fit: cover;
    border-radius: 10px;
    background: #f5f5f5;
}

.order-product-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.order-product-info {
    min-width: 0;
}

.order-product-info h4 {
    margin: 0 0 5px;
    color: #222;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
}

.order-product-info span {
    display: inline-block;
    margin-right: 8px;
    color: #777;
    font-size: 12px;
}

.order-product > strong {
    color: #171717;
    font-size: 14px;
    font-weight: 750;
    white-space: nowrap;
}


/* =========================================================
   ORDER INFO GRID
   ========================================================= */

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.order-info-box {
    min-width: 0;
    padding: 14px;
    border: 1px solid #eeeeee;
    border-radius: 11px;
    background: #f7f7f7;
}

.order-info-box span {
    display: block;
    margin-bottom: 6px;
    color: #777;
    font-size: 12px;
}

.order-info-box strong {
    display: block;
    color: #222;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}


/* =========================================================
   PAYMENT STATUS
   ========================================================= */

.payment-status-box {
    background: #fafafa;
}

.payment-status {
    display: inline-flex !important;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.2;
    white-space: nowrap;
}


/* PENDING */

.payment-status.pending {
    background: #fff3cd;
    color: #7a5b00;
}


/* PAID */

.payment-status.paid {
    background: #e8f7ed;
    color: #21733b;
}


/* FAILED */

.payment-status.failed {
    background: #ffe8e8;
    color: #a52828;
}


/* REFUNDED */

.payment-status.refunded {
    background: #e8f1ff;
    color: #1557a0;
}


/* =========================================================
   ADDRESS
   ========================================================= */

.order-address {
    margin-top: 18px;
    padding: 17px;
    border-radius: 12px;
    background: #f7f7f7;
}

.order-address h3,
.order-address h4 {
    margin: 0 0 8px;
    color: #222;
    font-size: 15px;
}

.order-address p {
    margin: 4px 0;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   CANCEL ORDER
   ========================================================= */

.order-cancel-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid #eeeeee;
}

.cancel-order-btn {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #d9d9d9;
    border-radius: 9px;
    background: #fff;
    color: #a52828;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.cancel-order-btn:hover {
    border-color: #a52828;
    background: #fff5f5;
    transform: translateY(-1px);
}

.cancel-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


/* =========================================================
   SEARCH EMPTY
   ========================================================= */

.orders-search-empty {
    padding: 45px 20px;
    border: 1px solid #e7e7e7;
    border-radius: 17px;
    background: #fff;
    text-align: center;
}

.orders-search-empty h3 {
    margin: 0 0 8px;
    color: #222;
    font-size: 19px;
}

.orders-search-empty p {
    margin: 0;
    color: #777;
    font-size: 14px;
}


/* =========================================================
   ORDER FOOTER
   ========================================================= */

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 17px 22px;
    border-top: 1px solid #eeeeee;
}

.order-date {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 12px;
}

.order-total {
    color: #111;
    font-size: 18px;
    font-weight: 800;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {

    .order-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .order-tracking {
        grid-template-columns: repeat(5, minmax(70px, 1fr));
        overflow-x: auto;
    }

}


@media (max-width: 700px) {

    .my-orders-page {
        padding: 35px 0 60px;
    }

    .orders-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .orders-heading h1 {
        font-size: 28px;
    }

    .orders-shop-btn {
        width: 100%;
    }

    .orders-state {
        padding: 35px 18px;
    }

    .order-card-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .order-card-body {
        padding: 17px;
    }

    .order-tracking {
        display: flex;
        gap: 18px;
        padding: 20px 16px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tracking-line {
        display: none;
    }

    .tracking-step {
        flex: 0 0 82px;
    }

    .tracking-content strong {
        font-size: 10px;
    }

    .order-product {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .order-product-image {
        width: 56px;
        height: 56px;
    }

    .order-product > strong {
        grid-column: 2;
        margin-top: -6px;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
    }

    .order-card-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .order-total {
        font-size: 17px;
    }

    .order-cancel-section {
        justify-content: stretch;
    }

    .cancel-order-btn {
        width: 100%;
    }

    .payment-status {
        font-size: 11px !important;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .order-card {
        border-radius: 14px;
    }

    .order-card-header {
        padding: 14px;
    }

    .order-card-body {
        padding: 14px;
    }

    .order-tracking {
        padding-left: 12px;
        padding-right: 12px;
    }

    .tracking-step {
        flex-basis: 78px;
    }

    .payment-status {
        padding: 4px 8px;
    }

}

/* =========================================================
   MEELO - MY ORDERS HEADER COMPATIBILITY FIX
   ========================================================= */

/* ANNOUNCEMENT BAR */
.announcement-bar {
    background: #111;
    color: #fff;
    font-size: 12px;
}

.announcement-inner {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* MAIN HEADER */
.site-header {
    position: relative;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.site-header .header-inner {
    min-height: 76px;
    display: grid;
    grid-template-columns: 180px minmax(200px, 1fr) auto;
    align-items: center;
    gap: 25px;
}

/* BRAND */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: max-content;
    color: #111;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-size: 19px;
    font-weight: 900;
}

.brand-text {
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -0.7px;
}

.brand-text span {
    color: #e91e63;
}

/* SEARCH FORM */
.search-form {
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 9px;
    background: #f8f8f8;
}

.search-form .search-icon {
    padding-left: 13px;
    font-size: 15px;
}

.search-form input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 5px;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 13px;
}

.search-form button {
    align-self: stretch;
    padding: 0 17px;
    border: 0;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* HEADER ACTIONS */
.site-header .header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-header .header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #333;
    font-size: 11px;
    text-decoration: none;
}

.site-header .header-action > span:first-child {
    font-size: 20px;
    line-height: 1;
}

.site-header .header-action > span:nth-child(2) {
    font-size: 11px;
    white-space: nowrap;
}

.header-count {
    min-width: 17px;
    min-height: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: #e91e63;
    color: #fff;
    font-size: 10px;
}

/* DESKTOP NAVIGATION */
.main-nav {
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.nav-inner {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-inner a {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 25px;
    color: #444;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.nav-inner a:hover {
    background: #111;
    color: #fff;
}

/* FOOTER */
.site-footer .footer-grid {
    grid-template-columns: 1.4fr repeat(4, 1fr);
}

.site-footer .brand {
    color: #fff;
}

.site-footer .brand-mark {
    background: #fff;
    color: #111;
}

.site-footer .brand-text {
    color: #fff;
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
    display: none;
}

/* TABLET */
@media (max-width: 900px) {
    .site-header .header-inner {
        grid-template-columns: 140px minmax(150px, 1fr) auto;
        gap: 12px;
    }

    .site-header .header-actions {
        gap: 10px;
    }

    .nav-inner {
        gap: 2px;
    }

    .nav-inner a {
        padding-inline: 9px;
    }
}

/* MOBILE */
@media (max-width: 760px) {
    .announcement-inner {
        justify-content: center;
        min-height: 29px;
    }

    .announcement-inner span:last-child {
        display: none;
    }

    .site-header .header-inner {
        min-height: auto;
        padding: 12px 0;
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .search-form {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

    .site-header .header-actions {
        gap: 12px;
    }

    .site-header .header-action > span:nth-child(2) {
        display: none;
    }

    .site-header .header-action > span:first-child {
        font-size: 19px;
    }

    .nav-inner {
        min-height: 43px;
    }

    .nav-inner a {
        font-size: 11px;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 25px 18px;
    }

    .my-orders-page {
        padding-bottom: 85px;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        min-height: 62px;
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid #e8e8e8;
        background: #fff;
        box-shadow: 0 -4px 15px rgba(0,0,0,.06);
    }

    .mobile-bottom-nav a {
        position: relative;
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: #555;
        text-decoration: none;
    }

    .mobile-bottom-nav a > span {
        font-size: 20px;
        line-height: 1;
    }

    .mobile-bottom-nav small {
        font-size: 10px;
    }

    .mobile-bottom-nav b {
        position: absolute;
        top: -5px;
        margin-left: 22px;
        min-width: 15px;
        padding: 2px 4px;
        border-radius: 20px;
        background: #e91e63;
        color: #fff;
        font-size: 9px;
    }
}

/* SMALL MOBILE */
@media (max-width: 390px) {
    .brand-text {
        font-size: 21px;
    }

    .site-header .header-actions {
        gap: 9px;
    }

    .search-form button {
        padding-inline: 12px;
    }
}