/**
 * dir: assets/css/
 * file: woo-order-components.css
 * GUSTABE MASTER ORDER COMPONENTS
 * ใช้ร่วมกันในหน้า: บิลใบเสร็จ (Checkout), ประวัติออเดอร์ (My Account) และ ติดตามพัสดุ (Track Order)
 */

/* =========================================
   1. โครงสร้างการ์ดหลัก (Base Card)
   ========================================= */
.gustabe-card { background: #fff; border: 1px solid var(--border-light, #e2e8f0); border-radius: 16px; margin-bottom: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); overflow: hidden; }
.gustabe-card .card-header { display: flex; align-items: center; gap: 12px; padding: 20px 25px; border-bottom: 1px solid #f1f5f9; background: #fafafa; }
.gustabe-card .icon-wrap { width: 40px; height: 40px; background: var(--primary-light, #e6fcfb); color: var(--primary-color, #04a39c); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.gustabe-card .card-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: #1e293b; }
.gustabe-card .card-body { padding: 25px; }

/* =========================================
   2. รายการสินค้า & ยอดรวม (Order Items & Totals)
   ========================================= */
.app-order-items { display: flex; flex-direction: column; gap: 15px; }
.app-order-item { display: flex; gap: 15px; align-items: center; padding-bottom: 15px; border-bottom: 1px dashed #f1f5f9; }
.app-order-item:last-child { border-bottom: none; padding-bottom: 0; }
.app-order-item .item-image { flex-shrink: 0; width: 60px; height: 60px; }
.app-order-item .item-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid #e2e8f0; }
.item-content-wrapper { flex: 1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;}
.item-info { flex: 1; }
.item-name { font-size: 14px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.item-name a { color: inherit; text-decoration: none; transition: 0.2s; }
.item-name a:hover { color: var(--primary-color, #04a39c); }
.item-meta .qty { font-size: 12px; color: #64748b; font-weight: 700; background: #f1f5f9; padding: 3px 8px; border-radius: 20px; margin-right: 5px; }
.item-total { font-weight: 800; color: var(--primary-color, #04a39c); font-size: 15px; }

.review-divider { border-top: 1px dashed #cbd5e1; margin: 20px 0; }
.app-order-totals { display: flex; flex-direction: column; gap: 12px; }
.total-row { display: flex; justify-content: space-between; font-size: 14px; color: #475569; align-items: center;}
.total-row.order_total { font-size: 16px; font-weight: 800; color: #1e293b; border-top: 1px solid #e2e8f0; padding-top: 15px; margin-top: 5px; }
.total-row.order_total .amount { color: var(--primary-color, #04a39c); font-size: 18px; }

/* =========================================
   3. ข้อมูลลูกค้า & ที่อยู่ (Customer Details)
   ========================================= */
.gustabe-customer-app-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .gustabe-customer-app-layout { grid-template-columns: 1fr; } }
.customer-column { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; }
.column-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.column-header h4 { margin: 0; font-size: 15px; font-weight: 700; color: #1e293b; }
.column-header .icon-box { color: var(--primary-color, #04a39c); font-size: 22px; display: flex; }
.detail-rows { display: flex; flex-direction: column; gap: 10px; }
.d-row { display: flex; justify-content: space-between; font-size: 13px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid #f1f5f9; }
.d-row:last-child { border-bottom: none; padding-bottom: 0; }
.d-label { color: #64748b; }
.d-value { color: #334155; text-align: right; max-width: 65%; line-height: 1.4; }
.d-value.highlight { font-weight: 700; color: #0f172a; }
.d-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; text-align: left; }
.sub-col { display: flex; flex-direction: column; gap: 4px; }
.sub-col .d-value { text-align: left; max-width: 100%; }

.contact-section { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; border-top: 1px dashed #cbd5e1; padding-top: 15px; }
.contact-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e2e8f0; padding: 8px 14px; border-radius: 50px; font-size: 12px; font-weight: 600; color: #475569; text-decoration: none; transition: 0.2s; }
.contact-pill i { color: var(--primary-color, #04a39c); font-size: 16px; }
.contact-pill:hover { border-color: var(--primary-color, #04a39c); color: var(--primary-color, #04a39c); box-shadow: 0 4px 10px rgba(4,163,156,0.1); transform: translateY(-2px); }
.shipping-note { display: flex; align-items: center; gap: 8px; background: var(--primary-light, #e6fcfb); color: var(--primary-color, #04a39c); padding: 12px 15px; border-radius: 8px; font-size: 12px; font-weight: 700; margin-top: 15px; }
.shipping-note i { font-size: 18px; }

/* =========================================
   4. Timeline สถานะพัสดุ (Order Updates)
   ========================================= */
.gustabe-tracking-result-wrapper { max-width: 900px; margin: 0 auto; }
.gustabe-order-header-card { box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.oc-status { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 50px; background: #f1f5f9; color: #475569; display: inline-block; }
.oc-status.status-completed { background: #dcfce7; color: #16a34a; }
.oc-status.status-processing { background: #e0f2fe; color: #0284c7; }
.oc-status.status-pending, .oc-status.status-on-hold { background: #fef3c7; color: #d97706; }
.oc-status.status-cancelled, .oc-status.status-failed { background: #fee2e2; color: #dc2626; }

.gustabe-order-updates-section { background: #f8fafc; padding: 20px; border-radius: 16px; border: 1px solid var(--border-light, #e2e8f0); }
.gustabe-timeline-wrapper { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 15px; }
.gustabe-timeline-wrapper::before { content: ''; position: absolute; top: 10px; bottom: 10px; left: 26px; width: 2px; background: var(--border-light, #e2e8f0); z-index: 1; }
.timeline-item { display: flex; gap: 20px; position: relative; z-index: 2; margin-bottom: 20px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-icon { width: 24px; height: 24px; flex-shrink: 0; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border-light, #e2e8f0); margin-top: 5px; z-index: 2; }
.timeline-icon .dot { width: 8px; height: 8px; background: var(--border-color, #cbd5e1); border-radius: 50%; }
.timeline-item.latest .timeline-icon { background: var(--primary-color, #04a39c); border-color: var(--primary-color, #04a39c); box-shadow: 0 0 0 4px rgba(4, 163, 156, 0.15); }
.timeline-item.latest .timeline-content { border-color: var(--primary-light, #e6fcfb); box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.timeline-content { flex: 1; position: relative; }
.timeline-content::before { content: ''; position: absolute; top: 10px; left: -6px; width: 12px; height: 12px; background: #fff; border-left: 1px solid var(--border-light, #e2e8f0); border-bottom: 1px solid var(--border-light, #e2e8f0); transform: rotate(45deg); }
.timeline-item.latest .timeline-content::before { border-color: var(--primary-light, #e6fcfb); }

/* =========================================
   5. รายการดาวน์โหลด (Downloads)
   ========================================= */
.downloads-grid { display: flex; flex-direction: column; gap: 15px; }
.download-item-card { display: flex; align-items: center; gap: 15px; padding: 15px; background: #f8fafc; border: 1px solid var(--border-light, #e2e8f0); border-radius: 12px; transition: all 0.3s ease; }
.download-item-card:hover { border-color: var(--primary-color, #04a39c); background: #fff; box-shadow: 0 5px 15px rgba(4, 163, 156, 0.05); }
.download-item-card .d-icon { width: 50px; height: 50px; background: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); flex-shrink: 0; }
.download-item-card .d-icon i { font-size: 24px; color: var(--primary-color, #04a39c); }
.download-item-card .d-info { flex: 1; }
.download-item-card .d-name a { font-size: 15px; font-weight: 700; color: var(--text-dark, #1e293b); text-decoration: none; display: block; margin-bottom: 4px; transition: 0.2s; }
.download-item-card .d-name a:hover { color: var(--primary-color, #04a39c); }
.download-item-card .d-meta .expiry { font-size: 12px; color: #64748b; display: flex; align-items: center; gap: 5px; }
.download-item-card .download-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; background: var(--primary-color, #04a39c); color: #fff; border-radius: 50px; font-size: 13px; font-weight: 700; text-decoration: none; transition: all 0.2s ease; }
.download-item-card .download-btn:hover { background: #038b85; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(4, 163, 156, 0.3); }
@media (max-width: 576px) {
    .download-item-card { flex-direction: column; align-items: flex-start; text-align: left; }
    .download-item-card .d-action, .download-item-card .download-btn { width: 100%; justify-content: center; margin-top: 5px;}
}