/* ===== CSS CHO SHOP TIỀN NẠP ===== */

/* Thông tin điểm */
.donate-points-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.points-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s;
}

.points-card:hover {
    transform: translateY(-5px);
}

.points-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.points-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.points-icon {
    font-size: 40px;
}

.points-details {
    flex: 1;
}

.points-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.points-value {
    font-size: 24px;
    font-weight: 700;
}

/* Controls */
.shop-controls {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.control-group {
    flex: 1;
    min-width: 200px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.server-select,
.category-select,
.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.server-select:focus,
.category-select:focus,
.search-input:focus {
    border-color: #3498db;
    outline: none;
}

.search-input {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%236c757d" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: 95% center;
    background-size: 16px;
}

/* Shop items grid */
#shopItemsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.shop-item-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid #e9ecef;
    transition: all 0.3s;
    position: relative;
}

.shop-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #3498db;
}

.shop-item-card.hot::before {
    content: 'HOT';
    position: absolute;
    top: 10px;
    right: -30px;
    background: #e74c3c;
    color: white;
    padding: 5px 30px;
    font-size: 12px;
    font-weight: bold;
    transform: rotate(45deg);
    z-index: 1;
}

.shop-item-card.new::before {
    content: 'MỚI';
    position: absolute;
    top: 10px;
    right: -30px;
    background: #2ecc71;
    color: white;
    padding: 5px 30px;
    font-size: 12px;
    font-weight: bold;
    transform: rotate(45deg);
    z-index: 1;
}

.shop-item-header {
    padding: 15px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
}

.shop-item-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    padding: 10px;
    border: 2px solid #dee2e6;
}

.shop-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.shop-item-name {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.3;
}

.shop-item-id {
    font-size: 11px;
    color: #7f8c8d;
}

.shop-item-body {
    padding: 15px;
}

.shop-item-description {
    font-size: 12px;
    color: #546e7a;
    line-height: 1.4;
    margin-bottom: 15px;
    min-height: 60px;
}

.shop-item-details {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 3px;
}

.detail-label {
    color: #6c757d;
}

.detail-value {
    color: #2c3e50;
    font-weight: 500;
}

.shop-item-price {
    text-align: center;
    margin-bottom: 15px;
}

.price-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.price-value {
    font-size: 24px;
    font-weight: 700;
    color: #e74c3c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.price-value::before {
    content: '💰';
    font-size: 18px;
}

.shop-item-actions {
    display: flex;
    gap: 10px;
}

.btn-buy {
    flex: 1;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-buy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-buy:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-detail {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Stock indicator */
.item-stock {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.stock-available {
    background: #2ecc71;
    color: white;
}

.stock-low {
    background: #f39c12;
    color: white;
}

.stock-out {
    background: #e74c3c;
    color: white;
}

/* Purchase history */
.purchase-history {
    margin: 40px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.purchase-history h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

#purchaseHistory {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.history-item:hover {
    background-color: #f8f9fa;
}

.history-item.delivered {
    border-left: 4px solid #2ecc71;
}

.history-item.pending {
    border-left: 4px solid #f39c12;
}

.history-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
}

.history-details {
    flex: 1;
}

.history-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.history-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #7f8c8d;
}

.history-actions {
    text-align: center;
    margin-top: 20px;
}

.btn-load-more {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Shop notice */
.shop-notice {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    margin: 20px 0;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 10px;
    border: 2px solid #2196F3;
}

.notice-icon {
    font-size: 40px;
    animation: pulse 2s infinite;
}

.notice-content h4 {
    margin: 0 0 10px 0;
    color: #1565c0;
    font-size: 16px;
}

.notice-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #333;
}

/* Loading */
.shop-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Categories filter */
.category-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.category-btn {
    padding: 8px 20px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.category-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.empty-state-message {
    font-size: 14px;
    color: #7f8c8d;
}

/* Responsive */
@media (max-width: 1200px) {
    #shopItemsContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    #shopItemsContainer {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .donate-points-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #shopItemsContainer {
        grid-template-columns: 1fr;
    }
    
    .shop-controls {
        flex-direction: column;
    }
    
    .control-group {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .shop-item-actions {
        flex-direction: column;
    }
    
    .history-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* ===== MODAL MUA HÀNG ===== */
#purchaseModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

#purchaseItemInfo {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.purchase-item-image {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.purchase-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.purchase-item-details {
    flex: 1;
}

.purchase-item-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.purchase-item-price {
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

.purchase-item-id {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.purchase-item-stock {
    font-size: 12px;
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 12px;
    background: #e8f5e9;
    display: inline-block;
}

.quantity-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.quantity-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: block;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #3498db;
    color: white;
}

.current-qty {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    min-width: 40px;
    text-align: center;
}

.qty-input {
    width: 80px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-left: 10px;
}

.qty-input:focus {
    border-color: #3498db;
    outline: none;
}

.purchase-summary {
    background: white;
    border: 2px solid #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.summary-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.total {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    padding-top: 15px;
    border-top: 2px solid #eee;
    margin-top: 10px;
}

.points-row {
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    margin-top: 5px;
}

#remainingPoints {
    font-weight: bold;
    font-size: 16px;
    color: #2ecc71;
}

#remainingPoints.negative {
    color: #e74c3c;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.modal-footer button {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 14px;
    min-width: 120px;
}

.btn-cancel {
    background: #f5f5f5;
    color: #424242;
    border: 1px solid #ddd;
}

.btn-cancel:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.btn-confirm {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.btn-confirm:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive cho modal */
@media (max-width: 768px) {
    #purchaseModal {
        padding: 10px;
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    #purchaseItemInfo {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .purchase-item-image {
        width: 80px;
        height: 80px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .modal-body {
        padding: 15px;
    }
    
    .quantity-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .qty-input {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .modal-footer {
        padding: 15px;
        gap: 10px;
    }
    
    .modal-footer button {
        padding: 10px 15px;
        min-width: auto;
    }
}

/* Item detail modal */
.item-detail-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.item-detail-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.item-detail-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.item-detail-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.item-detail-close {
    cursor: pointer;
    font-size: 24px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.item-detail-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.item-detail-body {
    padding: 25px;
}

.item-detail-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    padding: 15px;
    border: 2px solid #dee2e6;
}

.item-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-detail-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 10px;
}

.item-detail-price {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 20px;
}

.item-detail-section {
    margin-bottom: 25px;
}

.item-detail-section h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.detail-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.detail-label {
    font-size: 12px;
    color: #6c757d;
    display: block;
    margin-bottom: 5px;
}

.detail-value {
    font-weight: 600;
    color: #2c3e50;
    display: block;
}

.item-attributes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.attribute-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.attribute-label {
    font-size: 12px;
    color: #6c757d;
    display: block;
}

.attribute-value {
    font-weight: 700;
    color: #2c3e50;
    display: block;
    margin-top: 5px;
}

.item-detail-note {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    color: #2e7d32;
    margin-top: 20px;
    border-left: 4px solid #4caf50;
}

.item-detail-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-close-detail {
    padding: 10px 25px;
    background: #f5f5f5;
    color: #424242;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-close-detail:hover {
    background: #e0e0e0;
}

.btn-buy-from-detail {
    padding: 10px 25px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-buy-from-detail:hover {
    background: linear-gradient(135deg, #2575fc 0%, #6a11cb 100%);
    transform: translateY(-2px);
}

/* Responsive cho modal chi tiết */
@media (max-width: 768px) {
    .item-detail-modal {
        width: 95%;
    }
    
    .item-detail-body {
        padding: 15px;
    }
    
    .item-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .item-attributes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .item-detail-footer {
        flex-direction: column;
    }
    
    .item-detail-footer button {
        width: 100%;
    }
}

/* ===== FIX CSS CHO THANH TÌM KIẾM VÀ SHOP CONTROLS ===== */

/* Controls */
.shop-controls {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    align-items: flex-end; /* Căn chỉnh các item theo đáy */
}

.control-group {
    flex: 1;
    min-width: 200px;
    max-width: 300px; /* Giới hạn độ rộng tối đa */
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

/* Select boxes */
.server-select,
.category-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: white;
    cursor: pointer;
}

.server-select:focus,
.category-select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Thanh tìm kiếm cố định */
.search-input-wrapper {
    flex: 2; /* Cho phép thanh tìm kiếm chiếm nhiều không gian hơn */
    min-width: 250px;
    max-width: 400px; /* Giới hạn tối đa */
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px; /* Chừa khoảng trống cho icon */
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: white;
    box-sizing: border-box; /* Quan trọng: tính cả padding trong width */
}

.search-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Icon search bên trong input */
.search-input {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%236c757d" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: calc(100% - 15px) center;
    background-size: 16px;
}

/* Responsive cho controls */
@media (max-width: 1200px) {
    .shop-controls {
        gap: 15px;
    }
    
    .control-group {
        min-width: 180px;
        max-width: 250px;
    }
    
    .search-input-wrapper {
        min-width: 200px;
        max-width: 350px;
    }
}

@media (max-width: 992px) {
    .shop-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        min-width: 100%;
        max-width: 100%;
    }
    
    .search-input-wrapper {
        min-width: 100%;
        max-width: 100%;
    }
    
    .server-select,
    .category-select,
    .search-input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .shop-controls {
        padding: 15px;
        gap: 12px;
    }
    
    .control-group label {
        font-size: 12px;
    }
    
    .server-select,
    .category-select,
    .search-input {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Hoặc nếu muốn layout dạng grid thay vì flex */
.shop-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
    align-items: end;
}

.shop-controls-grid .control-group {
    min-width: 100%;
    max-width: 100%;
}

.shop-controls-grid .search-input-wrapper {
    grid-column: span 2;
    min-width: 100%;
}

@media (max-width: 768px) {
    .shop-controls-grid {
        grid-template-columns: 1fr;
    }
    
    .shop-controls-grid .search-input-wrapper {
        grid-column: span 1;
    }
}

/* Style cho nút tìm kiếm nếu muốn có button riêng */
.search-with-button {
    display: flex;
    gap: 10px;
    flex: 2;
    min-width: 300px;
    max-width: 500px;
}

.search-with-button .search-input {
    flex: 1;
    min-width: 0; /* Quan trọng: cho phép input co lại */
}

.search-button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Animation cho search input */
.search-input:focus {
    animation: searchFocus 0.3s ease;
}

@keyframes searchFocus {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Placeholder style */
.search-input::placeholder {
    color: #95a5a6;
    font-size: 13px;
}

/* Clear button cho search input (chỉ hiện khi có nội dung) */
.search-input:not(:placeholder-shown) {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%236c757d" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>'), 
                      url('data:image/svg+xml;utf8,<svg fill="%2395a5a6" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg>');
    background-position: calc(100% - 15px) center, calc(100% - 40px) center;
    background-size: 16px, 16px;
    background-repeat: no-repeat;
}

/* Thêm style cho container chính */
.shop-main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Scrollbar cho select nếu có nhiều option */
.server-select,
.category-select {
    max-height: 200px;
    overflow-y: auto;
}

/* Custom scrollbar cho select */
.server-select::-webkit-scrollbar,
.category-select::-webkit-scrollbar {
    width: 8px;
}

.server-select::-webkit-scrollbar-track,
.category-select::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.server-select::-webkit-scrollbar-thumb,
.category-select::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.server-select::-webkit-scrollbar-thumb:hover,
.category-select::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* ===== FIX MẠNH CHO MODAL CHỒNG LẤP ===== */

/* Reset z-index cho body và html */
body, html {
    position: relative;
    z-index: 0;
}

/* Modal mua hàng */
#purchaseModal {
    position: fixed !important;
    z-index: 10050 !important;
}

/* Modal content */
.modal-content {
    position: relative;
    z-index: 10051 !important;
}

/* Notiflix Confirm - QUAN TRỌNG: Tăng z-index rất cao */
.notiflix-confirm {
    z-index: 999999 !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.notiflix-confirm-overlay {
    z-index: 999998 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

.notiflix-confirm-content {
    z-index: 999999 !important;
    position: relative !important;
}

/* Đảm bảo các modal Notiflix khác cũng có z-index cao */
.notiflix-report {
    z-index: 999999 !important;
}

.notiflix-report-overlay {
    z-index: 999998 !important;
}

.notiflix-report-content {
    z-index: 999999 !important;
}

.notiflix-loading {
    z-index: 999999 !important;
}

.notiflix-loading-overlay {
    z-index: 999998 !important;
}

.notiflix-notify {
    z-index: 999999 !important;
}

/* Fix riêng cho modal chi tiết vật phẩm */
.item-detail-modal-overlay {
    z-index: 10049 !important; /* Thấp hơn modal mua hàng */
}

.item-detail-modal {
    z-index: 10050 !important;
}

/* CSS cho trường hợp cần ép buộc modal lên trên cùng */
body > .notiflix-confirm,
body > .notiflix-confirm-overlay,
body > .notiflix-confirm-content {
    z-index: 2147483647 !important; /* Số z-index tối đa */
}

/* Hoặc sử dụng inline style quan trọng */
.notiflix-confirm[style] {
    z-index: 2147483647 !important;
}