/**
 * Sales Page Responsive Styles
 * Optimized for mobile, tablet, and desktop
 */

/* Sales Table Responsive */
.sales-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .sales-table-wrapper table {
        font-size: 0.85rem;
    }
    
    .sales-table-wrapper th,
    .sales-table-wrapper td {
        padding: 0.5rem;
    }
    
    .sales-table-wrapper .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .sales-table-wrapper table {
        font-size: 0.75rem;
    }
    
    .sales-table-wrapper th,
    .sales-table-wrapper td {
        padding: 0.4rem 0.3rem;
    }
    
    .sales-table-wrapper .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
}

/* Page Header with Actions */
.sales-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .sales-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .sales-page-header > div:last-child {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .sales-page-header .btn {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .sales-page-header h1 {
        font-size: 1.25rem;
    }
    
    .sales-page-header .btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Filter Bar */
.sales-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .sales-filter-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .sales-filter-bar input,
    .sales-filter-bar select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sales-filter-bar {
        gap: 0.5rem;
    }
    
    .sales-filter-bar input,
    .sales-filter-bar select {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Sales Stats Cards */
.sales-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .sales-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sales-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .sales-stats-grid > div {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .sales-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .sales-stats-grid > div {
        padding: 0.6rem;
    }
    
    .sales-stats-grid .stat-value {
        font-size: 1.25rem !important;
    }
}

/* Sale Details Modal */
.sale-details-modal {
    max-width: 600px;
    margin: 2rem auto;
}

@media (max-width: 768px) {
    .sale-details-modal {
        margin: 1rem;
        max-width: 95%;
    }
    
    .sale-details-modal .card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .sale-details-modal {
        margin: 0.5rem;
        max-width: 98%;
    }
    
    .sale-details-modal .card {
        padding: 0.75rem;
    }
    
    .sale-details-modal .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Payment Section */
.payment-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .payment-section {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Action Buttons in Table */
.table-actions {
    display: flex;
    gap: 0.25rem;
}

@media (max-width: 768px) {
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-actions .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Compact Table for Mobile */
@media (max-width: 480px) {
    .sales-table-wrapper .hide-mobile {
        display: none;
    }
}

/* Empty State */
.sales-empty-state {
    text-align: center;
    padding: 3rem;
}

@media (max-width: 768px) {
    .sales-empty-state {
        padding: 2rem;
    }
    
    .sales-empty-state svg {
        width: 48px;
        height: 48px;
    }
    
    .sales-empty-state h3 {
        font-size: 1rem;
    }
    
    .sales-empty-state p {
        font-size: 0.85rem;
    }
}

/* Customer Select */
.customer-select-group {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .customer-select-group {
        flex-direction: column;
    }
    
    .customer-select-group select,
    .customer-select-group button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .customer-select-group select {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}
