/* Cart Panel Styles */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.cart-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.cart-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.loading i {
    margin-right: 10px;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    flex: 1;
}

.empty-icon {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart p {
    color: #666;
    margin-bottom: 20px;
}

/* Orders page styles */
.orders-container {
    padding: 20px 0;
    min-height: 60vh;
}

.orders-list {
    margin-top: 20px;
}

.order-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.order-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.order-header:hover {
    background-color: #f8f9fa;
}

.order-info {
    flex: 1;
}

.order-info h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.order-info p {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 14px;
}

.order-status {
    text-align: center;
    margin-right: 20px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-1 { background: #ffc107; color: #212529; } /* Processing */
.status-2 { background: #17a2b8; color: white; } /* Ordered */
.status-3 { background: #007bff; color: white; } /* Shipped */
.status-4 { background: #28a745; color: white; } /* Delivered */
.status-5 { background: #dc3545; color: white; } /* Returned */

.toggle-icon {
    color: #666;
    font-size: 16px;
}

.order-details {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

.delivery-info {
    margin-bottom: 20px;
}

.delivery-info h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.delivery-info p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 14px;
}

.order-items h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

.order-items .order-item {
    background: white;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.order-items .item-details h6 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.order-items .item-details p {
    margin: 0 0 3px 0;
    color: #666;
    font-size: 13px;
}

.order-items .item-total {
    font-weight: 600;
    color: #007bff;
    font-size: 14px;
}

.order-actions {
    margin-top: 20px;
    text-align: right;
}

.empty-orders {
    text-align: center;
    padding: 60px 20px;
}

.empty-orders h3 {
    color: #333;
    margin-bottom: 15px;
}

.empty-orders p {
    color: #666;
    margin-bottom: 30px;
}

/* Admin Orders styles */
.admin-orders-container {
    padding: 20px 0;
}

.order-stats .badge {
    font-size: 0.9em;
}

.order-details-admin {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.order-item-admin {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
}

.item-image-small {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-small {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 12px;
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #333;
}

.btn-link {
    text-decoration: none;
    color: #007bff;
}

.btn-link:hover {
    color: #0056b3;
}

/* Stock Warning */
.stock-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 0 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #856404;
}

.stock-warning i {
    color: #f39c12;
    font-size: 1.2rem;
}

.stock-warning p {
    margin: 0;
    font-size: 0.9rem;
}

/* Out of Stock Warning */
.out-of-stock-warning {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin: 0 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #721c24;
}

.out-of-stock-warning i {
    color: #dc3545;
    font-size: 1.2rem;
}

.out-of-stock-warning p {
    margin: 0;
    font-size: 0.9rem;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.cart-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.cart-item.stock-issue {
    background: #ffeaa7;
    border-left: 4px solid #f39c12;
}

.cart-item.out-of-stock {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    opacity: 0.8;
}

.stock-issue-text {
    color: #856404;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.stock-issue-text i {
    color: #f39c12;
}

.out-of-stock-text {
    color: #721c24;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-weight: 600;
}

.out-of-stock-text i {
    color: #dc3545;
}

.out-of-stock-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.out-of-stock-label {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.no-image {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

.item-details p {
    font-size: 0.85rem;
    margin: 0 0 5px 0;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-size {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-price {
    font-weight: 600;
    color: #e74c3c;
}

.old-price {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
}

.item-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 2px;
}

.qty-btn {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
}

.qty-btn:hover:not(:disabled) {
    background: #e9ecef;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-btn:disabled .fa-spinner {
    color: #007bff;
}

.quantity {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    transition: opacity 0.2s ease;
}

.quantity.error {
    color: #dc3545;
    background: #f8d7da;
    border-radius: 4px;
    padding: 2px 6px;
}

.quantity.loading {
    opacity: 0.6;
}

.remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.remove-btn:hover {
    background: #f8d7da;
}

.remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.remove-btn:disabled .fa-spinner {
    color: #dc3545;
}

.cart-footer {
    border-top: 1px solid #eee;
    padding: 20px;
    background: #f8f9fa;
}

.cart-total {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.cart-actions .btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-secondary {
    background: white;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

.btn-outline-secondary {
    background: #007bff;
    color: white;
}

.btn-outline-secondary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-outline-secondary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Add to Cart Component Styles */
.add-to-cart-section {
    padding: 20px 0;
}

.size-selection,
.quantity-selection {
    margin-bottom: 15px;
}

.size-selection label,
.quantity-selection label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 150px;
}

.qty-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.qty-btn:hover:not(:disabled) {
    background: #e9ecef;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px;
    font-size: 0.9rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #0056b3;
}

.add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cart-panel {
        width: 100%;
        right: -100%;
    }

    .cart-item {
        padding: 12px 15px;
    }

    .item-image {
        width: 50px;
        height: 50px;
    }
}
