.product-grid {
    display: grid;
    /* 쇼핑몰은 카드가 작게 여러개 나오므로 220px */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 0;
    margin: 0;
}

/* 쇼핑몰 카드 스타일 */
.product-grid .card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.product-grid .card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.product-grid .card-image {
    width: 100%;
    aspect-ratio: 1/1; /* 정사각형 */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: var(--gray-light);
}

.price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* --- 장바구니 UI --- */
.cart-summary {
    position: fixed;
    bottom: 60px; 
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px); 
    max-width: 400px;
    box-sizing: border-box; 
    background: #333;
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 10000; 
    cursor: pointer;
    transition: transform 0.2s;
}
.cart-summary:active { transform: translateX(-50%) scale(0.98); }

.total-price {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

/* 장바구니 모달 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 11000;
    display: none;
    justify-content: center;
    align-items: flex-end;
}
.modal-overlay.open { display: flex; }

.cart-modal {
    background: white;
    width: 100%;
    max-width: 600px;
    height: 80vh;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee;
}
.btn-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.cart-list { flex: 1; overflow-y: auto; }

.cart-item {
    display: flex; align-items: center; padding: 15px 0;
    border-bottom: 1px solid #f5f5f5; transition: opacity 0.3s;
}
.cart-item.inactive { opacity: 0.5; }
.cart-item img {
    width: 60px; height: 60px; border-radius: 8px;
    object-fit: cover; margin: 0 15px; background: #eee;
}
.item-info { flex: 1; }
.item-name { font-weight: bold; font-size: 1rem; margin-bottom: 4px; }
.item-price { color: #666; font-size: 0.9rem; }
.item-price.zero { color: #ccc; text-decoration: line-through; }

.item-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.qty-wrapper { display: flex; align-items: center; background: #f0f0f0; border-radius: 6px; }

.qty-btn {
    width: 28px; height: 28px; border: none; background: none;
    cursor: pointer; font-weight: bold; color: #555;
    transition: all 0.2s; border-radius: 4px;
}
.qty-btn:hover { background-color: rgba(0,0,0,0.05); color: var(--primary); }
.qty-btn:disabled { opacity: 0.2; cursor: not-allowed; color: #999; pointer-events: none; }
.qty-display { width: 30px; text-align: center; font-size: 0.9rem; font-weight: 600; }

input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }

.btn-delete {
    background: none; border: none; color: #999; font-size: 1.1rem;
    cursor: pointer; padding: 0 5px 5px 5px; margin-left: auto; 
    transition: color 0.2s;
}
.btn-delete:hover { color: #ff4d4f; }
