/* ==============================
   BeanJars Mobile Buyer Orders
   Scope: buyer orders pages only
   Desktop protected by media query
   ============================== */

.buyer-orders-mobile-list {
    display: none;
}

@media (max-width: 850px) {
    .buyer-orders-page .buyer-orders-desktop-table {
        display: none;
    }

    .buyer-orders-page .buyer-orders-mobile-list {
        display: block;
    }

    .buyer-orders-page .buyer-mobile-order-card {
        background: #ffffff;
        border-radius: 12px;
        margin: 10px 0;
        box-shadow: 0 1px 8px rgba(0,0,0,0.06);
        overflow: hidden;
    }

    .buyer-orders-page .buyer-mobile-order-card__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid #f0f0f0;
    }

    .buyer-orders-page .buyer-mobile-order-card__seller {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        font-size: 13px;
        font-weight: 700;
        color: #222;
    }

    .buyer-orders-page .buyer-mobile-order-card__seller span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .buyer-orders-page .buyer-mobile-order-card__status {
        flex: 0 0 auto;
        font-size: 12px;
        font-weight: 700;
        color: #0F9F9A;
    }

    .buyer-orders-page .buyer-mobile-order-card__body {
        display: flex;
        gap: 10px;
        padding: 12px;
        color: inherit;
        text-decoration: none;
    }

    .buyer-orders-page .buyer-mobile-order-card__image {
        width: 78px;
        height: 78px;
        flex: 0 0 78px;
        border-radius: 8px;
        overflow: hidden;
        background: #f3f4f6;
    }

    .buyer-orders-page .buyer-mobile-order-card__image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .buyer-orders-page .buyer-mobile-order-card__info {
        min-width: 0;
        flex: 1;
    }

    .buyer-orders-page .buyer-mobile-order-card__title {
        font-size: 14px;
        font-weight: 700;
        color: #222;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .buyer-orders-page .buyer-mobile-order-card__meta {
        margin-top: 5px;
        font-size: 12px;
        color: #777;
    }

    .buyer-orders-page .buyer-mobile-order-card__subtotal {
        margin-top: 8px;
        font-size: 13px;
        font-weight: 700;
        color: #222;
    }

    .buyer-orders-page .buyer-mobile-order-card__footer {
        padding: 10px 12px 12px;
        border-top: 1px solid #f0f0f0;
    }

    .buyer-orders-page .buyer-mobile-order-card__total {
        text-align: right;
        font-size: 13px;
        color: #444;
        margin-bottom: 10px;
    }

    .buyer-orders-page .buyer-mobile-order-card__actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }

    .buyer-orders-page .buyer-mobile-order-form {
        margin: 0;
    }

    .buyer-orders-page .buyer-mobile-order-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 78px;
        height: 32px;
        padding: 0 12px;
        border-radius: 999px;
        border: 1px solid #d1d5db;
        background: #ffffff;
        color: #374151;
        text-decoration: none;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }

    .buyer-orders-page .buyer-mobile-order-btn--primary {
        border-color: #0F9F9A;
        background: #0F9F9A;
        color: #ffffff;
    }

    .buyer-orders-page .buyer-mobile-order-btn--success {
        border-color: #16a34a;
        background: #16a34a;
        color: #ffffff;
    }

        .buyer-orders-page .buyer-mobile-order-btn--ghost {
        background: #ffffff;
        color: #374151;
    }

    .buyer-orders-page .buyer-mobile-order-btn--chat {
        gap: 5px;
    }
}

@media (max-width: 850px) {
    body.bj-buyer-orders-mobile-page {
        padding-top: 0;
        background: #f4f5f7;
    }

    body.bj-buyer-orders-mobile-page .site-header {
        display: none;
    }

    body.bj-buyer-orders-mobile-page .account-dashboard-wrapper {
        display: block;
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    body.bj-buyer-orders-mobile-page .account-sidebar {
        display: none;
    }

    body.bj-buyer-orders-mobile-page .account-main-content {
        display: block;
        width: 100%;
        padding: 0;
    }

    body.bj-buyer-orders-mobile-page .account-main-content > * {
        width: 100%;
        max-width: 100%;
    }

    body.bj-buyer-orders-mobile-page .dashboard-overview {
        display: none;
    }
}

@media (max-width: 850px) {
    .buyer-orders-page .buyer-orders-tabs {
        margin: 10px 0 0;
        padding: 0;
        background: #ffffff;
        border-radius: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .buyer-orders-page .buyer-orders-tabs .purchase-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        min-width: max-content;
        margin: 0;
        border-bottom: 1px solid #eeeeee;
    }

    .buyer-orders-page .buyer-orders-tabs .purchase-tab {
        flex: 0 0 auto;
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
        text-align: center;
        color: #333333;
        border-bottom: 2px solid transparent;
        text-decoration: none;
        background: transparent;
    }

    .buyer-orders-page .buyer-orders-tabs .purchase-tab.active {
        color: #0F9F9A;
        border-bottom-color: #0F9F9A;
        font-weight: 700;
    }

    .buyer-orders-page .buyer-orders-tabs .purchase-tab.disabled {
        color: #999999;
    }
}

.buyer-order-details-mobile {
    display: none;
}

@media (max-width: 850px) {
    .buyer-order-details-page .buyer-order-details-desktop {
        display: none;
    }

    .buyer-order-details-page .buyer-order-details-mobile {
        display: block;
        min-height: 100vh;
        background: #f4f5f7;
        padding-bottom: 24px;
    }

    .buyer-order-details-page .buyer-order-details-mobile__header {
        display: flex;
        align-items: center;
        min-height: 52px;
        padding: 0 14px;
        background: #0F9F9A;
        color: #ffffff;
        box-sizing: border-box;
    }

    .buyer-order-details-page .buyer-order-details-mobile__back {
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        text-decoration: none;
        font-size: 18px;
        flex: 0 0 36px;
    }

    .buyer-order-details-page .buyer-order-details-mobile__title {
        flex: 1;
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        padding-right: 36px;
    }

    .buyer-order-details-page .buyer-order-details-mobile__card {
        margin: 10px;
        padding: 14px 12px;
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 1px 8px rgba(0,0,0,0.06);
        box-sizing: border-box;
    }

    .buyer-order-details-page .buyer-order-details-mobile__brand {
        color: #0F9F9A;
        font-size: 22px;
        font-weight: 800;
        margin-bottom: 12px;
    }

    .buyer-order-details-page .buyer-order-details-mobile__section {
        border-top: 1px solid #f0f0f0;
    }

    .buyer-order-details-page .buyer-order-details-mobile__row {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 13px;
        color: #555555;
    }

    .buyer-order-details-page .buyer-order-details-mobile__row strong {
        color: #222222;
        text-align: right;
        font-weight: 700;
        word-break: break-word;
    }
}

@media (max-width: 850px) {
    .buyer-order-details-page .buyer-order-details-mobile__card-title {
        font-size: 15px;
        font-weight: 800;
        color: #222222;
        margin-bottom: 10px;
    }

    .buyer-order-details-page .buyer-order-details-mobile__address-row {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 13px;
        color: #555555;
    }

    .buyer-order-details-page .buyer-order-details-mobile__address-row span {
        display: block;
        margin-bottom: 6px;
        color: #555555;
    }

    .buyer-order-details-page .buyer-order-details-mobile__address-row strong {
        display: block;
        color: #222222;
        font-weight: 700;
        white-space: pre-line;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.45;
    }
}

@media (max-width: 850px) {
    .buyer-order-details-page .buyer-order-details-mobile__items {
        border-top: 1px solid #f0f0f0;
    }

    .buyer-order-details-page .buyer-order-details-mobile__item {
        display: flex;
        gap: 10px;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .buyer-order-details-page .buyer-order-details-mobile__item-image {
        width: 72px;
        height: 72px;
        flex: 0 0 72px;
        border-radius: 8px;
        overflow: hidden;
        background: #f3f4f6;
    }

    .buyer-order-details-page .buyer-order-details-mobile__item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .buyer-order-details-page .buyer-order-details-mobile__item-info {
        min-width: 0;
        flex: 1;
    }

    .buyer-order-details-page .buyer-order-details-mobile__item-title {
        font-size: 14px;
        font-weight: 700;
        color: #222222;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .buyer-order-details-page .buyer-order-details-mobile__item-meta {
        margin-top: 6px;
        font-size: 12px;
        color: #777777;
    }

    .buyer-order-details-page .buyer-order-details-mobile__item-total {
        margin-top: 8px;
        font-size: 13px;
        font-weight: 800;
        color: #222222;
        text-align: right;
    }

    .buyer-order-details-page .buyer-order-details-mobile__empty {
        padding: 12px 0 2px;
        font-size: 13px;
        color: #666666;
    }

    .buyer-order-details-page .buyer-order-details-mobile__row--grand span,
    .buyer-order-details-page .buyer-order-details-mobile__row--grand strong {
        color: #0F9F9A;
        font-size: 15px;
        font-weight: 800;
    }
}

@media (max-width: 850px) {
    .buyer-order-details-page .buyer-order-details-mobile__actions {
        display: grid;
        gap: 10px;
    }

    .buyer-order-details-page .buyer-order-details-mobile__form {
        margin: 0;
    }

    .buyer-order-details-page .buyer-order-details-mobile__btn {
        width: 100%;
        min-height: 42px;
        border-radius: 10px;
        border: 1px solid #0F9F9A;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        font-size: 14px;
        font-weight: 800;
        box-sizing: border-box;
        cursor: pointer;
    }

    .buyer-order-details-page .buyer-order-details-mobile__btn--primary {
        background: #0F9F9A;
        color: #ffffff;
    }

    .buyer-order-details-page .buyer-order-details-mobile__btn--ghost {
        background: #ffffff;
        color: #0F9F9A;
    }

    .buyer-order-details-page .buyer-order-details-mobile__notice {
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
        text-align: center;
        font-size: 12px;
        color: #666666;
        line-height: 1.45;
    }
}

.buyer-orders-mobile-back {
    display: none;
}

@media (max-width: 850px) {
    .buyer-orders-page .buyer-orders-mobile-back {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        margin-top: 8px;
        color: #0F9F9A;
        text-decoration: none;
        font-size: 14px;
        font-weight: 700;
    }

    .buyer-orders-page .buyer-orders-mobile-back i {
        font-size: 18px;
    }
}

/* ==============================
   Buyer Orders: Zenbook / narrow desktop-table layout safety
   Scope: Buyer Orders only, 851px-1100px desktop-style tablet widths
   Phones, Ad Details, Seller pages, and normal desktop protected
   ============================== */
@media (min-width: 851px) and (max-width: 1100px) {
    body.bj-buyer-orders-mobile-page .account-dashboard-wrapper {
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
    }

    body.bj-buyer-orders-mobile-page .account-main-content {
        min-width: 0;
        width: auto;
        flex: 1 1 auto;
    }

    body.bj-buyer-orders-mobile-page .account-main-content > * {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    body.bj-buyer-orders-mobile-page .buyer-orders-table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
}
