/* =========================================
   ORDER PAGE STYLES
   ========================================= */

body { background: #f8f8f8; color: #111; font-family: 'Poppins', sans-serif; }

/* HEADER FIX */
#main-header { position: sticky; top: 0; z-index: 1000; background: #fff; border-bottom: 1px solid #eee; }
.back-link { text-decoration: none; color: #000; font-weight: 600; font-size: 0.85rem; }

/* LAYOUT */
.order-page-layout { max-width: 1000px; margin: 40px auto; padding: 0 20px; }
.page-header { text-align: center; margin-bottom: 40px; }
.page-heading { font-family: 'Syne'; font-size: 2rem; font-weight: 800; margin-bottom: 5px; }
.page-header p { color: #888; font-size: 0.9rem; }

/* CONTROLS (Search & Filter) */
.order-controls { margin-bottom: 30px; }

.search-orders {
    position: relative; margin-bottom: 20px;
}
.search-orders input {
    width: 100%; padding: 15px 15px 15px 45px;
    border: 1px solid #ddd; border-radius: 8px; font-family: 'Poppins'; outline: none;
}
.search-orders i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #999; }

.filter-tabs {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px;
}
.tab-btn {
    background: #fff; border: 1px solid #eee; padding: 8px 20px;
    border-radius: 30px; cursor: pointer; font-size: 0.9rem; color: #555;
    transition: 0.3s; white-space: nowrap;
}
.tab-btn:hover { background: #f0f0f0; }
.tab-btn.active { background: #000; color: #fff; border-color: #000; }

/* ORDER CARDS */
.order-list { display: flex; flex-direction: column; gap: 20px; }

.order-card {
    background: #fff; border-radius: 8px; padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); transition: 0.3s;
}
.order-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.08); }

/* Card Header */
.o-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; margin-bottom: 15px;
}
.o-id { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.o-date { font-size: 0.8rem; color: #888; }
.o-status {
    padding: 5px 12px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
/* Status Colors */
.status-delivered { background: #e8f5e9; color: #2e7d32; }
.status-processing { background: #fff3e0; color: #f57c00; }
.status-cancelled { background: #ffebee; color: #c62828; }

/* Card Body */
.o-body { display: flex; justify-content: space-between; align-items: center; }
.o-info { display: flex; gap: 15px; align-items: center; }
.o-thumbs { display: flex; gap: 5px; }
.o-thumb-img { width: 60px; height: 70px; object-fit: cover; border-radius: 4px; background: #f9f9f9; }
.o-more-count {
    width: 60px; height: 70px; display: flex; justify-content: center; align-items: center;
    background: #eee; font-size: 0.8rem; font-weight: 600; color: #555; border-radius: 4px;
}

.o-text h4 { margin: 0 0 5px; font-size: 0.95rem; }
.o-text p { margin: 0; font-size: 0.9rem; font-weight: 700; }

/* Card Actions */
.o-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 15px; }
.btn-sm-outline {
    padding: 8px 15px; border: 1px solid #ddd; background: #fff;
    font-size: 0.8rem; font-weight: 600; cursor: pointer; border-radius: 4px; transition: 0.2s;
}
.btn-sm-outline:hover { border-color: #000; color: #000; }
.btn-sm-black {
    padding: 8px 15px; border: 1px solid #000; background: #000; color: #fff;
    font-size: 0.8rem; font-weight: 600; cursor: pointer; border-radius: 4px;
}

/* MODALS */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 2000; display: none;
    justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }

.modal-box { background: #fff; width: 400px; padding: 25px; border-radius: 8px; max-height: 90vh; overflow-y: auto; }
.large-modal { width: 600px; }

.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; }
.close-modal { cursor: pointer; font-size: 1.2rem; }

.details-section { margin-bottom: 20px; }
.details-section h4 { font-size: 0.85rem; text-transform: uppercase; color: #888; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 5px; }

.modal-product-item { display: flex; gap: 10px; margin-bottom: 10px; }
.mp-img { width: 50px; height: 60px; object-fit: cover; border-radius: 4px; }
.mp-info h5 { margin: 0; font-size: 0.9rem; }
.mp-info p { margin: 0; font-size: 0.8rem; color: #666; }

.details-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.summary-row-sm { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 5px; }
.summary-row-sm.total { font-weight: 700; border-top: 1px solid #eee; padding-top: 5px; margin-top: 5px; font-size: 1rem; }

/* TIMELINE */
.tracking-meta { margin-bottom: 20px; background: #f9f9f9; padding: 10px; border-radius: 4px; font-size: 0.9rem; }
.tracking-timeline { padding-left: 10px; border-left: 2px solid #eee; margin-left: 10px; }
.tl-step { position: relative; padding-left: 20px; padding-bottom: 20px; }
.tl-step::before {
    content: ''; position: absolute; left: -6px; top: 0;
    width: 10px; height: 10px; border-radius: 50%; background: #ccc;
}
.tl-step.completed::before { background: #2ecc71; }
.tl-step.current::before { background: #000; border: 2px solid #fff; box-shadow: 0 0 0 2px #000; width: 12px; height: 12px; left: -7px; }

.tl-date { font-size: 0.75rem; color: #888; margin-bottom: 2px; }
.tl-status { font-weight: 600; font-size: 0.9rem; }
.tl-loc { font-size: 0.8rem; color: #555; }

/* LOAD MORE */
.load-more-container { text-align: center; margin-top: 30px; }
.btn-text { background: none; border: none; text-decoration: underline; cursor: pointer; color: #555; }

/* FOOTER */
#main-footer { background: #111; color: #fff; padding: 60px 0 20px; margin-top: 60px; }
.footer-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; }
.footer-links-group { display: flex; gap: 60px; }
.col ul { list-style: none; padding: 0; }
.col a { color: #aaa; text-decoration: none; line-height: 2; font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid #333; margin-top: 40px; padding-top: 20px; text-align: center; color: #666; font-size: 0.8rem; }

/* Toast */
#toast {
    visibility: hidden; min-width: 250px; background-color: #333; color: #fff;
    text-align: center; border-radius: 4px; padding: 16px;
    position: fixed; z-index: 3000; left: 50%; bottom: 80px; transform: translateX(-50%);
}
#toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 80px; opacity: 1;} }
@keyframes fadeout { from {bottom: 80px; opacity: 1;} to {bottom: 0; opacity: 0;} }

@media screen and (max-width: 768px) {
    .o-body { flex-direction: column; align-items: flex-start; gap: 15px; }
    .o-actions { width: 100%; justify-content: space-between; }
    .btn-sm-outline, .btn-sm-black { flex: 1; text-align: center; }
    .details-row-split { grid-template-columns: 1fr; }
    .large-modal { width: 95%; }
    .footer-top, .footer-links-group { flex-direction: column; gap: 30px; }
}