:root {
    --primary: #ff6a00;
    --primary-dark: #e05e00;
    --primary-light: #fff0e6;
    --background: #f7f7f7;
    --card: #ffffff;
    --text: #111111;
    --text-muted: #666666;
    --border: #e2e8f0;
    
    /* Status Colors */
    --status-pending-bg: #fef3c7;
    --status-pending-text: #92400e;
    --status-confirm-bg: #dbeafe;
    --status-confirm-text: #1e40af;
    --status-processing-bg: #e0e7ff;
    --status-processing-text: #3730a3;
    --status-delivery-bg: #d1fae5;
    --status-delivery-text: #065f46;
    --status-return-bg: #ffedd5;
    --status-return-text: #9a3412;
    --status-cancel-bg: #fee2e2;
    --status-cancel-text: #991b1b;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Bangla Font", sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* SVG Icon Helper */
.svg-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Global Loader & Toast Notifications
   ========================================================================== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
}

.loader-gif {
    width: 70px;
    height: 70px;
    margin-bottom: 10px;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--text);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
}

/* ==========================================================================
   Main Layout & Page Controls
   ========================================================================== */
.main-content {
    padding: 24px 0 40px 0;
}

.page-heading-section {
    margin-bottom: 20px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.controls-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 600px) {
    .controls-section {
        flex-direction: row;
    }
}

.search-box-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 38px 12px 38px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    background: #ffffff;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
}

.filter-box-wrapper {
    width: 100%;
}

@media (min-width: 600px) {
    .filter-box-wrapper {
        width: 240px;
    }
}

.status-select {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text);
    outline: none;
    cursor: pointer;
}

/* ==========================================================================
   Order Card Styling
   ========================================================================== */
.orders-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.order-card:hover {
    box-shadow: var(--shadow-md);
}

.card-compact {
    padding: 16px;
}

.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}

.order-id-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-id-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.order-id-val {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
}

.icon-btn:hover {
    background: var(--background);
    color: var(--primary);
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-badge.pending { background: var(--status-pending-bg); color: var(--status-pending-text); }
.status-badge.confirm { background: var(--status-confirm-bg); color: var(--status-confirm-text); }
.status-badge.processing { background: var(--status-processing-bg); color: var(--status-processing-text); }
.status-badge.delivery { background: var(--status-delivery-bg); color: var(--status-delivery-text); }
.status-badge.return { background: var(--status-return-bg); color: var(--status-return-text); }
.status-badge.cancel { background: var(--status-cancel-bg); color: var(--status-cancel-text); }

.compact-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

@media (min-width: 480px) {
    .compact-info-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.phone-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.phone-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.toggle-details-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.toggle-details-btn:hover {
    background: #ffe3d1;
}

/* Expanded Card Content */
.card-expanded {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-block {
    background: #ffffff;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.customer-details-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 13px;
}

@media (min-width: 600px) {
    .customer-details-list {
        grid-template-columns: 1fr 1fr;
    }
}

.detail-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.detail-label {
    color: var(--text-muted);
}

.detail-val {
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* Products List */
.product-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-item-card {
    display: flex;
    gap: 12px;
    background: #ffffff;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.product-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #f9f9f9;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.product-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.product-price-summary {
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 600;
    margin-top: 4px;
}

.variant-tag {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #475569;
    display: inline-block;
    margin-top: 4px;
    margin-right: 4px;
}

.badge-free-delivery {
    background: var(--status-delivery-bg);
    color: var(--status-delivery-text);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 4px;
}

/* Pricing Breakdown Section */
.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.price-row.total-row {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
}

/* ==========================================================================
   Buttons, Pagination & Empty State
   ========================================================================== */
.pagination-wrapper {
    text-align: center;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
}

.empty-card {
    background: #ffffff;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: inline-block;
    max-width: 400px;
    width: 100%;
}

.empty-icon {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    margin-bottom: 16px;
}

.empty-card h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 16px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    min-height: 100px;
}

.footer-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.footer-loader-gif {
    width: 40px;
    height: 40px;
}
